diff --git a/android-sdk/build.gradle b/android-sdk/build.gradle index 0dbdbe37..0605c3df 100644 --- a/android-sdk/build.gradle +++ b/android-sdk/build.gradle @@ -72,11 +72,14 @@ dependencies { testImplementation "org.powermock:powermock-mockito-release-full:$powermock_ver" testImplementation "com.noveogroup.android:android-logger:$android_logger_ver" - androidTestImplementation "androidx.test.ext:junit:$androidx_test" - // Set this dependency to use JUnit 4 rules - androidTestImplementation "androidx.test:rules:$androidx_test" - // Set this dependency to build and run Espresso tests + androidTestImplementation "androidx.work:work-testing:$work_runtime" + androidTestImplementation "androidx.test.ext:junit:$androidx_test_junit" androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_ver" + // Set this dependency to use JUnit 4 rules + androidTestImplementation "androidx.test:rules:$androidx_test_rules" + androidTestImplementation "androidx.test:core:$androidx_test_core" + androidTestImplementation "androidx.test:core-ktx:$androidx_test_core" + androidTestImplementation "org.mockito:mockito-core:$mockito_ver" androidTestImplementation "com.crittercism.dexmaker:dexmaker:$dexmaker_ver" androidTestImplementation "com.crittercism.dexmaker:dexmaker-dx:$dexmaker_ver" diff --git a/build.gradle b/build.gradle index d12c51b4..f734d41a 100644 --- a/build.gradle +++ b/build.gradle @@ -60,21 +60,23 @@ ext { compile_sdk_version = 32 build_tools_version = "30.0.3" min_sdk_version = 14 - target_sdk_version = 29 + target_sdk_version = 32 java_core_ver = "3.10.2" android_logger_ver = "1.3.6" jacksonversion= "2.11.2" - annotations_ver = "1.0.0" + annotations_ver = "1.2.0" junit_ver = "4.12" mockito_ver = "1.10.19" powermock_ver = "1.6.4" support_test_runner_ver = "0.5" dexmaker_ver = "1.4" - espresso_ver = "3.1.0" - gson_ver = "2.8.6" + gson_ver = "2.8.9" group_id = "com.optimizely.ab" - androidx_test = "1.1.1" - work_runtime = "2.5.0" + work_runtime = "2.7.1" + androidx_test_junit = "1.1.3" + androidx_test_core = "1.4.0" + androidx_test_rules = "1.4.0" + espresso_ver = "3.4.0" } task clean(type: Delete) { diff --git a/datafile-handler/build.gradle b/datafile-handler/build.gradle index ceac4c6e..480bc9db 100644 --- a/datafile-handler/build.gradle +++ b/datafile-handler/build.gradle @@ -58,11 +58,12 @@ dependencies { testImplementation "com.noveogroup.android:android-logger:$android_logger_ver" androidTestImplementation "androidx.work:work-testing:$work_runtime" - androidTestImplementation "androidx.test.ext:junit:$androidx_test" - // Set this dependency to use JUnit 4 rules - androidTestImplementation "androidx.test:rules:$androidx_test" - // Set this dependency to build and run Espresso tests + androidTestImplementation "androidx.test.ext:junit:$androidx_test_junit" androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_ver" + // Set this dependency to use JUnit 4 rules + androidTestImplementation "androidx.test:rules:$androidx_test_rules" + androidTestImplementation "androidx.test:core:$androidx_test_core" + androidTestImplementation "androidx.test:core-ktx:$androidx_test_core" androidTestImplementation "org.mockito:mockito-core:$mockito_ver" androidTestImplementation "com.crittercism.dexmaker:dexmaker:$dexmaker_ver" diff --git a/event-handler/build.gradle b/event-handler/build.gradle index 09be1155..28026a85 100644 --- a/event-handler/build.gradle +++ b/event-handler/build.gradle @@ -62,11 +62,13 @@ dependencies { testImplementation "com.noveogroup.android:android-logger:$android_logger_ver" androidTestImplementation "androidx.work:work-testing:$work_runtime" - androidTestImplementation "androidx.test.ext:junit:$androidx_test" - // Set this dependency to use JUnit 4 rules - androidTestImplementation "androidx.test:rules:$androidx_test" - // Set this dependency to build and run Espresso tests + androidTestImplementation "androidx.test.ext:junit:$androidx_test_junit" androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_ver" + // Set this dependency to use JUnit 4 rules + androidTestImplementation "androidx.test:rules:$androidx_test_rules" + androidTestImplementation "androidx.test:core:$androidx_test_core" + androidTestImplementation "androidx.test:core-ktx:$androidx_test_core" + androidTestImplementation "org.mockito:mockito-core:$mockito_ver" androidTestImplementation "com.crittercism.dexmaker:dexmaker:$dexmaker_ver" androidTestImplementation "com.crittercism.dexmaker:dexmaker-dx:$dexmaker_ver" diff --git a/shared/build.gradle b/shared/build.gradle index dde63818..a1efce2d 100644 --- a/shared/build.gradle +++ b/shared/build.gradle @@ -62,11 +62,13 @@ dependencies { testImplementation "com.noveogroup.android:android-logger:$android_logger_ver" androidTestImplementation "androidx.work:work-testing:$work_runtime" - androidTestImplementation "androidx.test.ext:junit:$androidx_test" - // Set this dependency to use JUnit 4 rules - androidTestImplementation "androidx.test:rules:$androidx_test" - // Set this dependency to build and run Espresso tests + androidTestImplementation "androidx.test.ext:junit:$androidx_test_junit" androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_ver" + // Set this dependency to use JUnit 4 rules + androidTestImplementation "androidx.test:rules:$androidx_test_rules" + androidTestImplementation "androidx.test:core:$androidx_test_core" + androidTestImplementation "androidx.test:core-ktx:$androidx_test_core" + androidTestImplementation "org.mockito:mockito-core:$mockito_ver" androidTestImplementation "com.crittercism.dexmaker:dexmaker:$dexmaker_ver" androidTestImplementation "com.crittercism.dexmaker:dexmaker-dx:$dexmaker_ver" diff --git a/shared/src/main/java/com/optimizely/ab/android/shared/ServiceScheduler.java b/shared/src/main/java/com/optimizely/ab/android/shared/ServiceScheduler.java index e1ffa925..9c0f5610 100644 --- a/shared/src/main/java/com/optimizely/ab/android/shared/ServiceScheduler.java +++ b/shared/src/main/java/com/optimizely/ab/android/shared/ServiceScheduler.java @@ -252,7 +252,8 @@ public PendingIntent getPendingIntent(Intent intent) { } private PendingIntent getPendingIntent(Intent intent, int flag) { - return PendingIntent.getService(context, 0, intent, flag); + // Android 31+ requires FLAG_IMMUTABLE explicitly + return PendingIntent.getService(context, 0, intent, flag | PendingIntent.FLAG_IMMUTABLE); } } diff --git a/test-app/build.gradle b/test-app/build.gradle index 71ef929c..eef26c9f 100644 --- a/test-app/build.gradle +++ b/test-app/build.gradle @@ -68,12 +68,14 @@ dependencies { // testImplementation 'com.optimizely.ab:android-sdk:1.0.0' testImplementation project(':android-sdk') - androidTestImplementation('androidx.test.ext:junit:1.1.1') - //androidTestimplementation "androidx.annotation:annotation:$annotations_ver" - // Set this dependency to use JUnit 4 rules - androidTestImplementation "androidx.test:rules:$androidx_test" - // Set this dependency to build and run Espresso tests + androidTestImplementation "androidx.work:work-testing:$work_runtime" + androidTestImplementation "androidx.test.ext:junit:$androidx_test_junit" androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_ver" + // Set this dependency to use JUnit 4 rules + androidTestImplementation "androidx.test:rules:$androidx_test_rules" + androidTestImplementation "androidx.test:core:$androidx_test_core" + androidTestImplementation "androidx.test:core-ktx:$androidx_test_core" + androidTestImplementation "org.mockito:mockito-core:$mockito_ver" androidTestImplementation "com.crittercism.dexmaker:dexmaker:$dexmaker_ver" androidTestImplementation "com.crittercism.dexmaker:dexmaker-dx:$dexmaker_ver" diff --git a/test-app/src/main/AndroidManifest.xml b/test-app/src/main/AndroidManifest.xml index 86d4b788..9061b61a 100644 --- a/test-app/src/main/AndroidManifest.xml +++ b/test-app/src/main/AndroidManifest.xml @@ -40,6 +40,7 @@ diff --git a/user-profile/build.gradle b/user-profile/build.gradle index 8dc88d55..368f1551 100644 --- a/user-profile/build.gradle +++ b/user-profile/build.gradle @@ -57,11 +57,14 @@ dependencies { testImplementation "org.mockito:mockito-core:$mockito_ver" testImplementation "com.noveogroup.android:android-logger:$android_logger_ver" - androidTestImplementation "androidx.test.ext:junit:$androidx_test" - // Set this dependency to use JUnit 4 rules - androidTestImplementation "androidx.test:rules:$androidx_test" - // Set this dependency to build and run Espresso tests + androidTestImplementation "androidx.work:work-testing:$work_runtime" + androidTestImplementation "androidx.test.ext:junit:$androidx_test_junit" androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_ver" + // Set this dependency to use JUnit 4 rules + androidTestImplementation "androidx.test:rules:$androidx_test_rules" + androidTestImplementation "androidx.test:core:$androidx_test_core" + androidTestImplementation "androidx.test:core-ktx:$androidx_test_core" + androidTestImplementation "org.mockito:mockito-core:$mockito_ver" androidTestImplementation "com.crittercism.dexmaker:dexmaker:$dexmaker_ver" androidTestImplementation "com.crittercism.dexmaker:dexmaker-dx:$dexmaker_ver"