Skip to content

Commit 2753b65

Browse files
(fix): this fixes proguard rules when running minifyEnabled (#266)
* this fixes proguard rules when running minifyEnabled * remove extra compileOnly include * add compile only for slf4j. also, cleanup organization of gradle file. * cancel pending after jobscheduler
1 parent edade96 commit 2753b65

File tree

8 files changed

+15
-2
lines changed

8 files changed

+15
-2
lines changed

android-sdk/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ dependencies {
6666
exclude group: 'com.google.code.findbugs'
6767
}
6868

69+
provided "com.fasterxml.jackson.core:jackson-databind:$jacksonversion"
6970
compile "com.android.support:support-annotations:$support_annotations_ver"
7071

7172
testCompile "junit:junit:$junit_ver"

build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ ext {
5555
target_sdk_version = 28
5656
java_core_ver = "3.0.0"
5757
android_logger_ver = "1.3.6"
58+
jacksonversion= "2.9.8"
5859
support_annotations_ver = "24.2.1"
5960
junit_ver = "4.12"
6061
mockito_ver = "1.9.5"

datafile-handler/build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ dependencies {
5555
compile project(':shared')
5656
compile "com.android.support:support-annotations:$support_annotations_ver"
5757

58+
provided "com.noveogroup.android:android-logger:$android_logger_ver"
59+
5860
testCompile "junit:junit:$junit_ver"
5961
testCompile "org.mockito:mockito-core:$mockito_ver"
6062
testCompile "com.noveogroup.android:android-logger:$android_logger_ver"

event-handler/build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ dependencies {
5656
compile project(':shared')
5757
compile "com.android.support:support-annotations:$support_annotations_ver"
5858

59+
provided "com.noveogroup.android:android-logger:$android_logger_ver"
60+
5961
testCompile "junit:junit:$junit_ver"
6062
testCompile "org.mockito:mockito-core:$mockito_ver"
6163
testCompile "com.noveogroup.android:android-logger:$android_logger_ver"

proguard-rules.txt

+6
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,9 @@
5858

5959
# Android Logger
6060
-keep class com.noveogroup.android.log.** { *; }
61+
62+
-optimizations !class/unboxing/enum
63+
64+
-dontwarn com.google.gson.**
65+
-dontwarn com.optimizely.ab.config.parser.**
66+

shared/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ android {
5353
}
5454

5555
dependencies {
56-
compile "com.noveogroup.android:android-logger:$android_logger_ver"
5756
compile ("com.optimizely.ab:core-api:$java_core_ver") {
5857
exclude group: 'com.google.code.findbugs'
5958
}
6059
compile "com.google.code.gson:gson:$gson_ver"
6160

6261
provided "com.android.support:support-annotations:$support_annotations_ver"
62+
provided "com.noveogroup.android:android-logger:$android_logger_ver"
6363

6464
testCompile "junit:junit:$junit_ver"
6565
testCompile "org.mockito:mockito-core:$mockito_ver"

shared/src/main/java/com/optimizely/ab/android/shared/ServiceScheduler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,11 @@ private void cancelRepeating(PendingIntent pendingIntent, Intent intent) {
157157
Integer id = null;
158158
try {
159159
id = (Integer) Class.forName(clazz).getDeclaredField("JOB_ID").get(null);
160-
pendingIntent.cancel();
161160
// only cancel periodic services
162161
if (ServiceScheduler.isScheduled(context, id)) {
163162
jobScheduler.cancel(id);
164163
}
164+
pendingIntent.cancel();
165165
} catch (Exception e) {
166166
logger.error("Error in Cancel ", e);
167167
}

user-profile/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ android {
5454
dependencies {
5555
compile project(':shared')
5656
provided "com.android.support:support-annotations:$support_annotations_ver"
57+
provided "com.noveogroup.android:android-logger:$android_logger_ver"
5758

5859
testCompile "junit:junit:$junit_ver"
5960
testCompile "org.mockito:mockito-core:$mockito_ver"

0 commit comments

Comments
 (0)