今天在做项目的时候报了一个错,就是打开自己应用时,突然微信来了一条消息,然后跳到微信,程序就崩了,造成这个原因的是:
java.lang.RuntimeException: Unable to instantiate receiver com.zwg.xjkb.AppRegister: java.lang.ClassNotFoundException: Didn't find class "com.zwg.xjkb.AppRegister" on path: DexPathList[[zip file "/data/app/],nativeLibraryDirectories=[/data/app-lib/com.zwg.xjkb-2, /vendor/lib, /system/lib]]
08-22 10:43:39.855: E/AndroidRuntime(28037): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2410)
出现这个错的原因很简单,那是因为你集成微信支付的时候在调试微信支付时测没成功的时候就添加了这个服务
<!--
微信支付模块
<receiver
android:name=".AppRegister">
<intent-filter>
<action android:name="com.tencent.mm.plugin.openapi.Intent.ACTION_REFRESH_WXAPP" />
</intent-filter>
</receiver> -->
想未完全集成微信支付时想避免该错误就先把这个注释掉先
java.lang.RuntimeException: Unable to instantiate receiver com.zwg.xjkb.AppRegister: java.lang.ClassNotFoundException: Didn't find class "com.zwg.xjkb.AppRegister" on path: DexPathList[[zip file "/data/app/],nativeLibraryDirectories=[/data/app-lib/com.zwg.xjkb-2, /vendor/lib, /system/lib]]
08-22 10:43:39.855: E/AndroidRuntime(28037): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2410)
出现这个错的原因很简单,那是因为你集成微信支付的时候在调试微信支付时测没成功的时候就添加了这个服务
<!--
微信支付模块
<receiver
android:name=".AppRegister">
<intent-filter>
<action android:name="com.tencent.mm.plugin.openapi.Intent.ACTION_REFRESH_WXAPP" />
</intent-filter>
</receiver> -->
想未完全集成微信支付时想避免该错误就先把这个注释掉先