Unable to instantiate activity Component Info Class Not found exception Android
As Discussion in chat i found that, Your manual way of generating APK
is not generating the correct APK, so i am Suggesting these way to
generating APK for Manual Install:
For Debug Build
- Delete you build folder inside the App folder.
- Goto
Build>Build APk
. it will generate .apk file in yourapp>build>output>apk
directory. - COPY it your device and install manually.
For Release Build
- Delete you build folder inside the App folder.
- Goto
Build>Generate Signed APk
and provide recomended Details, make sure yourBuild type : release
and have checked both signature versionv1(jar signature)
andv2(full apk signature)
. it will generate .apk file in yourapp>build>output>apk
directory. - COPY it your device and install manually.
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo
It is a problem of your Intent.
Please add your Activity
in your AndroidManifest.xml
.
When you want to make a new activity, you should register it in your AndroidManifest.xml
.
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo/ ClassNotFoundException
When upgrading, the 'Order and Export' of the new 'Android Private Libraries' is not always checked. And the android-support-v4.jar is now in this 'Android Private Libraries' section.
To fix this, go to 'Order and Export' and check 'Android Private Libraries'. Then refresh/clean/rebuild.
After you done this 'fix' for a library project, you may need to just close and re-open any depending project, because they may not see this 'fix' immediately.
Android - Unable to instantiate activity
The problem fixed itself after some updates to android studio!
Beginner Android java.lang.RuntimeException: Unable to instantiate activity
What is your logcat throws
Caused by: java.lang.ClassNotFoundException: Didn't find class
"com.example.imran.justjava.MainActivity"
ClassNotFoundException : ClassNotFoundException occurs when class loader could not find the required class in class path . So , basically you should check your class path and add the class in the classpath.
I guess your activity in manifest is not correct.
Post your manifest.xml .
Have a look here
https://developer.android.com/intl/es/samples/BasicContactables/AndroidManifest.html
Example
<activity
android:name=".MainActivity"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo for Kotlin MainActivity
Try to apply kotlin in build.gradle file at starting
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 28
Android - Unable to instantiate activity - Class not found exception after upgrading to ADT 22
Might be a duplicate of this.
Try going to Project -> Properties -> Java Build Path -> Order & Export and ensure
Android Private Libraries are checked for your project and for all other library projects you are using. Clean all projects
afterwards and see what happens.
Related Topics
Android Update Textview in Thread and Runnable
What Causes Android's Contentresolver.Query() to Return Null
How to Fix: "You Need to Use a Theme.Appcompat Theme (Or Descendant) with This Activity"
How to Implement a Setonitemclicklistener Firebaserecyclerviewadapter
Android Adb Stop Application Command Like "Force-Stop" for Non Rooted Device
Android Studio 3.0 Execution Failed for Task: Unable to Merge Dex
Listen Outgoing Sms or Sent Box in Android
Android Webview Loading Data Performance Very Slow
Android Listview with Onclick Items
Does Android Support Jdk 6 or 7
Android Resources$Notfoundexception: Resource Id #0X7F030027
Return Value from Asynctask Class Onpostexecute Method
Overriding Referenced Style Attributes
Android Camera Intent Saving Image Landscape When Taken Portrait
How to Use a Tablayout with Toolbar Inside Collapsingtoolbarlayout