Android 10 build wmtest with extra jar error

51 views
Skip to first unread message

bersaty wu

unread,
Mar 19, 2020, 12:07:39 PM3/19/20
to Android Building
I want to add my own jar to the wmtest apk, so I modify the .bp file like this:

static_libs: [
    "frameworks-base-testutils",
    "services.core",
    "androidx.test.runner",
    "androidx.test.rules",
    "mockito-target-extended-minus-junit4",
    "platform-test-annotations",
    "servicestests-utils",
    "truth-prebuilt",
    "testables",
    "ub-uiautomator",
    "hamcrest-library",
    "my-services", //add for debug
],


//add for debug
java_import {
name: "my-services",
jars: ["libs/my-services.jar"],
}



I got this error when I build:


Error: Cannot create android app from an archive 'out/soong/.intermediates/frameworks/base/services/tests/wmtests/WmTests/android_common/combined/WmTests.jar' containing both DEX and Java-bytecode content
Compilation failed
15:55:32 ninja failed with: exit status 1


Is there any solution?


Dan Willemsen

unread,
Mar 19, 2020, 1:54:15 PM3/19/20
to Android Building
Does my-services.jar contain .class files, or .dex files? java_import&static_libs is expecting .class files.

- Dan

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/ba80d301-a617-41e6-b0c3-ec7c67fecbf7%40googlegroups.com.

bersaty wu

unread,
Mar 23, 2020, 10:39:58 AM3/23/20
to Android Building
Thanks for  your reply,Dan
my-services.jar contains .dex files,Is there any way to include .dex files?

在 2020年3月20日星期五 UTC+8上午1:54:15,Dan Willemsen写道:

For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages