Error in building flutter app

907 views
Skip to first unread message

Pradeep Kumar Reddy Kondreddy

unread,
Jun 12, 2020, 5:56:21 AM6/12/20
to Flutter Development (flutter-dev)
Build is failing with following error. Can somebody help me in resolving this issue.
Could not resolve all artifacts for configuration ':admob_flutter:classpath'.
   > Could not resolve org.checkerframework:checker-qual:2.5.2.
     Required by:
         project :admob_flutter > com.android.tools.build:gradle:3.3.0 > com.android.tools.analytics-library:shared:26.3.0 > com.google.guava:guava:26.0-jre

Suzuki Tomohiro

unread,
Jun 12, 2020, 6:50:16 AM6/12/20
to Pradeep Kumar Reddy Kondreddy, Flutter Development (flutter-dev)
What did you do before getting this error?

--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/7ba1f67d-284b-41c6-aedf-88f56a0bb2d7o%40googlegroups.com.

Pradeep Kumar Reddy

unread,
Jun 12, 2020, 7:27:25 AM6/12/20
to Suzuki Tomohiro, Flutter Development (flutter-dev)
$'flutter build appbundle' command is throwing that error.

Suzuki Tomohiro

unread,
Jun 12, 2020, 7:30:50 AM6/12/20
to Pradeep Kumar Reddy, Flutter Development (flutter-dev)
Good. Any change since the last time the command worked fine?

Pradeep Kumar Reddy

unread,
Jun 12, 2020, 8:29:31 AM6/12/20
to Suzuki Tomohiro, Flutter Development (flutter-dev)
No, I never tried that command earlier when I was developing the app. I used to run the app from the android studio run button. As part of app release preparations, i have added KeyStore properties and signingConfigs in app/build.gradle file, changed compileSDKVersion and targetSDK version to 29. Updated gradle build tools to 4.0.0.

Here is my app/build.gradle file
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('keystore.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
compileSdkVersion 29
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
applicationId "com.xxxx.xxxx"
minSdkVersion 16
targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.release
}
}
}

flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

and this my android/build.gradle file
------------------------------------------------------
buildscript {
ext.kotlin_version = '1.3.72'
repositories {
google()
jcenter()
maven {
url 'https://dl.google.com/dl/android/maven2'
}
}

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

allprojects {
repositories {
google()
jcenter()
}
}

rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
delete rootProject.buildDir
}

Suzuki Tomohiro

unread,
Jun 12, 2020, 8:38:45 AM6/12/20
to Pradeep Kumar Reddy, Flutter Development (flutter-dev)
I see your build cannot resolve artifact org.checkerframework:checker-qual:2.5.2. Which repository (google() or jcenter()) do you think provides the artifact?

Pradeep Kumar Reddy

unread,
Jun 12, 2020, 8:49:42 AM6/12/20
to Suzuki Tomohiro, Flutter Development (flutter-dev)
From the below error messages, I can see that it is from jcenter().

[Fatal Error] checker-qual-2.5.2.pom:2:1: Content is not allowed in prolog.

FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.

   > Could not resolve org.checkerframework:checker-qual:2.5.2.
     Required by:
         project : > com.android.tools.build:gradle:3.5.0 > com.android.tools.analytics-library:crash:26.5.0 > com.google.guava:guava:27.0.1-jre

      > Could not resolve org.checkerframework:checker-qual:2.5.2.
         > Could not parse POM https://jcenter.bintray.com/org/checkerframework/checker-qual/2.5.2/checker-qual-2.5.2.pom
            > Content is not allowed in prolog.
   > Could not resolve org.glassfish.jaxb:jaxb-runtime:2.2.11.
     Required by:
         project : > com.android.tools.build:gradle:3.5.0 > com.android.tools.build:builder:3.5.0 > com.android.tools:sdklib:26.5.0 > com.android.tools:repository:26.5.0
      > Could not resolve org.glassfish.jaxb:jaxb-runtime:2.2.11.
         > Could not parse POM https://jcenter.bintray.com/org/glassfish/jaxb/jaxb-runtime/2.2.11/jaxb-runtime-2.2.11.pom
            > Could not resolve com.sun.xml.bind.mvn:jaxb-runtime-parent:2.2.11.
               > Could not resolve com.sun.xml.bind.mvn:jaxb-runtime-parent:2.2.11.
                  > Could not parse POM https://jcenter.bintray.com/com/sun/xml/bind/mvn/jaxb-runtime-parent/2.2.11/jaxb-runtime-parent-2.2.11.pom
                     > Could not resolve com.sun.xml.bind.mvn:jaxb-parent:2.2.11.
                        > Could not resolve com.sun.xml.bind.mvn:jaxb-parent:2.2.11.
                           > Could not parse POM https://jcenter.bintray.com/com/sun/xml/bind/mvn/jaxb-parent/2.2.11/jaxb-parent-2.2.11.pom
                              > Resetting to invalid mark

Pradeep Kumar Reddy

unread,
Jun 12, 2020, 8:53:21 AM6/12/20
to Suzuki Tomohiro, Flutter Development (flutter-dev)
Major change that i did is, i updated my gradle version from 4.10.1 to 6.5

Suzuki Tomohiro

unread,
Jun 12, 2020, 11:19:11 AM6/12/20
to Pradeep Kumar Reddy, Flutter Development (flutter-dev)
Do you want to share all command line output?

Assuming you use Mac or Linux, can you run this command?

I don’t know Windows.

Pradeep Kumar Reddy

unread,
Jun 12, 2020, 1:29:40 PM6/12/20
to Suzuki Tomohiro, Flutter Development (flutter-dev)
Attached the curl command output.
curl-output.txt

Suzuki Tomohiro

unread,
Jun 12, 2020, 3:09:53 PM6/12/20
to Pradeep Kumar Reddy, Flutter Development (flutter-dev)
I don’t see any problem. Strange. Do you want to share minimum reproducible project?

Pradeep Kumar Reddy

unread,
Jun 13, 2020, 12:10:14 AM6/13/20
to Suzuki Tomohiro, Flutter Development (flutter-dev)
I'm getting this error after i upgraded my android studio to version 4.0.0 and also upgraded my gradle version to 6.5.   
I'm getting a plugin error also Plugin Error: Plugin "Flutter i18n" is incompatible (target build range is 192.0 to 192.*).

  Do you know how to downgrade the gradle version used by android studio ??  

Pradeep Kumar Reddy Kondreddy

unread,
Jun 15, 2020, 5:46:37 AM6/15/20
to Flutter Development (flutter-dev)

Suzuki Tomohiro

unread,
Jun 15, 2020, 7:45:28 AM6/15/20
to Pradeep Kumar Reddy Kondreddy, Flutter Development (flutter-dev)
Great. Thank you for update.

--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages