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 Android build with OpenJDK 11 #2681

Merged
merged 1 commit into from
Sep 17, 2020

Conversation

mspang
Copy link
Contributor

@mspang mspang commented Sep 16, 2020

We need to target Java 8, not 11, so pass the argument explicitly. This
avoids dex errors when launching the application on the phone:

Suppressed: java.io.IOException: Failed to open dex files from /data/app/~~f8ynkbFXC9Wk5KqkL_6evA==/com.google.chip.chiptool-zDQFz6dhQ1G1vVGvQcGP0w==/base.apk because: Failure to verify dex file '/data/app/~~f8ynkbFXC9Wk5KqkL_6evA==/com.google.chip.chiptool-zDQFz6dhQ1G1vVGvQcGP0w==/base.apk': Method 25081(Lchip/devicecontroller/AndroidChipStack;.-$$Nest$mhandleConnectionError) has code, but is marked native or abstract

Problem

Android app doesn't load with JARs built with GN & OpenJDK 11.

Summary of Changes

Fix the javac options to target Java 8.

We need to target Java 8, not 11, so pass the argument explicitly. This
avoids dex errors when launching the application on the phone:

Suppressed: java.io.IOException: Failed to open dex files from /data/app/~~f8ynkbFXC9Wk5KqkL_6evA==/com.google.chip.chiptool-zDQFz6dhQ1G1vVGvQcGP0w==/base.apk because: Failure to verify dex file '/data/app/~~f8ynkbFXC9Wk5KqkL_6evA==/com.google.chip.chiptool-zDQFz6dhQ1G1vVGvQcGP0w==/base.apk': Method 25081(Lchip/devicecontroller/AndroidChipStack;.-$$Nest$mhandleConnectionError) has code, but is marked native or abstract
@mspang
Copy link
Contributor Author

mspang commented Sep 16, 2020

@vidhis88

@mspang mspang requested a review from vidhis88 September 16, 2020 02:25
@pullapprove pullapprove bot requested a review from andy31415 September 16, 2020 02:35
Copy link
Contributor

@vidhis88 vidhis88 left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks!

@andy31415
Copy link
Contributor

@woody-apple ?

@woody-apple woody-apple self-requested a review September 17, 2020 18:42
@woody-apple woody-apple merged commit ec9744d into project-chip:master Sep 17, 2020
@mspang mspang deleted the for-chip/android-target branch September 23, 2020 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants