Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
I've tried to fix this issue for long time but still being stuck.
I already declared my Activity in AndroidManifest.xml file but ActivityNotFoundException still occurs, Please help!
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sel.appsinfo" >
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/MyAppTheme" >
<activity
android:name="com.sel.appsinfo.AppsInfoMainActivity"
android:uiOptions="splitActionBarWhenNarrow" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity></application>
Logcat:
08-05 23:37:17.566: W/dalvikvm(26899): Unable to resolve superclass of Lcom/sel/appsinfo/BaseActivity; (85)
08-05 23:37:17.567: W/dalvikvm(26899): Link of class 'Lcom/sel/appsinfo/BaseActivity;' failed
08-05 23:37:17.568: W/dalvikvm(26899): Unable to resolve superclass of Lcom/sel/appsinfo/AppsInfoMainActivity; (166)
08-05 23:37:17.568: W/dalvikvm(26899): Link of class 'Lcom/sel/appsinfo/AppsInfoMainActivity;' failed
08-05 23:37:17.571: D/AndroidRuntime(26899): Shutting down VM
08-05 23:37:17.571: W/dalvikvm(26899): threadid=1: thread exiting with uncaught exception (group=0x40c97258)
08-05 23:37:17.574: E/AndroidRuntime(26899): FATAL EXCEPTION: main
08-05 23:37:17.574: E/AndroidRuntime(26899): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.sel.appsinfo/com.sel.appsinfo.AppsInfoMainActivity}: java.lang.ClassNotFoundException: com.sel.appsinfo.AppsInfoMainActivity
08-05 23:37:17.574: E/AndroidRuntime(26899): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
08-05 23:37:17.574: E/AndroidRuntime(26899): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2023)
08-05 23:37:17.574: E/AndroidRuntime(26899): at android.app.ActivityThread.access$600(ActivityThread.java:127)
08-05 23:37:17.574: E/AndroidRuntime(26899): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1174)
08-05 23:37:17.574: E/AndroidRuntime(26899): at android.os.Handler.dispatchMessage(Handler.java:99)
08-05 23:37:17.574: E/AndroidRuntime(26899): at android.os.Looper.loop(Looper.java:137)
08-05 23:37:17.574: E/AndroidRuntime(26899): at android.app.ActivityThread.main(ActivityThread.java:4503)
08-05 23:37:17.574: E/AndroidRuntime(26899): at java.lang.reflect.Method.invokeNative(Native Method)
08-05 23:37:17.574: E/AndroidRuntime(26899): at java.lang.reflect.Method.invoke(Method.java:511)
08-05 23:37:17.574: E/AndroidRuntime(26899): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)
08-05 23:37:17.574: E/AndroidRuntime(26899): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)
08-05 23:37:17.574: E/AndroidRuntime(26899): at dalvik.system.NativeStart.main(Native Method)
08-05 23:37:17.574: E/AndroidRuntime(26899): Caused by: java.lang.ClassNotFoundException: com.sel.appsinfo.AppsInfoMainActivity
08-05 23:37:17.574: E/AndroidRuntime(26899): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
08-05 23:37:17.574: E/AndroidRuntime(26899): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
08-05 23:37:17.574: E/AndroidRuntime(26899): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
08-05 23:37:17.574: E/AndroidRuntime(26899): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
08-05 23:37:17.574: E/AndroidRuntime(26899): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1911)
08-05 23:37:17.574: E/AndroidRuntime(26899): ... 11 more
It looks like AppsInfoMainActivity extends BaseActivity but BaseActivity extends something else which is probably not valid. Make sure it is extending Activity or an AppCompat Activity class and that the imports are correct
Make sure your Intent Filter tag in the XML which contains MAIN also contains
<category android:name="android.intent.category.DEFAULT" />
I think there's a problem about your class path. Please check class path and if it's wrong correct it.
If it's extending Activity or an AppCompat Activity class and that the imports are right, maybe 2 versions of android-support-v4.jar in the dependency list,
but not all the versions are identical (check is based on SHA-1 only at this time).
All must be the same.
Hmm Maybe cleaning Project will help.
I solved it, It was because of I had so many libs included unnecessary :|
Related
I recently moved to MoPub and it all appears to be working well except for I have started getting this exception saying that com.millennialmedia.android.VideoPlayer can not be found. I looked and it isn't on the Millennial jar (I just got the latest from their site). Also my AndroidManifest mentions that class and Android Studio also says it can't be found.
This is what I have there:
<activity android:name="com.millennialmedia.android.MMActivity" android:theme="#android:style/Theme.Translucent.NoTitleBar" android:configChanges="keyboardHidden|orientation|keyboard" />
<activity android:name="com.millennialmedia.android.VideoPlayer" android:configChanges="keyboardHidden|orientation|keyboard" />
On Android Studio the VideoPlayer part is red.
This is the exception I got:
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{mypackage/com.millennialmedia.android.VideoPlayer}: java.lang.ClassNotFoundException: Didn't find class "com.millennialmedia.android.VideoPlayer" on path: /data/app/mypackage-1.apk
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.millennialmedia.android.VideoPlayer" on path: /data/app/mypackage-1.apk
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(NativeStart.java)
Looking at the latest Millennial Media documentation, it looks like
com.millennialmedia.android.VideoPlayer
isn't included. This may be an update that needs to be made.
Alice
I am trying to upload a text file to Amazon s3 from my android application. I am using the following code snippet provided by Amazon AWS.
private static CognitoCredentialsProvider sCredProvider;
public static CognitoCredentialsProvider getCredProvider(Context context) {
if(sCredProvider == null) {
Log.i("Util","reached utility");
Log.i("Util","Context"+context);
sCredProvider = new CognitoCredentialsProvider(
context,
Constants.AWS_ACCOUNT_ID,
Constants.COGNITO_POOL_ID,
Constants.COGNITO_ROLE_UNAUTH,
null);
Log.i("Util","returning scredprovider"+sCredProvider);
sCredProvider.refresh();
}
Log.i("Util","returning scredprovider"+sCredProvider);
return sCredProvider;
}
When the code passes through sCredProvider.refresh(); it throws the follow error.
08-05 02:21:24.908: E/AndroidRuntime(25712): FATAL EXCEPTION: main
08-05 02:21:24.908: E/AndroidRuntime(25712): java.lang.RuntimeException: Unable to create service network.NetworkService: android.os.NetworkOnMainThreadException
08-05 02:21:24.908: E/AndroidRuntime(25712): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2667)
08-05 02:21:24.908: E/AndroidRuntime(25712): at android.app.ActivityThread.access$1600(ActivityThread.java:153)
08-05 02:21:24.908: E/AndroidRuntime(25712): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1329)
08-05 02:21:24.908: E/AndroidRuntime(25712): at android.os.Handler.dispatchMessage(Handler.java:99)
08-05 02:21:24.908: E/AndroidRuntime(25712): at android.os.Looper.loop(Looper.java:137)
08-05 02:21:24.908: E/AndroidRuntime(25712): at android.app.ActivityThread.main(ActivityThread.java:5227)
08-05 02:21:24.908: E/AndroidRuntime(25712): at java.lang.reflect.Method.invokeNative(Native Method)
08-05 02:21:24.908: E/AndroidRuntime(25712): at java.lang.reflect.Method.invoke(Method.java:511)
08-05 02:21:24.908: E/AndroidRuntime(25712): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
08-05 02:21:24.908: E/AndroidRuntime(25712): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
08-05 02:21:24.908: E/AndroidRuntime(25712): at dalvik.system.NativeStart.main(Native Method)
08-05 02:21:24.908: E/AndroidRuntime(25712): Caused by: android.os.NetworkOnMainThreadException
08-05 02:21:24.908: E/AndroidRuntime(25712): at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1117)
08-05 02:21:24.908: E/AndroidRuntime(25712): at java.net.InetAddress.lookupHostByName(InetAddress.java:385)
08-05 02:21:24.908: E/AndroidRuntime(25712): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236)
08-05 02:21:24.908: E/AndroidRuntime(25712): at java.net.InetAddress.getAllByName(InetAddress.java:214)
08-05 02:21:24.908: E/AndroidRuntime(25712): at com.amazonaws.org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
08-05 02:21:24.908: E/AndroidRuntime(25712): at com.amazonaws.org.apache.http.impl.conn.DefaultClientConnectionOperator.resolveHostname(DefaultClientConnectionOperator.java:278)
08-05 02:21:24.908: E/AndroidRuntime(25712): at com.amazonaws.org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:162)
08-05 02:21:24.908: E/AndroidRuntime(25712): at com.amazonaws.org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
08-05 02:21:24.908: E/AndroidRuntime(25712): at com.amazonaws.org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:645)
08-05 02:21:24.908: E/AndroidRuntime(25712): at com.amazonaws.org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:480)
08-05 02:21:24.908: E/AndroidRuntime(25712): at com.amazonaws.org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
08-05 02:21:24.908: E/AndroidRuntime(25712): at com.amazonaws.org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
08-05 02:21:24.908: E/AndroidRuntime(25712): at com.amazonaws.http.AmazonHttpClient.executeHelper(Unknown Source)
08-05 02:21:24.908: E/AndroidRuntime(25712): at com.amazonaws.http.AmazonHttpClient.execute(Unknown Source)
08-05 02:21:24.908: E/AndroidRuntime(25712): at com.amazonaws.services.cognitoidentity.AmazonCognitoIdentityServiceClient.invoke(Unknown Source)
08-05 02:21:24.908: E/AndroidRuntime(25712): at com.amazonaws.services.cognitoidentity.AmazonCognitoIdentityServiceClient.getOpenIdToken(Unknown Source)
08-05 02:21:24.908: E/AndroidRuntime(25712): at com.amazonaws.auth.CognitoCredentialsProvider.startSession(Unknown Source)
08-05 02:21:24.908: E/AndroidRuntime(25712): at com.amazonaws.auth.CognitoCredentialsProvider.refresh(Unknown Source)
08-05 02:21:24.908: E/AndroidRuntime(25712): at com.chan.censioevlog.Util.getCredProvider(Util.java:41)
08-05 02:21:24.908: E/AndroidRuntime(25712): at network.NetworkService.onCreate(NetworkService.java:55)
08-05 02:21:24.908: E/AndroidRuntime(25712): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2657)
08-05 02:21:24.908: E/AndroidRuntime(25712): ... 10 more
Commenting out the line run the application fine. But I don't see the file uploaded to Amazon S3. I did setup to Amazon Cognito credential provider.
The source code can be found here.
CognitoCredentialsProvider.refresh() will make a network request to fetch Cognito identity id and session credentials if those aren't cached (handled by the provider itself). Based on the stack trace, you call getCredProvider(Context context) on the main thread. And refresh() is invoked on the main thread. That's why you see NetworkOnMainThreadException. To fix this issue, you can remove sCredProvider.refresh(). If for some reason you want to call refresh(), you need to call it in a background thread. Please refer to AsyncTask.
I am getting the error below when I try to login through facebook plugin for Android.
The app basically crashes "stopped", Any ideas will be appreciated.
ERROR/AndroidRuntime(2008): FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to resume activity {xxx/com.facebook.LoginActivity}: android.content.res.Resources$NotFoundException: String resource ID #0x7f060012
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2742)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2771)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2235)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5039)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x7f060012
at android.content.res.Resources.getText(Resources.java:230)
at android.content.res.Resources.getString(Resources.java:314)
at android.content.Context.getString(Context.java:327)
at com.facebook.widget.WebDialog.onCreate(WebDialog.java:189)
at android.app.Dialog.dispatchOnCreate(Dialog.java:355)
at android.app.Dialog.show(Dialog.java:260)
at com.facebook.AuthorizationClient$WebViewAuthHandler.tryAuthorize(AuthorizationClient.java:471)
at com.facebook.AuthorizationClient.tryCurrentHandler(AuthorizationClient.java:214)
at com.facebook.AuthorizationClient.tryNextHandler(AuthorizationClient.java:193)
at com.facebook.AuthorizationClient.authorize(AuthorizationClient.java:121)
at com.facebook.AuthorizationClient.startOrContinueAuth(AuthorizationClient.java:102)
at com.facebook.LoginActivity.onResume(LoginActivity.java:113)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1185)
at android.app.Activity.performResume(Activity.java:5182)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2732)
... 12 more
i kinda resolved it, i deleted the app_id string. turns out facebook plugin doesn't use that.
I installed google play services in my sdk.
My xml file is attached below
<fragment
android:id="#+id/map"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
But an exception is raised after compiling java file.
Complete Log file also attached.
08-05 06:02:06.686: D/AndroidRuntime(1236): Shutting down VM
08-05 06:02:06.686: W/dalvikvm(1236): threadid=1: thread exiting with uncaught exception (group=0x414c4700)
08-05 06:02:06.847: E/AndroidRuntime(1236): FATAL EXCEPTION: main
08-05 06:02:06.847: E/AndroidRuntime(1236): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.viewindia/com.example.viewindia.ViewIndia}: android.view.InflateException: Binary XML file line #25: Error inflating class fragment
08-05 06:02:06.847: E/AndroidRuntime(1236): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
08-05 06:02:06.847: E/AndroidRuntime(1236): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
08-05 06:02:06.847: E/AndroidRuntime(1236): at android.app.ActivityThread.access$600(ActivityThread.java:141)
08-05 06:02:06.847: E/AndroidRuntime(1236): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
08-05 06:02:06.847: E/AndroidRuntime(1236): at android.os.Handler.dispatchMessage(Handler.java:99)
08-05 06:02:06.847: E/AndroidRuntime(1236): at android.os.Looper.loop(Looper.java:137)
08-05 06:02:06.847: E/AndroidRuntime(1236): at android.app.ActivityThread.main(ActivityThread.java:5103)
08-05 06:02:06.847: E/AndroidRuntime(1236): at java.lang.reflect.Method.invokeNative(Native Method)
08-05 06:02:06.847: E/AndroidRuntime(1236): at java.lang.reflect.Method.invoke(Method.java:525)
08-05 06:02:06.847: E/AndroidRuntime(1236): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
08-05 06:02:06.847: E/AndroidRuntime(1236): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
08-05 06:02:06.847: E/AndroidRuntime(1236): at dalvik.system.NativeStart.main(Native Method)
08-05 06:02:06.847: E/AndroidRuntime(1236): Caused by: android.view.InflateException: Binary XML file line #25: Error inflating class fragment
08-05 06:02:06.847: E/AndroidRuntime(1236): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:713)
08-05 06:02:06.847: E/AndroidRuntime(1236): at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
08-05 06:02:06.847: E/AndroidRuntime(1236): at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
08-05 06:02:06.847: E/AndroidRuntime(1236): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
08-05 06:02:06.847: E/AndroidRuntime(1236): at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
08-05 06:02:06.847: E/AndroidRuntime(1236): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:267)
08-05 06:02:06.847: E/AndroidRuntime(1236): at android.app.Activity.setContentView(Activity.java:1895)
08-05 06:02:06.847: E/AndroidRuntime(1236): at com.example.viewindia.ViewIndia.onCreate(ViewIndia.java:25)
08-05 06:02:06.847: E/AndroidRuntime(1236): at android.app.Activity.performCreate(Activity.java:5133)
08-05 06:02:06.847: E/AndroidRuntime(1236): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
08-05 06:02:06.847: E/AndroidRuntime(1236): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
08-05 06:02:06.847: E/AndroidRuntime(1236): ... 11 more
08-05 06:02:06.847: E/AndroidRuntime(1236): Caused by: android.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.android.gms.maps.MapFragment: make sure class name exists, is public, and has an empty constructor that is public
08-05 06:02:06.847: E/AndroidRuntime(1236): at android.app.Fragment.instantiate(Fragment.java:592)
08-05 06:02:06.847: E/AndroidRuntime(1236): at android.app.Fragment.instantiate(Fragment.java:560)
08-05 06:02:06.847: E/AndroidRuntime(1236): at android.app.Activity.onCreateView(Activity.java:4738)
08-05 06:02:06.847: E/AndroidRuntime(1236): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:689)
08-05 06:02:06.847: E/AndroidRuntime(1236): ... 21 more
08-05 06:02:06.847: E/AndroidRuntime(1236): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.maps.MapFragment" on path: DexPathList[[zip file "/data/app/com.example.viewindia-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.viewindia-2, /system/lib]]
08-05 06:02:06.847: E/AndroidRuntime(1236): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
08-05 06:02:06.847: E/AndroidRuntime(1236): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
08-05 06:02:06.847: E/AndroidRuntime(1236): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
08-05 06:02:06.847: E/AndroidRuntime(1236): at android.app.Fragment.instantiate(Fragment.java:582)
08-05 06:02:06.847: E/AndroidRuntime(1236): ... 24 more
How can I solve this problem?
You have to add the Google Play Service SDK as a project in your workspace (assuming you're using Eclipse). This is described here.
The next step is to link this project with your Android project as a library. Here's the docu about this step.
I have an app in which I have
public class mainactivity extends Activity implements View.OnClickListener
{
...
and I declare it in that manifest. Everything compiles and runs perfectly. Then I change the class as follows:
public class mainactivity extends Activity implements View.OnClickListener , MoPubInterstitialListener
{
...
+ extra code to do with "mopub"
this new code compiles, but now, as soon as my splash screen activity shuts down and hands over to mainactivity, I see
03-08 10:47:40.380: I/dalvikvm(9013): Failed resolving Lcom/mycompany/myapp/mainactivity; interface 1127 'Lcom/mopub/mobileads/MoPubInterstitial$MoPubInterstitialListener;'
03-08 10:47:40.380: W/dalvikvm(9013): Link of class 'Lcom/mycompany/myapp/mainactivity;' failed
03-08 10:47:40.380: D/AndroidRuntime(9013): Shutting down VM
03-08 10:47:40.380: W/dalvikvm(9013): threadid=1: thread exiting with uncaught exception (group=0x40c7e1f8)
03-08 10:47:40.385: E/AndroidRuntime(9013): FATAL EXCEPTION: main
03-08 10:47:40.385: E/AndroidRuntime(9013): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.mycompany.myapp/com.mycompany.myapp.mainactivity}: java.lang.ClassNotFoundException: com.mycompany.myapp.mainactivity
03-08 10:47:40.385: E/AndroidRuntime(9013): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1891)
03-08 10:47:40.385: E/AndroidRuntime(9013): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
03-08 10:47:40.385: E/AndroidRuntime(9013): at android.app.ActivityThread.access$600(ActivityThread.java:127)
03-08 10:47:40.385: E/AndroidRuntime(9013): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
03-08 10:47:40.385: E/AndroidRuntime(9013): at android.os.Handler.dispatchMessage(Handler.java:99)
03-08 10:47:40.385: E/AndroidRuntime(9013): at android.os.Looper.loop(Looper.java:137)
03-08 10:47:40.385: E/AndroidRuntime(9013): at android.app.ActivityThread.main(ActivityThread.java:4511)
03-08 10:47:40.385: E/AndroidRuntime(9013): at java.lang.reflect.Method.invokeNative(Native Method)
03-08 10:47:40.385: E/AndroidRuntime(9013): at java.lang.reflect.Method.invoke(Method.java:511)
03-08 10:47:40.385: E/AndroidRuntime(9013): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
03-08 10:47:40.385: E/AndroidRuntime(9013): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
03-08 10:47:40.385: E/AndroidRuntime(9013): at dalvik.system.NativeStart.main(Native Method)
03-08 10:47:40.385: E/AndroidRuntime(9013): Caused by: java.lang.ClassNotFoundException: com.mycompany.myapp.mainactivity
03-08 10:47:40.385: E/AndroidRuntime(9013): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
03-08 10:47:40.385: E/AndroidRuntime(9013): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
03-08 10:47:40.385: E/AndroidRuntime(9013): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
03-08 10:47:40.385: E/AndroidRuntime(9013): at android.app.Instrumentation.newActivity(Instrumentation.java:1026)
03-08 10:47:40.385: E/AndroidRuntime(9013): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1882)
03-08 10:47:40.385: E/AndroidRuntime(9013): ... 11 more
I'm at a loss as to how to proceed. If I try the debugger it appears that not even the first line of mainactivity.OnCreate() is executed.
EDIT: I have the following included in my manifest:
<activity android:name="com.mopub.mobileads.MoPubActivity"
android:configChanges="keyboardHidden|orientation"/>
Classpath
If this ring a bell, then read on.
Diagnosis:
It means the compiler find these classes during compile-time but this class is not found in your classpath during runtime
Medicine:
I've had this before and am not perfectly sure of the steps but let me put you in the right direcction.
If you're using ADT and eclipse, check your .classpath in your project.
check the build order in project->build properties
check if your jar is included in the build path
isLibraryProject
If the ComponentInfo is part of a library project, then it's a CardinalSin (seriously!) to include it in your build path manually. You are supposed to just add is a library project in project properties->android tab.
Did you define the MoPub activity in your Manifest?
<activity android:name="com.mopub.mobileads.MoPubActivity"
android:configChanges="keyboardHidden|orientation"/>
Go have a look at this link. It should solve your problem.
I had a similar issue and I checked on the android-support-v4.jar checkbox under Java Build Path - Order and Export.