Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to instantiate activity component when running android example code
    primarykey
    data
    text
    <p>I am learning the <a href="http://developer.android.com/training/implementing-navigation/lateral.html#horizontal-paging" rel="nofollow">tutorial</a> from the android web site. </p> <p>But when I run the application, it prompts <code>Unable to instantiate activity component</code>, something about the classNotFoundException. But in the manifext.xml file the MainActivity was registered. I don't know where is the problem. Here is the full error log.</p> <pre><code>05-03 18:59:00.425: E/AndroidRuntime(20858): FATAL EXCEPTION: main 05-03 18:59:00.425: E/AndroidRuntime(20858): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.android.effectivenavigation/com.example.android.effectivenavigation.MainActivity}: java.lang.ClassNotFoundException: com.example.android.effectivenavigation.MainActivity 05-03 18:59:00.425: E/AndroidRuntime(20858): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1983) 05-03 18:59:00.425: E/AndroidRuntime(20858): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084) 05-03 18:59:00.425: E/AndroidRuntime(20858): at android.app.ActivityThread.access$600(ActivityThread.java:130) 05-03 18:59:00.425: E/AndroidRuntime(20858): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195) 05-03 18:59:00.425: E/AndroidRuntime(20858): at android.os.Handler.dispatchMessage(Handler.java:99) 05-03 18:59:00.425: E/AndroidRuntime(20858): at android.os.Looper.loop(Looper.java:137) 05-03 18:59:00.425: E/AndroidRuntime(20858): at android.app.ActivityThread.main(ActivityThread.java:4745) 05-03 18:59:00.425: E/AndroidRuntime(20858): at java.lang.reflect.Method.invokeNative(Native Method) 05-03 18:59:00.425: E/AndroidRuntime(20858): at java.lang.reflect.Method.invoke(Method.java:511) 05-03 18:59:00.425: E/AndroidRuntime(20858): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 05-03 18:59:00.425: E/AndroidRuntime(20858): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 05-03 18:59:00.425: E/AndroidRuntime(20858): at dalvik.system.NativeStart.main(Native Method) 05-03 18:59:00.425: E/AndroidRuntime(20858): Caused by: java.lang.ClassNotFoundException: com.example.android.effectivenavigation.MainActivity 05-03 18:59:00.425: E/AndroidRuntime(20858): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61) 05-03 18:59:00.425: E/AndroidRuntime(20858): at java.lang.ClassLoader.loadClass(ClassLoader.java:501) 05-03 18:59:00.425: E/AndroidRuntime(20858): at java.lang.ClassLoader.loadClass(ClassLoader.java:461) 05-03 18:59:00.425: E/AndroidRuntime(20858): at android.app.Instrumentation.newActivity(Instrumentation.java:1053) 05-03 18:59:00.425: E/AndroidRuntime(20858): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974) 05-03 18:59:00.425: E/AndroidRuntime(20858): ... 11 more </code></pre> <p>manifest file, AbdroidManifest.xml</p> <pre><code>&lt;!-- Copyright 2012 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.android.effectivenavigation" android:versionCode="1" android:versionName="1.0"&gt; &lt;uses-sdk android:minSdkVersion="14" /&gt; &lt;application android:label="@string/app_name" android:icon="@drawable/ic_launcher" android:theme="@android:style/Theme.Holo.Light.DarkActionBar"&gt; &lt;activity android:name=".MainActivity" android:label="@string/app_name"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name=".CollectionDemoActivity" android:label="@string/demo_collection" /&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload