0

I am a new AOSP developer. I modified some files in AOSP and ran with target sdk_car_x86_64-userdebug, and then I made the framework using below command:

m framework -j32
m framework-minus-apex -j32

After the build was successful, I got the javalib.jar from path

~/path_to/aosp/out/target/product/emulator_car64_x86_64/obj/JAVA_LIBRARIES/framework-sdkextensions.com.android.sdkext_intermediates.

I created a simple Android application then put javalib.jar into app/libs then added the below line into the app/build.gradle

dependencies {
implementation(files("libs/javalib.jar"))
...
}

I run the emulator built from AOSP by command

source build/evnsetup.sh
lunch sdk_car_x86_64-userdebug
emulator

After the emulator started up successfully, I ran the application in it then I encountered an error

    FATAL EXCEPTION: pool-2-thread-1
Process: com.example.myapp, PID: 2889
java.lang.IncompatibleClassChangeError: Class 'android.app.PendingIntent$$ExternalSyntheticLambda0' does not implement interface 'java.util.concurrent.Executor' in call to 'void java.util.concurrent.Executor.execute(java.lang.Runnable)' (declaration of 'androidx.profileinstaller.DeviceProfileWriter' appears in /data/app/~~ZGDppP5xMSrCMkinJtMDMQ==/com.example.myapp-asn8RdWTnUGeZXOezq_-iA==/base.apk!classes14.dex)
    at androidx.profileinstaller.DeviceProfileWriter.result(DeviceProfileWriter.java:87)
    at androidx.profileinstaller.DeviceProfileWriter.deviceAllowsProfileInstallerAotWrites(DeviceProfileWriter.java:140)
    at androidx.profileinstaller.ProfileInstaller.transcodeAndWrite(ProfileInstaller.java:440)
    at androidx.profileinstaller.ProfileInstaller.writeProfile(ProfileInstaller.java:575)
    at androidx.profileinstaller.ProfileInstaller.writeProfile(ProfileInstaller.java:515)
    at androidx.profileinstaller.ProfileInstaller.writeProfile(ProfileInstaller.java:479)
    at androidx.profileinstaller.ProfileInstallerInitializer.lambda$writeInBackground$2(ProfileInstallerInitializer.java:145)
    at androidx.profileinstaller.ProfileInstallerInitializer$$ExternalSyntheticLambda2.run(D8$$SyntheticClass:0)

I created another simple application then imported javalib.jar, I encountered another error

FATAL EXCEPTION: pool-2-thread-1
Process: com.example.dummyproject, PID: 3761
java.lang.NoSuchMethodError: No direct method <init>()V in class Landroid/app/PendingIntent$$ExternalSyntheticLambda0; or its super classes (declaration of 'android.app.PendingIntent$$ExternalSyntheticLambda0' appears in /system/framework/framework.jar)
    at androidx.profileinstaller.ProfileInstaller.writeProfile(ProfileInstaller.java:479)
    at androidx.profileinstaller.ProfileInstallerInitializer.lambda$writeInBackground$2(ProfileInstallerInitializer.java:145)
    at androidx.profileinstaller.ProfileInstallerInitializer$$ExternalSyntheticLambda2.run(D8$$SyntheticClass:0)

How can I resolve this issue?

1
  • I believe that the jar you are using is incorrect, the framework-minus-apex target will create a framework.jar in /system, and that is to be used. Commented Jul 9 at 7:55

0

Browse other questions tagged or ask your own question.