gpt4 book ai didi

Android GCM- GCMRegistrar checkManifest(this) - list 文件错误

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:38:44 26 4
gpt4 key购买 nike

我尝试实现 GCM,但出现错误,我尝试在互联网上查找日志,但找不到。当代码出现在这些行时,我在 logcat 中收到错误

GCMRegistrar.checkDevice(this);
GCMRegistrar.checkManifest(this);

这个 logcat 输出是什么意思?

09-11 11:14:25.132: W/dalvikvm(11946): threadid=11: thread exiting with uncaught  exception (group=0x40aac210)
09-11 11:14:25.142: E/AndroidRuntime(11946): FATAL EXCEPTION: IntentService[ManagePushCommunicationService]
09-11 11:14:25.142: E/AndroidRuntime(11946): java.lang.IllegalStateException: Application does not define permission com.example.push.permission.C2D_MESSAGE
09-11 11:14:25.142: E/AndroidRuntime(11946): at com.google.android.gcm.GCMRegistrar.checkManifest(GCMRegistrar.java:135)
09-11 11:14:25.142: E/AndroidRuntime(11946): at com.example.push.services.ManagePushCommunicationService.startJob(ManagePushCommunicationService.java:156)
09-11 11:14:25.142: E/AndroidRuntime(11946): at com.example.push.services.ManagePushCommunicationService.onHandleIntent(ManagePushCommunicationService.java:85)
09-11 11:14:25.142: E/AndroidRuntime(11946): at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-11 11:14:25.142: E/AndroidRuntime(11946): at android.os.Handler.dispatchMessage(Handler.java:99)
09-11 11:14:25.142: E/AndroidRuntime(11946): at android.os.Looper.loop(Looper.java:137)
09-11 11:14:25.142: E/AndroidRuntime(11946): at android.os.HandlerThread.run(HandlerThread.java:60)
09-11 11:19:25.162: I/Process(11946): Sending signal. PID: 11946 SIG: 9

最佳答案

将权限放在 list 文件中:

<permission android:name="com.example.gcm.permission.C2D_MESSAGE"android:protectionLevel="signature"/>
<uses-permission android:name="com.example.gcm.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

关于Android GCM- GCMRegistrar checkManifest(this) - list 文件错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12365598/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com