Moo
Moo

Reputation: 725

flutter run for android failed - flutter.gradle' line: 991 - finished with non-zero exit value 1

After flutter upgrade flutter to newest stable version I can't debug in android simulator. I get the following error:

Launching lib/main.dart on sdk gphone x86 in debug mode...

lib/main.dart:1 ../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/google_maps_webservice-0.0.19/lib/src/utils.dart:61:27: Error: The argument type 'String' can't be assigned to the parameter type 'Uri'.

FAILURE: Build failed with an exception.

Process 'command '/Users/michael/Documents/Developer/flutter/bin/flutter'' finished with non-zero exit value 1

BUILD FAILED in 33s Exception: Gradle task assembleDebug failed with exit code 1

Upvotes: 1

Views: 4476

Answers (2)

Arinzehills
Arinzehills

Reputation: 2329

i had the same issue, but after i move the folders to android studio projects folder it worked fine

Upvotes: 0

Peter Zosiak
Peter Zosiak

Reputation: 318

Author of google_maps_webservice plugin (https://pub.dev/packages/google_maps_webservice) does not release flutter 2.0.2 compatible version yet. You can switch to 0.0.20-nullsafety.2 version (https://pub.dev/packages/google_maps_webservice/versions/0.0.20-nullsafety.2)

add explicitly

google_maps_webservice: ^0.0.20-nullsafety.2

to dependencies in pubspec.yaml

Update the compileSdkVersion to 30 in my app/build.gradle

do not forget run:

flutter clean
flutter pub get

Upvotes: 4

Related Questions