A problem has suddenly recently arisen such that simply by including the dependency in \'location\' in pubspec.yaml like e.g.
dependencies:
flutter:
I was facing the same issue. What I did was insert the line multiDexEnabled true
in my build.gradle
of app. Like this:
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true //Insert this line
}
Try this and run the commands flutter clean
, flutter build apk
and flutter run
. It must solve your problem.