Gowsik Raja
Gowsik Raja

Reputation: 732

Unable to add dependencies in Android Studio for Flutter project

Actually i'm going to make run time permission for my Flutter project only for android section. So that I have done following procedure.

Added permission in AndroidManifest.xml

Added the android.support dependencies in build.gradle

dependencies {
compile 'com.android.support:support-v4:27.1.1'

testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'}'

Manually Import the package in MainActivity

enter image description here

Still the error is showing.

Note : after add the dependencies is not show any alert to sync the gradle file. i don't know to manually sync the gradle file while doing flutter project.

Upvotes: 3

Views: 2286

Answers (1)

Phuc Tran
Phuc Tran

Reputation: 8073

  • Open your cmd or terminal (Or using built-in Terminal in Android Studio).

  • Use cd command to navigate to your android folder.

Then run the command:

./gradlew build

Upvotes: 1

Related Questions