【问题标题】:Android Library release configurationAndroid 库发布配置
【发布时间】:2021-01-25 01:51:53
【问题描述】:

我正在尝试在 Android Flutter 插件中包含 FolioReader-Android 库。它适用于调试 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

感谢您一直到这里...:)

【问题讨论】:

  • 嗨 rupa,我在做同样的工作,但我的颤振库没有构建它,给出了这个错误,知道该怎么做吗?评估项目“:epub_viewer”时出现问题。 > 在项目 ':epub_viewer' 中找不到路径为 ':folioreader' 的项目。 implementation project(path: ':folioreader') 在 build.gradle 和 setting.gradle 中可用: rootProject.name = 'epub_viewer' include ':folioreader' 我真的有货,不知道该怎么办 :(

标签: android gradle build.gradle flutter-plugin


【解决方案1】:

你需要如下配置应用级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
    }
}

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2013-10-18
  • 1970-01-01
  • 2017-11-06
  • 1970-01-01
  • 2010-12-04
  • 1970-01-01
  • 2015-09-18
  • 1970-01-01
相关资源
最近更新 更多