小编Die*_*zzo的帖子

GCM错误 - googleCloudMessaging.register

我有Android应用程序说的问题."应用程序xxxx抱歉停止"使用推送通知,执行调试时,它通过时发生:

方法1

InstanceID InstanceId = InstanceID.getInstance (context);

 token = instanceID.getToken (key_id.toString ()

GoogleCloudMessaging.INSTANCE_ID_SCOPE); getToken error,
Run Code Online (Sandbox Code Playgroud)

方法2

两个都是同一个错误

 if (googleCloudMessaging == null) {
googleCloudMessaging = GoogleCloudMessaging.getInstance(context);
                    }
                    token = googleCloudMessaging.register(key_id);
Run Code Online (Sandbox Code Playgroud)

请注意,生成令牌但应用程序已关闭,错误:

"The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir (android.content.Context)' was expected to be of type virtual but was found to be Instead of direct type (declaration of 'java.lang .reflect.ArtMethod 'appears in /system/framework/core-libart.jar)"
Run Code Online (Sandbox Code Playgroud)

我正在使用android studio,用于cdvCompileSdkVersion = android-22 cdvBuildToolsVersion = 22.0.1

错误:

"FATAL EXCEPTION: main
Process:  PID: 11989
java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to …
Run Code Online (Sandbox Code Playgroud)

android push-notification google-cloud-messaging sap-fiori gcmlistenerservice

13
推荐指数
2
解决办法
8505
查看次数