Skip to content

Commit

Permalink
Fix Android build with OpenJDK 11 (#2681)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mspang authored Sep 17, 2020
1 parent 66dfe0a commit ec9744d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gn/chip/java/rules.gni
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ template("android_library") {
javac_flags += [
"-classpath",
"${android_sdk_root}/platforms/android-${android_sdk_version}/android.jar",
"-Xlint:-options",
"-source",
"8",
"-target",
"8",
]
}
}

0 comments on commit ec9744d

Please sign in to comment.