无法获取提供者abc.xxx.Datapro:java.lang.ClassNotFoundException

时间:2014-08-28 09:51:22

标签: android eclipse

无法获取提供者abc.xxx.Datapro:java.lang.ClassNotFoundException:未找到类" abc.xxx.Datapro" on path:DexPathList [[directory"。"],nativeLibraryDirectories = [/ vendor / lib,/ system / lib]]

logcat的

08-28 16:23:18.750: E/AndroidRuntime(2189): FATAL EXCEPTION: main
08-28 16:23:18.750: E/AndroidRuntime(2189): Process: dbd.mygovtnotification, PID: 2189
08-28 16:23:18.750: E/AndroidRuntime(2189): java.lang.RuntimeException: Unable to get provider dbd.mygovtnotification.Datapro: java.lang.ClassNotFoundException: Didn't find class "dbd.mygovtnotification.Datapro" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
08-28 16:23:18.750: E/AndroidRuntime(2189):     at android.app.ActivityThread.installProvider(ActivityThread.java:4793)
08-28 16:23:18.750: E/AndroidRuntime(2189):     at android.app.ActivityThread.installContentProviders(ActivityThread.java:4385)
08-28 16:23:18.750: E/AndroidRuntime(2189):     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4325)
08-28 16:23:18.750: E/AndroidRuntime(2189):     at android.app.ActivityThread.access$1500(ActivityThread.java:135)
08-28 16:23:18.750: E/AndroidRuntime(2189):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
08-28 16:23:18.750: E/AndroidRuntime(2189):     at android.os.Handler.dispatchMessage(Handler.java:102)
08-28 16:23:18.750: E/AndroidRuntime(2189):     at android.os.Looper.loop(Looper.java:136)
08-28 16:23:18.750: E/AndroidRuntime(2189):     at android.app.ActivityThread.main(ActivityThread.java:5017)
08-28 16:23:18.750: E/AndroidRuntime(2189):     at java.lang.reflect.Method.invokeNative(Native Method)
08-28 16:23:18.750: E/AndroidRuntime(2189):     at java.lang.reflect.Method.invoke(Method.java:515)
08-28 16:23:18.750: E/AndroidRuntime(2189):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
08-28 16:23:18.750: E/AndroidRuntime(2189):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
08-28 16:23:18.750: E/AndroidRuntime(2189):     at dalvik.system.NativeStart.main(Native Method)
08-28 16:23:18.750: E/AndroidRuntime(2189): Caused by: java.lang.ClassNotFoundException: Didn't find class "dbd.mygovtnotification.Datapro" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
08-28 16:23:18.750: E/AndroidRuntime(2189):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
08-28 16:23:18.750: E/AndroidRuntime(2189):     at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
08-28 16:23:18.750: E/AndroidRuntime(2189):     at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
08-28 16:23:18.750: E/AndroidRuntime(2189):     at android.app.ActivityThread.installProvider(ActivityThread.java:4778)
08-28 16:23:18.750: E/AndroidRuntime(2189):     ... 12 more
08-28 16:24:10.301: D/AndroidRuntime(2242): Shutting down VM
08-28 16:24:10.321: W/dalvikvm(2242): threadid=1: thread exiting with uncaught exception (group=0xb1d80b20)
08-28 16:24:10.371: E/AndroidRuntime(2242): FATAL EXCEPTION: main
08-28 16:24:10.371: E/AndroidRuntime(2242): Process: dbd.mygovtnotification, PID: 2242
08-28 16:24:10.371: E/AndroidRuntime(2242): java.lang.RuntimeException: Unable to get provider dbd.mygovtnotification.Datapro: java.lang.ClassNotFoundException: Didn't find class "dbd.mygovtnotification.Datapro" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
08-28 16:24:10.371: E/AndroidRuntime(2242):     at android.app.ActivityThread.installProvider(ActivityThread.java:4793)
08-28 16:24:10.371: E/AndroidRuntime(2242):     at android.app.ActivityThread.installContentProviders(ActivityThread.java:4385)
08-28 16:24:10.371: E/AndroidRuntime(2242):     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4325)
08-28 16:24:10.371: E/AndroidRuntime(2242):     at android.app.ActivityThread.access$1500(ActivityThread.java:135)
08-28 16:24:10.371: E/AndroidRuntime(2242):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
08-28 16:24:10.371: E/AndroidRuntime(2242):     at android.os.Handler.dispatchMessage(Handler.java:102)
08-28 16:24:10.371: E/AndroidRuntime(2242):     at android.os.Looper.loop(Looper.java:136)
08-28 16:24:10.371: E/AndroidRuntime(2242):     at android.app.ActivityThread.main(ActivityThread.java:5017)
08-28 16:24:10.371: E/AndroidRuntime(2242):     at java.lang.reflect.Method.invokeNative(Native Method)
08-28 16:24:10.371: E/AndroidRuntime(2242):     at java.lang.reflect.Method.invoke(Method.java:515)
08-28 16:24:10.371: E/AndroidRuntime(2242):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
08-28 16:24:10.371: E/AndroidRuntime(2242):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
08-28 16:24:10.371: E/AndroidRuntime(2242):     at dalvik.system.NativeStart.main(Native Method)
08-28 16:24:10.371: E/AndroidRuntime(2242): Caused by: java.lang.ClassNotFoundException: Didn't find class "dbd.mygovtnotification.Datapro" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
08-28 16:24:10.371: E/AndroidRuntime(2242):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
08-28 16:24:10.371: E/AndroidRuntime(2242):     at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
08-28 16:24:10.371: E/AndroidRuntime(2242):     at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
08-28 16:24:10.371: E/AndroidRuntime(2242):     at android.app.ActivityThread.installProvider(ActivityThread.java:4778)
08-28 16:24:10.371: E/AndroidRuntime(2242):     ... 12 more

的Manifest.xml

xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="dbd.mygovtnotification"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="11"
        android:targetSdkVersion="21" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

    <permission
        android:name="dbd.mygovtnotification.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />

    <uses-permission android:name="dbd.mygovtnotification.permission.C2D_MESSAGE" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" android:enabled="true" android:hasCode="false">
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
        </activity>

        <receiver
            android:name=".GcmBroadcastReceiver"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />

                <category android:name="dbd.mygovtnotification" />
            </intent-filter>
        </receiver>

        <activity android:name="NewMainActivity" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <service android:name="GcMIntentService" >
        </service>

        <activity android:name="TeST" >
        </activity>

        <provider
            android:name="dbd.mygovtnotification.Datapro"
            android:authorities="dbd.mygovtnotification" 
            android:exported="false">
        </provider>

        <activity android:name="ViewJOB" >
        </activity>


    </application>

</manifest>

通过检查其他人做了什么

清理项目 重启日食,手机,模拟器,adb和电脑。

似乎没有任何帮助,不胜感激任何帮助

2 个答案:

答案 0 :(得分:0)

请尝试使用此代码:

android:name=".Datapro"
android:authorities="dbd.mygovtnotification.datapro"

答案 1 :(得分:0)

如果在我的情况下(当它以前工作时)没有任何作用,请考虑创建一个新项目并从旧项目复制文件并更新引用(一些将由eclipse自己处理)