Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support of namespace property to support Android Gradle Plugin 8. #843

Merged
merged 8 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/google_mobile_ads.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
java-version: '17'
- name: "Install Flutter"
run: ./.github/workflows/scripts/install-flutter.sh stable
- name: "Install Tools"
Expand Down
38 changes: 20 additions & 18 deletions packages/google_mobile_ads/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.android.tools.build:gradle:8.0.1'
}
}

Expand All @@ -24,30 +24,33 @@ apply plugin: 'com.android.library'
android {
compileSdkVersion 33

if (project.android.hasProperty('namespace')) {
namespace 'io.flutter.plugins.googlemobileads'
}

defaultConfig {
minSdkVersion 19
}
lintOptions {
disable 'InvalidPackage'
}
dependencies {
api 'com.google.android.gms:play-services-ads:22.0.0'
implementation 'com.google.android.ump:user-messaging-platform:2.1.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.lifecycle:lifecycle-process:2.2.0'
implementation 'com.google.errorprone:error_prone_annotations:2.16'
testImplementation 'junit:junit:4.12'
testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation 'org.mockito:mockito-inline:3.9.0'
testImplementation 'org.robolectric:robolectric:4.4'
testImplementation 'androidx.test:core:1.3.0'

api 'com.google.android.gms:play-services-ads:22.4.0'
implementation 'com.google.android.ump:user-messaging-platform:2.1.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.lifecycle:lifecycle-process:2.6.2'
implementation 'com.google.errorprone:error_prone_annotations:2.16'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation 'org.mockito:mockito-inline:5.2.0'
testImplementation 'org.robolectric:robolectric:4.10.3'
testImplementation 'androidx.test:core:1.5.0'
}
testOptions {
unitTests {
includeAndroidResources = true
testOptions {
unitTests {
includeAndroidResources = true
}
}
}
}

afterEvaluate {
Expand All @@ -56,8 +59,7 @@ afterEvaluate {
for (def dependency : configuration.dependencies) {
if (dependency.group == 'io.flutter' &&
dependency.name.startsWith('flutter_embedding') &&
dependency.isTransitive())
{
dependency.isTransitive()) {
containsEmbeddingDependencies = true
break
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Aug 06 00:12:49 EDT 2021
#Sat May 13 14:37:03 CEST 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
7 changes: 5 additions & 2 deletions packages/google_mobile_ads/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 33

namespace 'io.flutter.plugins.googlemobileadsexample'

LTPhantom marked this conversation as resolved.
Show resolved Hide resolved
lintOptions {
disable 'InvalidPackage'
}
Expand All @@ -38,6 +40,7 @@ android {
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}

buildTypes {
Expand All @@ -49,8 +52,8 @@ android {
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add multiDexEnabled true in line 43


compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/google_mobile_ads/example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath 'com.android.tools.build:gradle:8.0.1'
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Mar 18 15:32:52 PDT 2021
#Sat May 13 14:40:00 CEST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip