Unable to resolve superclass of Activity

Unable to resolve superclass

When you added Android Support library to your project in Eclipse ADT, to implement classes like FragmentActivity, ViewPager etc At times you may see this error which results in app crash due to Unable to resolve superclass,

Unable to resolve superclass of Lin/AppPath/MainActivity; (9)
05-16 14:10:11.705: W/dalvikvm(6534): Link of class 'Lin/AppPath/MainActivity;' failed
05-16 14:10:11.705: D/AndroidRuntime(6534): Shutting down VM
05-16 14:10:11.705: W/dalvikvm(6534): threadid=1: thread exiting with uncaught exception (group=0x41ba5c08)
05-16 14:10:11.705: E/AndroidRuntime(6534): FATAL EXCEPTION: main
05-16 14:10:11.705: E/AndroidRuntime(6534): Process: , PID: 6534
05-16 14:10:11.705: E/AndroidRuntime(6534): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{/.MainActivity}: java.lang.ClassNotFoundException: Didn't find class ".MainActivity" on path: DexPathList[[zip file
......
....

There may be a chance that Android Private Library, not exported while generating API file. Due to Android Private Libraries is unchecked in Order and Export tab in Java build path dialog as shown below. resolve superclass So, just check the Android Private Libraries and Click Ok. Clean and Build the app. Fixes the issue.

private_Library1

Hope it helps somebody. 🙂

You may be also interested in

Could not resolve com.android.support:support-v4:22.0.0, Android Studio

While implementing Push Notifications, I get this error Could not resolve all dependencies for configuration

I’ve installed Google Play Services and Google Repository using SDK manager

not resolve

and added the following dependencies in gradle file

dependencies {
   compile 'com.google.android.gms:play-services-gcm:7.0.0'
   ....
}

When I run the app, I see following error,

Could not resolve all dependencies for configuration ':library:_debugCompile'.
> Could not resolve com.android.support:support-v4:22.0.0.
Required by:
:library:unspecified > com.google.android.gms:play-services:7.0.0 > com.google.android.gms:play-services-base:7.0.0
> No cached version of com.android.support:support-v4:22.0.0 available for offline mode.

After searching solution for a while, I found the issue is due to this  “You need to make sure you have Android Support Repository up to date – that is where Android Support Library dependencies are resolved.”

So, I installed Android Support Repository,

fix_issue
and Rebuild app… Fixed the issue.

Hope it helps somebody..

ref link: http://stackoverflow.com/a/29569756/341443