7

我正在使用 urbanairship 来显​​示通知。我已将我的 Android SDK 更新为最新更新,它开始显示与 urbanairship 提供商相关的错误,并且在旧版本上运行良好。

05-22 17:54:30.476: E/AndroidRuntime(575): FATAL EXCEPTION: main
05-22 17:54:30.476: E/AndroidRuntime(575): java.lang.RuntimeException: Unable to get provider com.urbanairship.UrbanAirshipProvider: java.lang.ClassNotFoundException: com.urbanairship.UrbanAirshipProvider
05-22 17:54:30.476: E/AndroidRuntime(575):  at android.app.ActivityThread.installProvider(ActivityThread.java:4289)
05-22 17:54:30.476: E/AndroidRuntime(575):  at android.app.ActivityThread.installContentProviders(ActivityThread.java:4041)
05-22 17:54:30.476: E/AndroidRuntime(575):  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3995)
05-22 17:54:30.476: E/AndroidRuntime(575):  at android.app.ActivityThread.access$1300(ActivityThread.java:127)
05-22 17:54:30.476: E/AndroidRuntime(575):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1217)
05-22 17:54:30.476: E/AndroidRuntime(575):  at android.os.Handler.dispatchMessage(Handler.java:99)
05-22 17:54:30.476: E/AndroidRuntime(575):  at android.app.ActivityThread.main(ActivityThread.java:4508)
05-22 17:54:30.476: E/AndroidRuntime(575):  at java.lang.reflect.Method.invokeNative(Native Method)
05-22 17:54:30.476: E/AndroidRuntime(575):  at java.lang.reflect.Method.invoke(Method.java:511)
05-22 17:54:30.476: E/AndroidRuntime(575):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)
05-22 17:54:30.476: E/AndroidRuntime(575):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)
05-22 17:54:30.476: E/AndroidRuntime(575):  at dalvik.system.NativeStart.main(Native Method)
05-22 17:54:30.476: E/AndroidRuntime(575): Caused by: java.lang.ClassNotFoundException: com.urbanairship.UrbanAirshipProvider
05-22 17:54:30.476: E/AndroidRuntime(575):  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
05-22 17:54:30.476: E/AndroidRuntime(575):  at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
05-22 17:54:30.476: E/AndroidRuntime(575):  at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
05-22 17:54:30.476: E/AndroidRuntime(575):  at android.app.ActivityThread.installProvider(ActivityThread.java:4274)
05-22 17:54:30.476: E/AndroidRuntime(575):  ... 12 more

我在我的项目中使用 urbanairship-lib-2.1.4.jar。有兼容性问题还是什么?

4

1 回答 1

4

耶!刚刚找到了解决方案!问题在于Android Private Libraries最新更新中引入了哪些内容。出于某种原因,默认情况下它们在项目属性中被勾选。

只是去Project -> Properties -> Java Build Path -> Order and Export检查Android Private Libraries。这解决了我的问题。

于 2013-05-24T01:46:26.670 回答