Issue
I am attempting to debug an Android application with a fresh install of Android Studio 2.3 and the SDK on a new computer with fresh install of Windows 10, I receive a number of ClassNotFoundException
s for android.widget.ViewStub
upon starting the application. The application loads fine if I just continue through them all.
I am also able to launch the application without debugging and then attach to it without any issue.
The exception
java.lang.ClassNotFoundException: Didn't find class "android.widget.ViewStub" on path:
DexPathList[[zip file "/data/app/com.my.applicaton-2/base.apk"],
nativeLibraryDirectories=[/data/app/com.my.application-2/lib/x86, /system/lib, /vendor/lib]]
I've cleared all settings in Android Studio and also deleted all AVDs and started fresh. I've tried disabling Instant-Run, cleaned and rebuilt the project.
I've tried this using both the API 25 x86 and API 24 x86 images with the same result.
I've seen this posted about an old version of Android Studio from 2015, with no solution at Android Studio 1.2.2 ClassNotFoundException android.widget.viewstub
Worth noting is that this application ran fine on my previous computer under Android Studio 2.3, with no changes done since.
Does anyone know how to resolve this?
Solution
I finally figured out the issue, and this was due to me having a typo in the package name inside of one of the gradle.build
files. As I looked through the debugging output, I found 1 line that was missing an e
in the package name.
This was not caught by the compiler nor by Android Studio.
Also Android Studio does not seem to search all files even if you do Edit > Find in Path...
and choose Whole project
.
I ended up using Notepad++ to search my source code directory and found the typo.
Answered By - Kirk
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.