android - Android 库发布配置
问题描述
我正在尝试FolioReader-Android
在 Android Flutter 插件中包含库。它适用于调试 APK,但是当我尝试构建发布 APK
Execution failed for task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':epub_viewer:profileRuntimeClasspath'.
> Could not resolve project :folioreader.
Required by:
project :epub_viewer
> Cannot choose between the following variants of project :folioreader:
- debugAndroidTestCompile
- debugAndroidTestRuntime
- debugRuntime
- debugUnitTestCompile
- debugUnitTestRuntime
- releaseRuntime
- releaseUnitTestCompile
- releaseUnitTestRuntime
All of them match the consumer attributes:
- Variant 'debugAndroidTestCompile' capability com.jideguru:folioreader:0.6.2:
- Unmatched attributes:
- Required com.android.build.api.attributes.BuildTypeAttr 'profile' but no value provided.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but no value provided.
- Required org.gradle.usage 'java-runtime' but no value provided.
- Found org.jetbrains.kotlin.localToProject 'local to :folioreader' but wasn't required.
- Found org.jetbrains.kotlin.platform.type 'androidJvm' but wasn't required
(Repeated for all variants)
现在,如果我尝试更改我的实现配置,即
从此implementation project(path: ':folioreader')
_
至implementation project(path: ':folioreader', configuration: 'default')
我开始在库本身中收到以下错误
error: cannot access Locator
ReadLocator readLocator = ReadLocator.fromJson(location);
^
class file for org.readium.r2.shared.Locator not found
Github 回购:https ://github.com/JideGuru/Folioreader-Android
感谢您一直坚持到这里... :)
解决方案
您需要按如下方式配置应用级别的 Gradle
android {
.....
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
}
推荐阅读
- mysql - 如何在搬运工中将两个 docker 容器相互连接
- html - 如何在html中具有多个连接的其他地方悬停文本时更改文本样式
- ios - 增加 UITableView 高度中的节索引标题等于 tableview 高度
- csv - 是否有可能将不同的 csv 文件匹配到一个配置单元表中?
- python - 用于压缩和下载包含图像的文件夹的 python 代码
- angular - 使用输入和输出将数据从组件传递到另一个组件
- javascript - 无法在 Axios 拦截器中获取 Vuex 存储
- python - Dicom 到 PNG 的转换 - 输出图像完全是黑色的
- python - 如何阻止代码在python中走得更远
- django - 我想将变量从基本模板(具有导航和页脚的 basic.html)传递给子模板(index.html)