java.lang.RuntimeException:无法实例化接收器com.XXX.XXX.library.receivers.AviarySystemReceiver

时间:2013-06-18 14:02:07

标签: android eclipse aviary

场合

Aviary-SDK包含在库中。在我尝试设置计费系统并更新SDK和ADT之后,一切都工作正常(Eclipse的外观包括旧的加载屏幕,但一切似乎仍在加载)。 现在,它不再适用于显示的错误。 将Aviary-SDK添加到项目构建路径时,我仍然会收到错误但可以运行项目,直到我尝试打开Aviary-Editor。

尽管如此,sample application似乎正在发挥作用。我尝试复制清单中最重要的部分和res /值而没有任何明显的效果。

错误

06-18 13:40:49.687: E/Trace(1926): error opening trace file: No such file or directory (2)
06-18 13:40:50.178: E/AndroidRuntime(1926): FATAL EXCEPTION: main
06-18 13:40:50.178: E/AndroidRuntime(1926): java.lang.RuntimeException: Unable to instantiate receiver com.XXX.XXX.library.receivers.AviarySystemReceiver: java.lang.ClassNotFoundException: Didn't find class "com.XXX.XXX.library.receivers.AviarySystemReceiver" on path: /data/app/com.XXX.XXX-1.apk
06-18 13:40:50.178: E/AndroidRuntime(1926):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2357)
06-18 13:40:50.178: E/AndroidRuntime(1926):     at android.app.ActivityThread.access$1500(ActivityThread.java:141)
06-18 13:40:50.178: E/AndroidRuntime(1926):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1310)
06-18 13:40:50.178: E/AndroidRuntime(1926):     at android.os.Handler.dispatchMessage(Handler.java:99)
06-18 13:40:50.178: E/AndroidRuntime(1926):     at android.os.Looper.loop(Looper.java:137)
06-18 13:40:50.178: E/AndroidRuntime(1926):     at android.app.ActivityThread.main(ActivityThread.java:5039)
06-18 13:40:50.178: E/AndroidRuntime(1926):     at java.lang.reflect.Method.invokeNative(Native Method)
06-18 13:40:50.178: E/AndroidRuntime(1926):     at java.lang.reflect.Method.invoke(Method.java:511)
06-18 13:40:50.178: E/AndroidRuntime(1926):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
06-18 13:40:50.178: E/AndroidRuntime(1926):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
06-18 13:40:50.178: E/AndroidRuntime(1926):     at dalvik.system.NativeStart.main(Native Method)
06-18 13:40:50.178: E/AndroidRuntime(1926): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.XXX.XXX.library.receivers.AviarySystemReceiver" on path: /data/app/com.XXX.XXX-1.apk
06-18 13:40:50.178: E/AndroidRuntime(1926):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
06-18 13:40:50.178: E/AndroidRuntime(1926):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
06-18 13:40:50.178: E/AndroidRuntime(1926):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
06-18 13:40:50.178: E/AndroidRuntime(1926):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2352)
06-18 13:40:50.178: E/AndroidRuntime(1926):     ... 10 more
06-18 13:40:53.336: E/Trace(1956): error opening trace file: No such file or directory (2)
06-18 13:40:53.656: E/dalvikvm(1956): Could not find class 'com.aviary.android.feather.FeatherActivity', referenced from method com.XXX.XXX.MainActivity.invokeavary

的AndroidManifest.xml

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

<uses-feature android:name="android.hardware.camera" />

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.INTERNET" />


<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />

<application
    android:hardwareAccelerated="true"
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/Theme.Sherlock.Light"
    android:largeHeap="true" >

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

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

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.PICK" /> 
            <category android:name="android.intent.category.DEFAULT"  /> 
            <category android:name="android.intent.category.OPENABLE" />
            <data android:mimeType="image/*" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.SEND" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.OPENABLE" />
            <data android:mimeType="image/*" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.GET_CONTENT" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.OPENABLE" />
            <data android:mimeType="image/*" />
        </intent-filter>
    </activity>

    <activity android:name=".creator" />
    <activity android:name=".recently" />

    <!-- 
    AVIARY FEATHER ENTRIES
     -->

     <activity
        android:name="com.aviary.android.feather.FeatherActivity"
        android:configChanges="orientation|keyboardHidden|screenSize"
        android:theme="@style/FeatherDefaultTheme.Custom"
        android:process=":standalone" />       

    <receiver
        android:name="com.XXX.XXX.library.receivers.AviarySystemReceiver"
        android:exported="true"
        android:process=":aviary_sample_system_receiver" >
        <intent-filter>
            <action android:name="android.intent.action.PACKAGE_ADDED" />
            <action android:name="android.intent.action.PACKAGE_REMOVED" />
            <action android:name="android.intent.action.PACKAGE_REPLACED" />
            <data android:scheme="package" />
        </intent-filter>            
    </receiver>

    <provider 
        android:name="com.aviary.android.feather.library.providers.FeatherContentProvider"
        android:exported="false"
        android:authorities="com.XXX.XXX.HiResProvider"
        android:process=":standalone">
    </provider>

</application>

1 个答案:

答案 0 :(得分:1)

看起来问题发生了,因为我在更新破坏了ADT之后将接收者名称更改为我自己的路径(com.XXX.XXX。*而不是com.aviary.android。*)用于测试目的。

现在我按照@CommonsWare's URL的说明在更新22之后修复了ADT并将其更改回com.aviary.android。*,它运行正常。