[Solved] Flutter Error : Could not resolve all artifacts for configuration ':image_picker_android:debugUnitTestRuntimeClasspath'

Android Mohit Mozumder

Problem:

Recently I am working on an application & I can debug it in emulator and mobile phones nicely. But when I try to build an apk it shows the following error:

Could not resolve all artifacts for configuration ':image_picker_android:
debugUnitTestRuntimeClasspath'
. Failed to transform bcprov-jdk15on-1.68.
jar (org.bouncycastle:bcprov-jdk15on:1.68) to match attributes


Solution 1:

To solve the problem follow the below instruction:

First Go to  app then build.gradle


After that Scroll down to "android" and paste this code carefully

lintOptions {
            disable 'InvalidPackage'
            disable "Instantiatable"
            checkReleaseBuilds false
            abortOnError false
        }


Now run "flutter clean" 4:run "flutter pub get" 5:If you want to build apk of your project then run "flutter build apk"


Solution 2:

You also can try this solution. Just Add these lines in pubspec.yaml

dependency_overrides:
image_picker_android: 0.8.4+13

Thank you for reading the article. If you face any further problem feel free to ask us.