4

I have downloaded a reminder flutter project and opened it in android studio and made the changes required to run it but there is an error cant solve in app/gradle.build i have upgraded flutter to the latest version and so as android studio

the gradle.build file that has an error

 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 from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { compileSdkVersion 27 lintOptions { disable 'InvalidPackage' } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "me.tuannguyen.fluttertodo" minSdkVersion 16 targetSdkVersion 27 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } 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.debug } } } flutter { source '../..' } 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-analytics:17.2.0' implementation 'com.google.firebase:firebase-auth:19.2.0' implementation 'com.google.firebase:firebase-firestore:21.3.0' } 

the error here i think

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

and the error that shows to me

Launching lib\main.dart on Redmi Note 7 in debug mode... Initializing gradle... Resolving dependencies... * Error running Gradle: ProcessException: Process "C:\Users\user1\AndroidStudioProjects\tuannguyendotme-flutter_todo- 6261e20\android\gradlew.bat" exited abnormally: FAILURE: Build failed with an exception. * Where: Build file 'C:\Users\user1\AndroidStudioProjects\tuannguyendotme-flutter_todo- 6261e20\android\app\build.gradle' line: 23 * What went wrong: A problem occurred evaluating project ':app'. > ASCII * 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 1s Command: C:\Users\user1\AndroidStudioProjects\tuannguyendotme-flutter_todo- 6261e20\android\gradlew.bat app:properties Finished with error: Please review your Gradle project setup in the android/ folder. 

Gradle.build

buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.2.0' } } 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 } 

gradle-wrapper.properties

 #Wed Sep 26 21:25:02 ICT 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip 
7
  • Add your gradle.properties file here. Commented Nov 26, 2019 at 23:39
  • 1
    Did you make changes there? Because seems like some configuration is missing there. Commented Nov 26, 2019 at 23:40
  • @GensaGames didnt change or add anything there Commented Nov 26, 2019 at 23:57
  • @GensaGames there is just this line org.gradle.jvmargs=-Xmx1536M Commented Nov 27, 2019 at 0:04
  • your config file under gradle/wrapper folders name might be next gradle-wrapper.properties Commented Nov 27, 2019 at 2:04

1 Answer 1

1

You have issue with your language and navigation to the source/project files. I think building scripts just cannot load all the resources.

* Where: Build file 'C:\Users\user1\AndroidStudioProjects\tuannguyendotme-flutter_todo- 6261e20\android\app\build.gradle' line: 23 * What went wrong: A problem occurred evaluating project ':app'. > ASCII 

Start your investigation with the next line. As you can see 6261e20 should be some name, but omitted because of decoding.

Build file 'C:\Users\user1\AndroidStudioProjects\tuannguyendotme-flutter_todo- 6261e20\android\app\build.gradle' line: 23 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.