Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
650 views
in Technique[技术] by (71.8m points)

gradle - Android Library release configuration

I am trying to include FolioReader-Android library in Android Flutter plugin. It works well for for debug APKs, but when I try to build release 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)

Now if I try to change my implementation configuration i.e

from implementation project(path: ':folioreader') this

to implementation project(path: ':folioreader', configuration: 'default')

I start getting the following errors in the library itself

 error: cannot access Locator
                       ReadLocator readLocator = ReadLocator.fromJson(location);
                                                            ^
  class file for org.readium.r2.shared.Locator not found

Github Repo : https://github.com/JideGuru/Folioreader-Android

Thanks for bearing till here...:)

question from:https://stackoverflow.com/questions/65877979/android-library-release-configuration

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You need to configure the app level Gradle as follows

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
    }
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...