2

Trying to build and run an app in Android Studio 2.2.2 that does work in Eclipse. When I try to debug it (on a Samsung Galaxy tab 4) I get: (BTW is there any way to get this to come out more readably in StackOverflow?)

I/System.out: waiting for debugger to settle... I/System.out: debugger has settled (1484) I/InstantRun: Instant Run Runtime started. Android package is com.xxxxxxx.remote, real application class is null. W/InstantRun: No instant run dex files added to classpath D/AndroidRuntime: Shutting down VM E/AndroidRuntime: FATAL EXCEPTION: main Process: com.xxxxxxx.remote, PID: 1925 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.xxxxxxx.remote/com.xxxxxxx.remote.RemoteControlActivity}: java.lang.ClassNotFoundException: Didn't find class "com.xxxxxxx.remote.RemoteControlActivity" on path: DexPathList[[zip file "/data/app/com.xxxxxxx.remote-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2644) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2867) at android.app.ActivityThread.access$900(ActivityThread.java:181) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1476) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:6134) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194) Caused by: java.lang.ClassNotFoundException: Didn't find class "com.xxxxxxx.remote.RemoteControlActivity" on path: DexPathList[[zip file "/data/app/com.xxxxxxx.remote-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:511) at java.lang.ClassLoader.loadClass(ClassLoader.java:469) at android.app.Instrumentation.newActivity(Instrumentation.java:1079) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2634) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2867)

...etc... I've "xxxxx"'ed out a proprietary name. What do real application class is null and No instant run dex files added to classpath mean? Also I see the reference to "Unable to instantiate activity ComponentInfo" in a lot of similar questions - what does it mean?

The activity it can't find is declared in the manifest as...

     <activity android:launchMode="singleTask"   
          android:label="@string/app_name"
          android:windowNoTitle="false"
          android:configChanges="orientation"
          android:screenOrientation="landscape"
          android:name=".RemoteControlActivity">
          <intent-filter>
             <action android:name="android.intent.action.MAIN" />
             <category android:name="android.intent.category.LAUNCHER" />
          </intent-filter>
        </activity>

I can't even hit a breakpoint at the beginning of the Activity, so how do I debug this?

user316117
  • 7,971
  • 20
  • 83
  • 158
  • 1
    You can disable InstantRun and see if the problem persists. – Doron Yakovlev Golani Nov 29 '16 at 21:40
  • One check that I have found useful is CTRL+clicking on the activityname (.RemoteControlActivity in this case). If the IDE doesn't automatically open the class, then there is a problem with name resolution. – Hahn Nov 29 '16 at 22:02
  • @Doron Yakovlev-Golani Disabling Instant Run fixed it - I can nowbreakpoint at _OnCreate()_. Based on your comment I read the documentation on Instant Run and I STILL don't understand what it does, but apparently it was enabled. If you'd like to post this as an Answer I can give you a rep point and mark the question "answered". – user316117 Nov 29 '16 at 22:55
  • Does this answer your question? [Didn't find class on path: DexPathList?](https://stackoverflow.com/questions/43435658/didnt-find-class-on-path-dexpathlist) – Ngima Sherpa Dec 13 '19 at 14:06

1 Answers1

0

You can disable InstantRun and see if the problem persists.

Doron Yakovlev Golani
  • 5,188
  • 9
  • 36
  • 60