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

3,993

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
Share:
3,993
Moo
Author by

Moo

Updated on December 28, 2022

Comments

  • Moo
    Moo over 1 year

    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'.

    • 'Uri' is from 'dart:core'. return httpClient.get(url, headers: headers); ^ ../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/google_maps_webservice-0.0.19/lib/src/utils.dart:74:28: Error: The argument type 'String' can't be assigned to the parameter type 'Uri'.
    • 'Uri' is from 'dart:core'. return httpClient.post(url, body: body, headers: postHeaders); ^ 3

    FAILURE: Build failed with an exception.

    • Where: Script '/Users/michael/Documents/Developer/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 991

    • What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.

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

    • 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 33s Exception: Gradle task assembleDebug failed with exit code 1

  • Moo
    Moo about 3 years
    Thank you very much! After inserting the dependency google_maps_webservice: ^0.0.20-nullsafety.2 and update the compileSdkVersion to 30 I just had to insert "Firebase.initializeApp()" in my main.dart and the android-emulator startet correctly. But I have problem with iOS simulator... 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 4112 pos 12: '!_debugLocked': is not true. Any idea?