Skip to content

Commit f34202a

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 c4bb4f9 commit f34202a

File tree

8 files changed

+13
-9
lines changed

8 files changed

+13
-9
lines changed

android-sdk/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ dependencies {
6666
exclude group: 'com.google.code.findbugs'
6767
}
6868

69-
compileOnly group: 'org.slf4j', name: 'slf4j-android', version: '1.7.25'
70-
69+
compileOnly "com.fasterxml.jackson.core:jackson-databind:$jacksonversion"
7170
implementation "com.android.support:support-annotations:$support_annotations_ver"
7271

7372
testImplementation "junit:junit:$junit_ver"

build.gradle

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ dependencies {
5555
api project(':shared')
5656
implementation "com.android.support:support-annotations:$support_annotations_ver"
5757

58-
compileOnly group: 'org.slf4j', name: 'slf4j-android', version: '1.7.25'
58+
compileOnly "com.noveogroup.android:android-logger:$android_logger_ver"
5959

6060
testImplementation "junit:junit:$junit_ver"
6161
testImplementation "org.mockito:mockito-core:$mockito_ver"

event-handler/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ dependencies {
5656
api project(':shared')
5757
implementation "com.android.support:support-annotations:$support_annotations_ver"
5858

59-
compileOnly group: 'org.slf4j', name: 'slf4j-android', version: '1.7.25'
59+
compileOnly "com.noveogroup.android:android-logger:$android_logger_ver"
6060

6161
testImplementation "junit:junit:$junit_ver"
6262
testImplementation "org.mockito:mockito-core:$mockito_ver"

proguard-rules.txt

Lines changed: 6 additions & 0 deletions
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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,12 @@ android {
5353
}
5454

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

62-
compileOnly group: 'org.slf4j', name: 'slf4j-android', version: '1.7.25'
63-
61+
compileOnly "com.noveogroup.android:android-logger:$android_logger_ver"
6462
compileOnly "com.android.support:support-annotations:$support_annotations_ver"
6563

6664
testImplementation "junit:junit:$junit_ver"

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ dependencies {
5555
api project(':shared')
5656

5757
compileOnly "com.android.support:support-annotations:$support_annotations_ver"
58-
compileOnly group: 'org.slf4j', name: 'slf4j-android', version: '1.7.25'
58+
compileOnly "com.noveogroup.android:android-logger:$android_logger_ver"
5959

6060
testImplementation "junit:junit:$junit_ver"
6161
testImplementation "org.mockito:mockito-core:$mockito_ver"

0 commit comments

Comments
 (0)