binSaed / flutter_cached_pdfview

Enhanced PDF view for Flutter.
https://pub.dev/packages/flutter_cached_pdfview
MIT License
117 stars 67 forks source link

Error while running assembleDebug #79

Closed rushikeshnarwade closed 2 years ago

rushikeshnarwade commented 2 years ago

Describe the bug When I am trying to run my app on any device it's showing the following error `Execution failed for task ':app:checkDebugAarMetadata'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find com.github.barteksc:android-pdf-viewer:3.2.0-beta.1. Searched in the following locations:

This problem solves This problem solves after adding jcenter() in allprojects->repositories in build.gradle in android folder But I don't understand why this error occures at all

premy commented 2 years ago

Same problem here

OsamaNasserDev commented 2 years ago

same problem

devfalah commented 2 years ago

Describe the bug When I am trying to run my app on any device it's showing the following error `Execution failed for task ':app:checkDebugAarMetadata'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find com.github.barteksc:android-pdf-viewer:3.2.0-beta.1. Searched in the following locations:

This problem solves This problem solves when I add jCenter() in build.gradle in android folder But I don't understand why this error occures at all

It worked for me after updating compiledsdkversion 31 add android.enableR8=true in gradle.properties changed

dependencies {
       classpath 'com.android.tools.build:gradle:4.1.0'
       classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
   }

in build.gradle

It is mentioned in pub.dev page that lib uses AndroidPdfViewer and there you can find information which says: "Library is available in jcenter repository, probably it'll be in Maven Central soon.". To fix this problem just add

allprojects {
    repositories {
        google()
        mavenCentral()
        jcenter()  //add this 
    }
}

to your android/build.gradle file. Worked in my case.

rushikeshnarwade commented 2 years ago

Yes this problem solves after adding jcenter(). Thank you @devfalah for your explanation.