Android 应用程序出现 IllegalArgumentException 错误:未找到 GCM 密钥

IllegalArgumentException error on Android application: GCM key not found

应用程序构建正常,但在测试时(无论是模拟器还是 phone),安装后崩溃,并出现以下错误:

IBM.MCE 3.6.3.0 : GcmDeliveryChannel: GCM app key or project number is not available
--------- beginning of crash
E/AndroidRuntime: FATAL EXCEPTION: pool-2-thread-1
    Process: apptest.test, PID: 3759
    java.lang.IllegalArgumentException: Init Process: Properties files doesn't contain GCM AppKey or GCM ProjectNum. If you don't want to support GCM add support.gcm=false to mce.properties
        at com.ibm.mce.sdk.gcm.GcmDeliveryChannel.initializeChannel(Unknown Source)
        at com.ibm.mce.sdk.registration.DeliveryChannelImpl.initialiseComponents(Unknown Source)
        at com.ibm.mce.sdk.registration.DeliveryChannel.initialiseComponents(Unknown Source)
        at com.ibm.mce.sdk.registration.RegistrationClientImpl.initSdk(Unknown Source)
        at com.ibm.mce.sdk.registration.RegistrationClientImpl.access0(Unknown Source)
        at com.ibm.mce.sdk.registration.RegistrationClientImpl.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run

我可以应要求提供代码片段和配置文件,但由于演示原因,我不会全部上传。

该应用程序的作用基本上是作为来自 IBM Marketing Cloud 的推送通知接收器,使用 IBM Push Notifications,它本身连接到 GCM 以将推送发送到连接的设备。

我愿意给出任何更多的解释,因此,感谢您的时间。

您应该有一个 MceConfig.json 文件,可以让您指定 Google 项目编号和您在 IBM Marketing Cloud 中定义的应用程序密钥。寻找

"senderId": "YOUR GCM PROJECT ID"

"appKey": {
  "prod":"YOUR APP KEY"
}

并用您拥有的值替换它们。有关详细信息,请参阅示例应用。