-
Notifications
You must be signed in to change notification settings - Fork 235
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
Android build failed with device client v1.13.2 #313
Comments
Seems like the recent upgrade of log4j dependency v1.2.17 to 2.11.0 has broken Android build. |
I'm no Android expert, but did you try to do the build with the guidance in the error message:
as mentioned at https://developer.android.com/r/tools/annotation-processor-error-message.html |
I've tried to build it with Android Studio and using explicit annotation processor for log4j-core 2.11.0 now, but it fails with other errors, too. For log4j-api it reports
|
After some more tests with AndroidStudio I can share the following insights:
The modules build.gradle file for a successfull build with 1.13.1:
I'll try to find a working setup for 1.13.2 and 1.13.3, too, and will test with the new logging facade setup using slf4j as well. |
Some more insights on usage of log4j2 with AndroidStudio. When using a version of 1.13.2 of the Device Client SDK with AndroidStudio 3.x you will get the following Java compile error: Unfortunately this is a known Android Studio 3.x bug described here . Android Studio has no Java 9 support yet, but parses Java 9 classes that are included in log4j2 jar files (in the META-INF directory). There's no known workaround available for this (at least I could not find one) and wasn't fixed by the Devs of Android studio since end of last year. |
As described in #319, next version of the Azure IoT Device SDK 1.13.4 will be usable with Android Studio 3.x w/o problems again, at least if your minimum SDK version is not smaller than 21. |
@JMayrbaeurl Thanks。By the way,Multi Dex has compatibility package which can support api 19.
|
Thanks @JMayrbaeurl for the PR that fixes it in SDK v1.14.0. |
@JMayrbaeurl, @YMZ1994420, thank you for your contribution to our open-sourced project! Please help us improve by filling out this 2-minute customer satisfaction survey |
I can't use the new version 1.13.2 in android. (android API level : 19)。Only dependency this SDK。
At first,errMsg was
:app:transformClassesWithDexBuilderForDebug FAILED
FAILURE: Build failed with an exception.
Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 5s
Why log4j-api-2.11.0.jar process fail in android?
The text was updated successfully, but these errors were encountered: