包在附加的库/模块/依赖项上不存在

时间:2019-02-15 13:36:09

标签: java android gradle

我已将外部库添加为模块。

我的问题是:mixed screenshots describing the problem and situation主应用程序活动看不到这些外部类,符号。甚至无法使用alt + enter导入它们,这里没有选项。

将此https://github.com/jeancsanchez/JcPlayer下载为zip文件。然后将/ libs目录解压。其中/是整个项目的根目录。

试图使用其他主题的本指南添加它

Android Studio works on project-modules concept,All your modules should be inside a root directory(Your Project Directory). One module can be depended on other module/modules. Your libraries are considered as different modules under same project and your main module(app in your case) depends on them.

Change your project structure a little bit :

Project Root
+-- libs
    +-- PullToRefresh (my lib project)
+-- app
|   +-- builds
|   +-- src
|   |   +-- main (java code and resources)
    +-- .....
+--settings.gradle
Include this line in your settings.gradle

include ':libs:PullToRefresh'
Your build.gradle looks fine. I suggest you to change your directory name from libs to library because use libs for your jar dependency not for module dependencies.

and keep this in your main module's build.gradle file :

dependencies {
    compile project(":libs:PullToRefresh")
}

但是很遗憾,compile project(":libs:PullToRefresh")对我不起作用。 implementation project(":libs:PullToRefresh")也不起作用。

只有releaseImplementation project(':libs:jcplayer')有效。

这是我目前的问题:errors

我试图做无效缓存。

重建项目。

使用gradle文件同步项目

我不知道该怎么办。真。 +我是弱小的android开发人员


按照本教程https://github.com/MagicMicky/FreemiumLibrary/wiki/Import-the-library-in-Android-Studio进行操作

https://i.imgur.com/dAm54ub.png

0 个答案:

没有答案