android ClassNotFoundException: Didn't find class

前端 未结 3 1282
故里飘歌
故里飘歌 2021-02-19 20:54
    02-28 01:49:27.741: E/AndroidRuntime(23024): FATAL EXCEPTION: main
    02-28 01:49:27.741: E/AndroidRuntime(23024): java.lang.RuntimeException: Unable to instantiate         


        
相关标签:
3条回答
  • 2021-02-19 21:19

    You do have a package mismatch error, it needs to be:

    package="com.haber29.android.reader"
    

    Since reader is the next subpackage and this is the subpackage that contains the Activities.

    And don't forget, you can specify the fully qualified name for each Activity, to prevent confusion:

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.haber29.android"
        android:versionCode="3"
        android:versionName="1.0" >
        <uses-sdk android:minSdkVersion="7" />
        <uses-permission android:name="android.permission.INTERNET"/>
        <application
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name">
            <activity
                android:name="com.haber29.android.reader.ITCutiesReaderAppActivity"
                android:label="@string/app_name" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity
                android:name="com.haber29.android.reader.ItemDescriptionActivity"
                android:label="@string/app_name" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                </intent-filter>
                </activity>
        </application>
    </manifest>
    
    0 讨论(0)
  • 2021-02-19 21:35

    I have the same problem today,because my library include the android-support-v4.jar not matching with my demo. I deleted the library's android-support-v4.jar and copied my demo's jar putting it in my library and it started to work.

    0 讨论(0)
  • 2021-02-19 21:38

    In my case my antivirus software (Avira for Mac) grabs dex files after every build I make and puts them into quarantine. After I stopped Avira, my project builds and runs.

    0 讨论(0)
提交回复
热议问题