gpt4 book ai didi

android - 无法解析 YouTubePlayerSupportFragment

转载 作者:行者123 更新时间:2023-11-29 01:27:34 26 4
gpt4 key购买 nike

我无法将 YouTubePlayerSupportFragment 正确编译到我的项目中。我已经审查了这个 post还有这个post并在那里实现了建议,但仍然没有成功。

以下是我目前所做的尝试:我将 YouTube API 保存在我的 libs 文件夹中。我的 gradle 文件的依赖项部分如下所示。您可以看到我尝试使用 gradle 包含库。无论我是否注释掉这一行(当然还有同步),我仍然得到相同的结果。

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.google.code.gson:gson:2.3.1'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'

compile 'com.google.dagger:dagger:2.0.1'
apt 'com.google.dagger:dagger-compiler:2.0.1'
provided 'org.glassfish:javax.annotation:10.0-b28'

compile 'commons-codec:commons-codec:1.10'
compile 'org.apache.commons:commons-io:1.3.2'

compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'

compile 'joda-time:joda-time:2.8.2'

compile 'com.google.android.gms:play-services:7.8.0'
// compile 'com.google.apis:google-api-services-youtube:v3-rev149-1.20.0'
}

这是一张屏幕截图,展示了我如何将 YouTube API 保存在 libs 文件夹中。 enter image description here

我按照 Google Developers guide 中的说明进行操作下载 zip 文件并了解需要复制哪些 jar。这些说明包括以下内容:

Dependencies for all Platforms

The following are the jars from the libs folder required for applications on all platforms:
google-api-client-1.20.0.jar
google-oauth-client-1.20.0.jar
google-http-client-1.20.0.jar
jsr305-1.3.9.jar
google-http-client-gson-1.20.0.jar (when using GSON) gson-2.1.jar
google-http-client-jackson2-1.20.0.jar (when using Jackson 2) jackson-core-$2.1.3.jar
google-http-client-jdo-1.20.0.jar (when using JDO) jdo2-api-2.3-eb.jar

Android Dependencies

The following are the jars from the libs folder required for android applications or a newer compatible version of each dependency:
google-api-client-android-1.20.0.jar (for SDK >= 2.1)
google-http-client-android-1.20.0.jar

最后,我查看了项目结构,这里看起来很棒:

enter image description here

那么为什么这个东西不解析为一个类型呢?我完全不知所措。感谢您的任何建议。

最佳答案

您包含了错误的 YouTube SDK。

YouTubePlayerSupportFragment 是 YouTube Player API 包的一部分,您可以在这里找到它:https://developers.google.com/youtube/android/player/

只需下载 JAR 存档,将其放入您的“libs”文件夹中,您就可以开始了。

关于android - 无法解析 YouTubePlayerSupportFragment,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33094019/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com