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

(fix): this fixes proguard rules when running minifyEnabled #266

Merged
merged 6 commits into from
Apr 23, 2019

Conversation

thomaszurkan-optimizely
Copy link
Contributor

Summary

I was able to reproduce this problem turning on minify on a kotlin project. The following rules and compile cleanups, enabled the apk to be created, installed, and ran, without issue.

Test plan

Created test apps to reproduce the issue.

Issues

Copy link
Contributor

@mnoman09 mnoman09 left a comment

Choose a reason for hiding this comment

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

Issue is still there I tested these changes with my android java project and I am still getting that error.

@thomaszurkan-optimizely
Copy link
Contributor Author

thomaszurkan-optimizely commented Apr 19, 2019

@mnoman09 can you share your project with me? How did you install the aar s?
What was the error?

@thomaszurkan-optimizely
Copy link
Contributor Author

@mnoman09 after looking at your project and changing it to use my branch instead of master for the fix, it worked.

@mnoman09
Copy link
Contributor

yes I tested it with my project and It's working so lgtm.

@mnoman09 mnoman09 closed this Apr 23, 2019
@mnoman09 mnoman09 reopened this Apr 23, 2019
// only cancel periodic services
if (ServiceScheduler.isScheduled(context, id)) {
jobScheduler.cancel(id);
}
pendingIntent.cancel();
Copy link
Contributor

Choose a reason for hiding this comment

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

What does moving this here do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is just consistent with what is below it. We first cancel the alarm and then the pendingIntent. Here we cancel the job and then the pending intent. Basically, it is so if the pendingIntent throws, we have still cancelled the scheduled job.

@@ -66,8 +66,7 @@ dependencies {
exclude group: 'com.google.code.findbugs'
}

compileOnly group: 'org.slf4j', name: 'slf4j-android', version: '1.7.25'
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need this anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have a compile only for noveo android logger. We don't need both.

@@ -66,8 +66,7 @@ dependencies {
exclude group: 'com.google.code.findbugs'
}

compileOnly group: 'org.slf4j', name: 'slf4j-android', version: '1.7.25'

compileOnly "com.fasterxml.jackson.core:jackson-databind:$jacksonversion"
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this mean we explicitly bundle jackson with our SDK? Would the user be able to exclude it from their app?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is compile only. So, it is not a explicit dependency. If you are not using jackson, then, there is no effect. If you are using jackson, you would add this as a implementation in your gradle. Essentially, this is so our jackson code compiles. We still default to gson.

Copy link
Contributor

@mikeproeng37 mikeproeng37 left a comment

Choose a reason for hiding this comment

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

lgtm

@thomaszurkan-optimizely thomaszurkan-optimizely merged commit f34202a into master Apr 23, 2019
thomaszurkan-optimizely added a commit that referenced this pull request Apr 23, 2019
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants