Skip to main content

Create Flutter Project after Android Studio Ladybug

· 2 min read
  1. Open Visual Studio Code then open command palette.

alt

  1. Type flutter then choose Flutter new project.

alt

  1. Choose empty application.

alt

  1. Choose directory to save project.

alt

  1. Set project name.

alt

  1. Flutter project is ready.

alt

  1. Check java version

alt

  1. Check compatibility java version to run gradle here
Java versionSupport for toolchainsSupport for running Gradle
218.48.5
  1. Update gradle version in gradle wrapper.
android/gradle/wrapper/gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
# distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
  1. Choose match gradle plugin version here
Plugin versionMinimum required Gradle version
8.38.4
android/settings.gradle
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
// id "com.android.application" version "7.3.0" apply false
id "com.android.application" version "8.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
}
  1. Add some JavaCompile code.
android/build.gradle
allprojects {
repositories {
google()
mavenCentral()
}
tasks.withType(JavaCompile) {
options.compilerArgs << '-Xlint:-options'
}
}
  1. Edit NDK version for compatibility version. You can use this version or follow suggestion from console when running app.
android/app/build.gradle
android {
namespace = "com.example.flutter_application_3"
compileSdk = flutter.compileSdkVersion
// ndkVersion = flutter.ndkVersion
ndkVersion = "25.1.8937393"

...
}
  1. Run.

alt