java.lang.NoClassDefFoundError:android

时间:2016-01-22 06:33:47

标签: java android git youtube-api youtube-data-api

嗨亲爱的开发人员我正在使用git hub资源,并且我以相同的方式实现,但是我在这里收到一些错误警告我正在共享我的日志猫。实际上我想在我的应用程序中使用youtube搜索。这是我的代码,我正在获得帮助github code



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)
&#13;
&#13;
&#13;

这是我的gradle.build,其中我添加了代码

所需的所有最新依赖项

&#13;
&#13;
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'
}
&#13;
&#13;
&#13;

任何有关我的问题的帮助都将受到赞赏,并提前致谢

1 个答案:

答案 0 :(得分:0)

添加

compile 'com.google.api.client:google-api-client:1.4.0-alpha'