使用实现而不是编译时无法访问库模块依赖项

ND1010_

在使用compile关键字添加依赖项时gradle,我能够访问库模块的所有依赖项。

但是在使用implementation关键字时,我无法访问库模块gradle文件中可用的应用程序模块中的那些依赖项

我的框架依赖

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar']) 
    implementation 'com.android.support:appcompat-v7:27.1.1' 
    implementation 'com.android.support:support-v4:27.1.1' 
    implementation 'com.android.support:design:27.1.1' 
    implementation 'com.squareup.retrofit2:retrofit:2.3.0' 
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0' 
    implementation 'com.squareup.okhttp3:okhttp:3.10.0' 
    implementation 'com.squareup.okhttp3:logging-interceptor:3.9.0' 
    implementation 'com.google.code.gson:gson:2.8.2' 
    implementation 'io.reactivex.rxjava2:rxjava:2.1.1' 
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.1' 
    implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0' 
    implementation 'org.greenrobot:eventbus:3.1.1'
}

我的应用依赖

dependencies {
implementation project(':framework')
implementation fileTree(include: ['*.jar'], dir: 'libs')
}

问题

如果我使用compile关键字来编译依赖项,它会起作用。如果我使用implementation关键字来编译依赖项,它将无法正常工作

问题截图

在此处输入图片说明

威尔逊

使用api代替implemenationapi关键字将允许您在所有模块中使用依赖项

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

无法访问Android中的模块嵌套依赖项

无法访问子模块(不是 git 存储库)

使用硒Java 3.11库编译代码时出现“错误:无法访问可杀死对象”

使用 cabal 安装库时无法解析依赖项

无法访问或使用Node的fs模块

使用Mix编译Phoenix应用程序的Ejabberd依赖项时出错:无法编译依赖项:ejabberd,“ mix compile”失败

使用ClientsModule.registerAsync()时,无法访问从共享模块提供的模块导出的服务

Webpack / Vue.js:在编译时使用 ESM 依赖项生成模块代码

当“实现”用于库的库依赖项时,ClassNotFoundException

当使用'api'添加库依赖时,是否不提供对在Gradle中使用'实现'声明的库的访问?

使用无法访问类实现的外部“插件”库中的C ++类引用

使用 | 时无法访问属性

无法访问“ kotlin.String”的超类型的“ java.io.Serializable”。检查模块类路径是否缺少或冲突的依赖项

编译后的子指令附加到父项,但是无法访问父项作用域?

Dune:构建库并在另一个项目中访问它并隐藏或使无法访问的私有或实现模块

运行mvn依赖项时,Maven无法识别兄弟模块:

使用JDBC模板无法访问数据库时出现SQLNonTransientConnectionException

使用适用于 Python 的 BigQuery API 客户端库时无法访问网络

如何强制intelliJ使用分类器将Maven依赖项导入为“ Maven库”而不是“ Intellij模块”

无法编译依赖项:jiffy

无法访问Go库

无法访问 Java 库

Xcode / Cocoapods:我无法访问与项目链接的框架中的依赖项

无法访问源生成器文件中的项目范围的依赖项

get无法访问EntityBean错误,其中删除了javaEbean依赖项

跨模块共享编译依赖项

Maven多模块依赖项编译问题

使用Gradle编译时出错(找不到下载的依赖项)

使用“ GPR”依赖项进行编译时出错