Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/360.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
Java 图书馆中的谷歌广告者ID_Java_Android - Fatal编程技术网

Java 图书馆中的谷歌广告者ID

Java 图书馆中的谷歌广告者ID,java,android,Java,Android,我正在尝试创建一个SDK,其中我需要谷歌广告商ID。根据本文中给出的说明,我将代码附加到了我的一个.java文件中。现在,当我试图将jar文件包含到项目中时,它抛出了一个错误 java.lang.VerifyError: com/..... Could not find method com.google.android.gms.ads.identifier.AdvertisingIdClient$Info.getId, referenced from method com/../getIdT

我正在尝试创建一个SDK,其中我需要谷歌广告商ID。根据本文中给出的说明,我将代码附加到了我的一个.java文件中。现在,当我试图将jar文件包含到项目中时,它抛出了一个错误

java.lang.VerifyError: com/.....

Could not find method com.google.android.gms.ads.identifier.AdvertisingIdClient$Info.getId, referenced from method com/../getIdThread
有人能帮我吗


注意:Google Play服务库和jar文件已添加到我的SDK中。

根据文档:

Google Play services 4.0支持广告ID API+

因此,您需要首先确保您已在应用程序中正确集成了Google Play服务支持。然后,您需要在运行时验证用户是否在其设备上安装了最新/必要的Google Play服务,然后再使用Google Play服务功能

下面是如何在类似的线程上从我的asnwer执行这两项操作:

大家好,欢迎来到Stack Overflow。请确保在请求代码帮助时,用户需要实际查看代码。