Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/212.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 使用棒棒糖的Google Play授权库问题_Android_Android Intent_Android 5.0 Lollipop_Android Lvl - Fatal编程技术网

Android 使用棒棒糖的Google Play授权库问题

Android 使用棒棒糖的Google Play授权库问题,android,android-intent,android-5.0-lollipop,android-lvl,Android,Android Intent,Android 5.0 Lollipop,Android Lvl,我使用此页面中的代码进行许可证检查: 想让它也能为棒棒糖工作。错误是: java.lang.IllegalArgumentException: Service Intent must be explicit 不幸的是,这是Google Play授权库的一部分。该问题已分配,并将在将来解决。同时,如果您还想将库与棒棒糖一起使用,则有一个解决方法: 在LicenseChecker.java中,对此进行更改: boolean bindResult = mContext.bindService(ne

我使用此页面中的代码进行许可证检查:

想让它也能为棒棒糖工作。错误是:

java.lang.IllegalArgumentException: Service Intent must be explicit
不幸的是,这是Google Play授权库的一部分。该问题已分配,并将在将来解决。同时,如果您还想将库与棒棒糖一起使用,则有一个解决方法:

在LicenseChecker.java中,对此进行更改:

boolean bindResult = mContext.bindService(new Intent(new String(Base64.decode("Y29tLmFuZHJvaWQudmVuZGluZy5saWNlbnNpbmcuSUxpY2Vuc2luZ1NlcnZpY2U="))),
                                          this, // ServiceConnection.
                                          Context.BIND_AUTO_CREATE);
为此:

Intent serviceIntent = new Intent(new String(Base64.decode("Y29tLmFuZHJvaWQudmVuZGluZy5saWNlbnNpbmcuSUxpY2Vuc2luZ1NlcnZpY2U=")));
serviceIntent.setPackage("com.android.vending");

boolean bindResult = mContext.bindService(serviceIntent),
                                          this, // ServiceConnection.
                                          Context.BIND_AUTO_CREATE);

我正在使用最新的库jar文件(所有谷歌服务-我也使用分析),我不认为许可证验证库在谷歌Play服务中。你在哪里找到这些信息?你应该有一个名为play_licensing的外部项目,或者类似的东西哦sry,这是真的•我现在如何修改它?打开Google play License Library项目中的LicenseChecker.java,并更改代码,如答案所示。