java - 无法解析 YouTubeAndroidPlayerApi 依赖项

标签 java android android-studio android-gradle-plugin build.gradle

我已经创建了一个项目并尝试添加 YouTubeAndroidPlayer jar dependency但无法解决它。 gradle 能够同步它,但在继承和使用它时,它可能无法解析并抛出编译时错误。我使用的是2.3.2版本的Android studio。请检查随附的 .gradle 和 .java 文件屏幕截图。

gradle file heirarchy

和Java文件:

enter image description here

谢谢。

最佳答案

幸运的是,它成功了,步骤: - 首先,添加了一个 Jar 文件类型的新模块,它在 libs 文件夹下放置了这样的条目:

enter image description here

  • 其次,在应用程序目录下 -> libs 文件夹内 -> 需要复制相同的 JAR 文件。

enter image description here

这解决了问题。由于我是 android 新手,因此确实可以以某种方式解决它。

谢谢。

关于java - 无法解析 YouTubeAndroidPlayerApi 依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44477368/

相关文章:

android-studio - 当我连接手机时,Android Studio 中的 Logcat 发出的消息比以前多——比如 50 条/秒?

java 日历之间的差异

java - 当我编辑类时,Eclipse Helios for Java 中的控制台未更新

android - 如何读取app文件夹下的配置文件

java - Android 应用程序因 Google map 对象而崩溃

android - 我们可以在 Android 应用程序中使用 Google 支付作为辅助方法吗?

java - 组织.hibernate.MappingException : Repeated column in mapping for entity

java - Gson合并JsonObject抛出java.lang.UnsupportedOperationException

android - 如何为 TestClasses 中的 Activity 变量赋值

android - 任何稳定版的 Android Studio