嗨 亲爱的开发人员 我正在使用 git 集线器资源,并且我的实现方式与它相同,但是我在这里收到一些警告错误,我正在共享我的日志猫。 实际上,我正在尝试在我的应用程序中使用YouTube搜索。这是我的代码,我正在获得帮助 github 代码
01-22 11:11:38.126 11202-11202/com.projects.et.youtubeapp E/GMPM: GoogleService failed to initialize, status: 10, Missing an expected resource: 'R.string.google_app_id' for initializing Google services. Possible causes are missing google-services.json or com.google.gms.google-services gradle plugin.
01-22 11:11:38.126 11202-11202/com.projects.et.youtubeapp E/GMPM: Scheduler not set. Not logging error/warn.
01-22 11:11:38.151 11202-11223/com.projects.et.youtubeapp E/GMPM: Uploading is not possible. App measurement disabled
Could not find class 'com.google.api.client.http.javanet.ConnectionFactory', referenced from method com.google.api.client.http.javanet.NetHttpTransport.<init>
VFY: unable to resolve check-cast 7925 (Lcom/google/api/client/http/javanet/ConnectionFactory;) in Lcom/google/api/client/http/javanet/NetHttpTransport;
VFY: unable to find class referenced in signature (Lcom/google/api/client/http/javanet/ConnectionFactory;)
Could not find class 'com.google.api.client.http.javanet.DefaultConnectionFactory', referenced from method com.google.api.client.http.javanet.NetHttpTransport.<init>
VFY: unable to resolve new-instance 7926 (Lcom/google/api/client/http/javanet/DefaultConnectionFactory;) in Lcom/google/api/client/http/javanet/NetHttpTransport;
Could not find class 'com.google.api.client.http.javanet.DefaultConnectionFactory', referenced from method com.google.api.client.http.javanet.NetHttpTransport.<init>
VFY: unable to resolve new-instance 7926 (Lcom/google/api/client/http/javanet/DefaultConnectionFactory;) in Lcom/google/api/client/http/javanet/NetHttpTransport;
VFY: unable to find class referenced in signature (Lcom/google/api/client/http/javanet/NetHttpRequest;)
VFY: unable to find class referenced in signature (Lcom/google/api/client/http/LowLevelHttpRequest;)
VFY: unable to resolve static method 56789: Lcom/google/api/client/util/Preconditions;.checkArgument (ZLjava/lang/String;[Ljava/lang/Object;)V
VFY: unable to find class referenced in signature (Lcom/google/api/client/http/HttpRequestFactory;)
VFY: unable to find class referenced in signature (Lcom/google/api/client/http/HttpRequestFactory;)
Could not find class 'com.google.api.client.http.HttpRequestFactory', referenced from method com.google.api.client.http.HttpTransport.createRequestFactory
VFY: unable to resolve new-instance 7912 (Lcom/google/api/client/http/HttpRequestFactory;) in Lcom/google/api/client/http/HttpTransport;
: java.lang.NoClassDefFoundError: com.google.api.client.http.javanet.ConnectionFactory
: at com.google.api.client.http.javanet.NetHttpTransport.<init>(NetHttpTransport.java:96)
: at com.projects.et.youtubeapp.connections.ServiceTask.loadVideos(ServiceTask.java:80)
: at com.projects.et.youtubeapp.connections.ServiceTask.doInBackground(ServiceTask.java:55)
: at com.projects.et.youtubeapp.connections.ServiceTask.doInBackground(ServiceTask.java:22)
: at android.os.AsyncTask$2.call(AsyncTask.java:287)
: at java.util.concurrent.FutureTask.run(FutureTask.java:234)
: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
: at java.lang.Thread.run(Thread.java:841)
这是我的 gradle.build,我在其中添加了代码所需的所有最新依赖项
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.google.apis:google-api-services-youtube:v3-rev120-1.19.0'
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.google.api-client:google-api-client-gson:1.21.0'
compile 'com.google.api-client:google-api-client-android:1.21.0'
compile 'com.google.http-client:google-http-client-android:1.21.0'
}
有关我的问题的任何帮助将不胜感激,并提前表示感谢
添加
compile 'com.google.api.client:google-api-client:1.4.0-alpha'