English 中文(简体)
部队 由于不明原因,Errorlog显示如下:
原标题:Get a Force Close due to unknown Reason, Error Log is shown below:
  • 时间: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): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585) 11-10 12:07:00.357: ERROR/AndroidRuntime(558): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 11-10 12:07:00.357: ERROR/AndroidRuntime(558): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 11-10 12:07:00.357: ERROR/AndroidRuntime(558): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 11-10 12:07:00.357: ERROR/AndroidRuntime(558):

at 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: ERROR/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: ERROR/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: ERROR/AndroidRuntime(558): Caused by: 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 more 11-10 12:07:00.377: WARN/ActivityManager(68): Force finishing activity com.mutmonix.series/.Main 11-10 12:07:00.897: WARN/ActivityManager(68): Activity pause timeout for 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> 
问题回答

原因对我来说相当清楚:

java.lang.Class NotFoundException: com.mutmonix.series。 主要委员会

It appears that you haven t included that class in your APK. Even if you think you have, you should double check.

如果你确信你已经将主要班级包括在内,那么, 页: 1

AndroidManifest.xml

这 com。 主要类别包括正确的包装名称。

<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" >




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签