question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fatal Exception: java.lang.NoClassDefFoundError: android/graphics/Outline

See original GitHub issue

Info:

  • ReactNative: 0.30
  • Platform: Android
  • Device: Nexus 5
  • Android OS: 4.4.2
  • Rooted: true

Problem:

The problem, as I see it, is that android.graphics.Outline was introduced in Lollipop 5.0 and it is used in ReactViewBackgroundDrawable.java as an import and as a method parameter. So OSs less than this will crash when this is hit.

StackTrace:

Fatal Exception: java.lang.NoClassDefFoundError: android/graphics/Outline
       at java.lang.Class.getDeclaredMethods(Class.java)
       at java.lang.Class.getDeclaredMethods(Class.java:656)
       at android.view.ViewDebug.getExportedPropertyMethods(ViewDebug.java:960)
       at android.view.ViewDebug.exportMethods(ViewDebug.java:1047)
       at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:997)
       at android.view.ViewDebug.exportFields(ViewDebug.java:1175)
       at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:996)
       at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:983)
       at android.view.ViewDebug.dumpView(ViewDebug.java:900)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:855)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dump(ViewDebug.java:793)
       at android.view.ViewDebug.dispatchCommand(ViewDebug.java:416)
       at android.view.ViewRootImpl$W.executeCommand(ViewRootImpl.java:6258)
       at android.view.IWindow$Stub.onTransact(IWindow.java:65)
       at android.os.Binder.execTransact(Binder.java:404)
       at dalvik.system.NativeStart.run(NativeStart.java)
Caused by java.lang.ClassNotFoundException: Didn't find class "android.graphics.Outline" on path: DexPathList[[zip file "/data/app/com.curse.highwind-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.curse.highwind-1, /vendor/lib, /system/lib]]
       at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
       at java.lang.Class.getDeclaredMethods(Class.java)
       at java.lang.Class.getDeclaredMethods(Class.java:656)
       at android.view.ViewDebug.getExportedPropertyMethods(ViewDebug.java:960)
       at android.view.ViewDebug.exportMethods(ViewDebug.java:1047)
       at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:997)
       at android.view.ViewDebug.exportFields(ViewDebug.java:1175)
       at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:996)
       at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:983)
       at android.view.ViewDebug.dumpView(ViewDebug.java:900)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:855)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dump(ViewDebug.java:793)
       at android.view.ViewDebug.dispatchCommand(ViewDebug.java:416)
       at android.view.ViewRootImpl$W.executeCommand(ViewRootImpl.java:6258)
       at android.view.IWindow$Stub.onTransact(IWindow.java:65)
       at android.os.Binder.execTransact(Binder.java:404)
       at dalvik.system.NativeStart.run(NativeStart.java)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

7reactions
oneycommented, Aug 15, 2016

If you set multiDexEnabled true in android/app/build.gradle, modify MainApplication.java by the following

import android.support.multidex.MultiDexApplication;
public class MainApplication extends MultiDexApplication implements ReactApplication
3reactions
mikelambertcommented, Oct 10, 2016

So it seems everyone sees this on a rooted Nexus 5 4.4.2 (API level 19), one that has ViewDebug enabled. That seems like quite the awful coincidence, but whomever that rogue user is using all our different apps, I’m not too worried about them anymore. 😃

My guess is that there is some automated system out there running all Android apps in their rooted debug environment, unintentionally breaking when attempting to run our React Native apps. Perhaps it’s used for rendering screenshots, for interacting with apps-in-the-cloud, or maybe a grad student research project, or who knows what else.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java.lang.NoClassDefFoundError: android/graphics/drawable ...
Samsung devices with Android 4.4 crash like this when classes extending View define methods which return or take parameters of types that ...
Read more >
NoClassDefFoundError - Android Developers
java.util.concurrent.atomic. Overview. Classes ... NoClassDefFoundError; NoClassDefFoundError. Android Developers ... public class NoClassDefFoundError
Read more >
java.lang.NoClassDefFoundError - DigitalOcean
java.lang.NoClassDefFoundError is runtime error thrown when a required class is not found in the classpath and hence JVM is unable to load ...
Read more >
3 ways to solve java.lang.NoClassDefFoundError in Java J2EE
NoClassDefFoundError in Java comes when Java Virtual Machine is not able to find a particular class at runtime which was available at compile...
Read more >
Android fatal exception java. lang. noclassdeffounderror - Weebly
does not work with fatal exception: java.lang.NoClassDefFoundError ... NoClassDefFoundError: android/graphics/Outline at java.lang.Class.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found