profusion / android-sdk-addon-example

Apache License 2.0
24 stars 6 forks source link

build fail by aosp 11 about "Exception in thread "main" java.lang.IllegalArgumentException" #1

Closed yishinhung closed 2 years ago

yishinhung commented 2 years ago

Hi: I build the android-sdk-addon-example by aosp 11 but encounter the following build fail about "Exception in thread "main" java.lang.IllegalArgumentException". Did you have any idea or suggestion for me. Thank a lot!

- Build command:
  --> source build/envsetup.sh
  --> aosp_x86_64-eng
  --> m sdk_addon

- Fail logs:
build/make/core/main.mk:1311: warning: : Module 'adb_keys' in PRODUCT_PACKAGES_DEBUG has nothing to install!
Stubbing addon jar using build/make/target/product/profusion_sdk_addon/sdk_addon_stub_defs.txt
[  9% 220/2297] build out/target/common/obj/JAVA_LIBRARIES/helloworld_intermediates/stubs_stub-addon.jar
FAILED: out/target/common/obj/JAVA_LIBRARIES/helloworld_intermediates/stubs_stub-addon.jar
/bin/bash -c "prebuilts/jdk/jdk11/linux-x86/bin/java -XX:OnError=\"cat hs_err_pid%p.log\" -XX:CICompilerCount=6 -XX:+UseDynamicNumberOfGCThreads -jar out/host/linux-x86/framework/mkstubs.jar   \"out/target/common/obj/JAVA_LIBRARIES/helloworld_intermediates/stubs.jar\" \"out/target/common/obj/JAVA_LIBRARIES/helloworld_intermediates/stubs_stub-addon.jar\" @build/make/target/product/profusion_sdk_addon/sdk_addon_stub_defs.txt"
Exception in thread "main" java.lang.IllegalArgumentException
        at org.objectweb.asm.ClassReader.<init>(Unknown Source)
        at org.objectweb.asm.ClassReader.<init>(Unknown Source)
        at org.objectweb.asm.ClassReader.<init>(Unknown Source)
        at com.android.mkstubs.AsmAnalyzer.parseInputJar(AsmAnalyzer.java:53)
        at com.android.mkstubs.Main.process(Main.java:291)
        at com.android.mkstubs.Main.main(Main.java:126)
06:11:51 ninja failed with: exit status 1
barbieri commented 2 years ago

Hi @yishinhung! This needs updating to work on newer AOSP. We'll try to update the code and the post to make it work, but we can't guarantee when that will happen.

We'll comment on this issue when it's done.

yishinhung commented 2 years ago

Hi @barbieri: I use the newest AOSP version but still encounter the follow error. Could you give some suggestions for me? Thank a lot!

failed to build some targets (04:27 (mm:ss))

oliveirarleo commented 2 years ago

What we meant was that our tool needs updating to work on newer AOSP, last time we used we did it with Android 9. Someone on our team will take the time to investigate the issues with the newer versions, and we will notify you when it's solved.

If you have some progress, please comment here, so we can be aware of it.

yishinhung commented 2 years ago

Hi @oliveirarleo : I use the android-9.0.0_r61 to add the related patches in android-sdk-addon-example. But, i can't find the mainline_system.mk at build/make/target/product path. Maybe the related codes wasn't based on Android 9? Could you help to confirm which android version can build the android-sdk-addon-example and then i can test it. Thank a lot!

g7fernandes commented 2 years ago

@yishinhung the code is based on Android 10 (API level 29) as the manifest.ini says. I will try to revisit this code today to better see what must be updated.

yishinhung commented 2 years ago

Hi @g7fernandes If i want to build the sample based on Android 11 (API level 30), do you have any suggestions about the top fail logs? Thank a lot!

g7fernandes commented 2 years ago

@yishinhung The PR 2 was integrated and should solve the problem with Android 11. I did updates to the README also with more detailed instructions.

Thanks!

Closing.