1
* Error running Gradle:
ProcessException: Process "C:\Users\aarav\AndroidStudioProjects\flutter_firestoreapp\android\gradlew.bat" exited abnormally:

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 find com.android.support:appcompat-v4:27.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v4/27/appcompat-v4-27.pom
       - https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v4/27/appcompat-v4-27.jar
       - https://jcenter.bintray.com/com/android/support/appcompat-v4/27/appcompat-v4-27.pom
       - https://jcenter.bintray.com/com/android/support/appcompat-v4/27/appcompat-v4-27.jar
     Required by:
         project :

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 6s
  Command: C:\Users\aarav\AndroidStudioProjects\flutter_firestoreapp\android\gradlew.bat app:properties

Finished with error: Please review your Gradle project setup in the android/ folder.

I tried offline gradles of all versions.

App-gradle :

    dependencies {
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.google.firebase:firebase-firestore:17.1.1'

}

apply plugin: 'com.google.gms.google-services'

Project-gradle :

    buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.0.1'
        classpath 'com.android.support:appcompat-v4:27'
        classpath 'com.android.tools.build:gradle:3.3.1'
    }
}

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
}
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
aravind
  • 11
  • 2
  • Similar to https://stackoverflow.com/questions/54603897/flutter-fail-to-run-app-on-device-import-androidx-annotation-nullable/54605272#54605272 – Günter Zöchbauer Feb 09 '19 at 11:23

1 Answers1

0

Migrate to AndroidX (see also Flutter fail to run app on device import androidx.annotation.Nullable) and use the latest plugin versions,
or ensure that you use plugin versions that don't yet depend on AndroidX.

This issue contains more details https://github.com/flutter/flutter/issues/27128

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567