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

ProGuard R8 warning for Android #194

Open
diegocarloslima opened this issue Apr 24, 2024 · 0 comments
Open

ProGuard R8 warning for Android #194

diegocarloslima opened this issue Apr 24, 2024 · 0 comments

Comments

@diegocarloslima
Copy link

Expected Behavior

The build should have performed without any ProGuard related warnings.

Current Behavior

I'm getting the following warning message from R8:

Missing method java.util.Set org.json.JSONObject.keySet() (referenced from: void com.amplitude.core.utilities.TooManyRequestsResponse.<init>(org.json.JSONObject))

I believe that this issue might even result in a runtime crash, depending on which response we get from the server.

Possible Solution

The problem seems to lie in the Android framework JSONObject class, which doesn't contain the method keySet(). Probably there's a version difference between the framework and the one used by Amplitude project.

One possible solution would be to replace .keySet() calls in Response.kt by .keys().asSequence().toSet()

Environment

  • Amplitude analytics-android version: 1.16.7
  • Android minSDK: 26
  • Android targetSDK: 34
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

No branches or pull requests

1 participant