Android Build error: NoClassDefFoundError: org/objectweb/asm/ClassVisitor

79 views
Skip to first unread message

Carlos Knippschild

unread,
Aug 16, 2017, 10:36:00 PM8/16/17
to Chromium-dev
I updated and tried building Chrome for android and am getting many instances of this error, for different JAR files:

FAILED: obj/third_party/ub-uiautomator/ub_uiautomator_java__process_jar-asserted.jar 
python bin/helper/java_assertion_enabler ../../third_party/ub-uiautomator/lib/ub-uiautomator.jar obj/third_party/ub-uiautomator/ub_uiautomator_java__process_jar-asserted.jar
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2703)
        at java.lang.Class.privateGetMethodRecursive(Class.java:3050)
        at java.lang.Class.getMethod0(Class.java:3020)
        at java.lang.Class.getMethod(Class.java:1786)
        at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:540)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:522)
Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.ClassVisitor
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:332)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 7 more

This seems related to AssertionEnabler.java as it is the only class that depends on ClassVisitor. Any idea on how to fix this?

Andrew Grieve

unread,
Aug 17, 2017, 9:34:11 AM8/17/17
to car...@chromium.org, Chromium-dev
Looks like this was caused https://chromium-review.googlesource.com/c/544524, which I think is now reverted. It's made some of your gclient runhooks-downloaded jar files broken symlinks.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAAME5gAw%3DQ2hVBC9HDh5O08iVDQMd1v85uZ3xQsCFwEuZthpJg%40mail.gmail.com.

vita...@google.com

unread,
Aug 17, 2017, 11:01:02 AM8/17/17
to Chromium-dev, car...@chromium.org
For me just "gclient sync" did not help.

Fortunately, the following worked:
1) Delete .cipd folder in src/ (it was untracked for me)
2) gclient sync (it takes longer than usual)
3) Delete the folder where you compile to and recreate it again with gn.

The last step may be not necessary.

Felix

unread,
Aug 17, 2017, 1:04:26 PM8/17/17
to agr...@chromium.org, car...@chromium.org, Chromium-dev
Proposed solution: gclient sync before  a4e8c9b8 (the culprit) or after 0a47fd18 (the revert), and run
find . -type l -ilname '*/.cipd/*' -delete ; gclient sync

Credits to tobiasjs@

Carlos Knippschild

unread,
Aug 17, 2017, 10:12:14 PM8/17/17
to Felix, agr...@chromium.org, car...@chromium.org, Chromium-dev
I deleted the .cipd/ folder, updated (git + gclient sync), started having errors with gn related to a safe browsing BUILD.gn file, waited some more hours... Updated again, then the Android build worked, finally!
All is well when it ends well, I guess. ;)
Reply all
Reply to author
Forward
0 new messages