2

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...:)

Rupa
  • 76
  • 6
  • hi rupa, im doing the same job but my flutter library is not building it giving this error , any idea what to do? A problem occurred evaluating project ':epub_viewer'. > Project with path ':folioreader' could not be found in project ':epub_viewer'. implementation project(path: ':folioreader') is available in build.gradle and in setting.gradle this lines are added: rootProject.name = 'epub_viewer' include ':folioreader' im really stocked and dont know what to do :( – aida Aug 29 '21 at 08:44

1 Answers1

0

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
    }
}
rahat
  • 1,840
  • 11
  • 24
  • Thanks for the help :) but I am still seeing the same error message Build.Gradle files - FolioReader (Library) : https://paste.ubuntu.com/p/WW8fQgHqSY/ - Plugin : https://paste.ubuntu.com/p/XCtwDV4vkN/ – Rupa Jan 25 '21 at 15:29