Skip to content

Commit a750ce5

Browse files
committed
Fix setting property namespace for unsupported AGP
1 parent 675defe commit a750ce5

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

android/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ apply plugin: 'kotlin-android'
2727
android {
2828
compileSdkVersion 31
2929

30-
namespace = 'dev.fluttercommunity.android_id'
30+
// Only set namespace on compatible versions (Android Gradle plugin >= 7.0.0)
31+
// The if-check checks for a property that has been removed since AGP 7.0.0
32+
// https://developer.android.com/build/releases/past-releases/agp-7-0-0-release-notes#build-cache-removed
33+
if (!project.hasProperty("android.buildCacheDir")) {
34+
namespace = 'dev.fluttercommunity.android_id'
35+
}
3136

3237
compileOptions {
3338
sourceCompatibility JavaVersion.VERSION_1_8

0 commit comments

Comments
 (0)