我无法在Google Play控制台中找到实际处理我的应用程序代码的堆栈跟踪部分。我得到的只是系统内容,没有显示我的代码中导致错误的位置。
java.lang.RuntimeException:
at android.app.ActivityThread.handleReceiver (ActivityThread.java:2884)
at android.app.ActivityThread.-wrap14 (ActivityThread.java)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1565)
at android.os.Handler.dispatchMessage (Handler.java:111)
at android.os.Looper.loop (Looper.java:207)
at android.app.ActivityThread.main (ActivityThread.java:5728)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:679)
Caused by: java.lang.ClassNotFoundException:
at dalvik.system.BaseDexClassLoader.findClass (BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass (ClassLoader.java:511)
at java.lang.ClassLoader.loadClass (ClassLoader.java:469)
at android.app.ActivityThread.handleReceiver (ActivityThread.java:2879)
答案 0 :(得分:0)
Android是完全开源的。如果您查看ActivityThread
handleReceiver()
,则可以看到当您的应用收到广播时,系统会调用<receiver android:name=".MyBroadcastReceiver" android:exported="true">
。
如果您阅读the source code,您可以看到广播从Android操作系统进入,并转到清单中声明的类。在该页面上给出的示例中,您的清单看起来如下:
public class MyBroadcastReceiver extends BroadcastReceiver {
然后你需要一个像
这样的课程{
"fruit": [
{
"fruitName": "All",
"season": [
{
"seasonName": "All",
"yearValues": [
{
"year": 2017,
"value": 200
},
{
"year": 2018,
"value": 200
}
]
},
{
"seasonName": "Sept",
"yearValues": [
{
"year": 2017,
"value": 100
},
{
"year": 2018,
"value": 100
}
]
},
{
"seasonName": "Oct",
"yearValues": [
{
"year": 2017,
"value": 100
},
{
"year": 2018,
"value": 100
}
]
}
]
},
{
"fruitName": "Orange",
"season": [
{
"seasonName": "All",
"yearValues": [
{
"year": 2017,
"value": 100
},
{
"year": 2018,
"value": 100
}
]
},
{
"seasonName": "Sept",
"yearValues": [
{
"year": 2017,
"value": 50
},
{
"year": 2018,
"value": 50
}
]
},
{
"seasonName": "Oct",
"yearValues": [
{
"year": 2017,
"value": 50
},
{
"year": 2018,
"value": 50
}
]
}
]
},
{
"fruitName": "Grapes",
"season": [
{
"seasonName": "All",
"yearValues": [
{
"year": 2017,
"value": 100
},
{
"year": 2018,
"value": 100
}
]
},
{
"seasonName": "Sept",
"yearValues": [
{
"year": 2017,
"value": 50
},
{
"year": 2018,
"value": 50
}
]
},
{
"seasonName": "Oct",
"yearValues": [
{
"year": 2017,
"value": 50
},
{
"year": 2018,
"value": 50
}
]
}
]
}
]
}
我会从堆栈跟踪中猜出你在清单中声明了你的APK没有的广播接收器。要么你忘记编写代码,得到类名错误,要么像proguard错误地剥离它(不太可能)。