由于未知原因导致强制关闭,错误日志如下所示:

时间:2011-11-10 07:15:04

标签: android

11-10 12:07:00.327: WARN/dalvikvm(558): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
11-10 12:07:00.357: ERROR/AndroidRuntime(558): FATAL EXCEPTION: main
11-10 12:07:00.357: ERROR/AndroidRuntime(558): java.lang.RuntimeException: Unable to instantiate activity
     

ComponentInfo {com.mutmonix.series / com.mutmonix.series.Main}:   java.lang.ClassNotFoundException:com.mutmonix.series.Main in loader   dalvik.system.PathClassLoader [/data/app/com.mutmonix.series-1.apk]       11-10 12:07:00.357:ERROR / AndroidRuntime(558):在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)       11-10 12:07:00.357:ERROR / AndroidRuntime(558):在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)       11-10 12:07:00.357:ERROR / AndroidRuntime(558):在android.app.ActivityThread.access $ 2300(ActivityThread.java:125)       11-10 12:07:00.357:ERROR / AndroidRuntime(558):在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:2033)       11-10 12:07:00.357:ERROR / AndroidRuntime(558):

     

在android.os.Handler.dispatchMessage(Handler.java:99)11-10   12:07:00.357:ERROR / AndroidRuntime(558):at   android.os.Looper.loop(Looper.java:123)11-10 12:07:00.357:   错误/ AndroidRuntime(558):at   android.app.ActivityThread.main(ActivityThread.java:4627)11-10   12:07:00.357:ERROR / AndroidRuntime(558):at   java.lang.reflect.Method.invokeNative(Native Method)11-10   12:07:00.357:ERROR / AndroidRuntime(558):at   java.lang.reflect.Method.invoke(Method.java:521)11-10 12:07:00.357:   错误/ AndroidRuntime(558):at   com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:868)   11-10 12:07:00.357:ERROR / AndroidRuntime(558):at   com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)11-10   12:07:00.357:ERROR / AndroidRuntime(558):at   dalvik.system.NativeStart.main(Native Method)11-10 12:07:00.357:   错误/ AndroidRuntime(558):引起:   java.lang.ClassNotFoundException:com.mutmonix.series.Main in loader   dalvik.system.PathClassLoader [/data/app/com.mutmonix.series-1.apk]   11-10 12:07:00.357:ERROR / AndroidRuntime(558):at   dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)   11-10 12:07:00.357:ERROR / AndroidRuntime(558):at   java.lang.ClassLoader.loadClass(ClassLoader.java:573)11-10   12:07:00.357:ERROR / AndroidRuntime(558):at   java.lang.ClassLoader.loadClass(ClassLoader.java:532)11-10   12:07:00.357:ERROR / AndroidRuntime(558):at   android.app.Instrumentation.newActivity(Instrumentation.java:1021)   11-10 12:07:00.357:ERROR / AndroidRuntime(558):at   android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)   11-10 12:07:00.357:ERROR / AndroidRuntime(558):... 11更多11-10   12:07:00.377:WARN / ActivityManager(68):强制完成活动   com.mutmonix.series / .Main 11-10 12:07:00.897:   WARN / ActivityManager(68):活动暂停超时   HistoryRecord {45027410 com.mutmonix.series / .Main}

Main. Java
package com.mutmonix.series.activities;    
import com.mutmonix.series.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;


public class Main extends Activity implements OnClickListener {

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
       setContentView(R.layout.main);   
     findViewById(R.id.link_BlueStone).setOnClickListener(this);

    }
    @Override
    public void onClick(View v) {
        if(v.getId()==R.id.link_BlueStone){

        }

    }




}

清单文件包含代码:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.mutmonix.series" android:versionCode="1"
    android:versionName="1.0">
    <uses-sdk android:minSdkVersion="8" />
    <uses-permission android:name="android.permission.INTERNET"/>
    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".Main" android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>
</manifest> 

2 个答案:

答案 0 :(得分:2)

原因看起来很清楚:

  

java.lang.ClassNotFoundException:com.mutmonix.series.Main

您的APK中似乎没有包含该课程。即使你认为你有,你也应该仔细检查。

答案 1 :(得分:0)

如果你确定你已经包含了Main class,那么你可以检查

  

的AndroidManifest.xml

com.mutmonix.series.Main类包含正确的包名。

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  

package =“com.mutmonix.series”

android:versionCode="1"
android:versionName="1.0" >

<uses-sdk android:minSdkVersion="7" />

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:label="@string/app_name"
        android:name=".Main" >