We are working on a flutter project. We have been able to run on ios without issue but when we try on android, we end up with the error shown at the end.
- We've tried deleting the entire project (running with an empty app) and deleting the google_maps_flutter and address_search_field dependencies and we were able to run it. However, when trying to add either of them back breaks the project.
- We tried deleting pubspec.yaml and then pub get.
- We tried reinstalling flutter on another computer and still end up with the error.
- We tried flutter clean.
- We removed all unused imports.
- We updated our dependencies and Dart SDK.
Here is our build.gradle dependencies
dependencies {
classpath 'com.android.tools.build:gradle:4.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.4'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
}
And our pubsec.yaml
dependencies:
flutter_secure_storage: ^5.0.2
firebase_analytics: ^9.0.4
firebase_core: ^1.10.6
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
cloud_firestore: ^3.1.5
firebase_auth: ^3.3.4
address_search_field: ^4.0.1
google_maps_flutter: ^2.1.1
flutter_google_places: ^0.3.0
url_launcher: ^6.0.18
flutter_email_sender: ^5.0.2
qr_flutter: ^4.0.0
qr_code_scanner: ^0.6.1
maps_launcher: ^2.0.1
flutter_stripe: ^2.1.1
firebase_database: ^9.0.6
upgrader: ^3.12.1
flutter_credit_card: ^3.0.1
http: ^0.13.4
geolocator: ^8.1.1
geocoding: ^2.0.2
firebase_crashlytics: ^2.5.1
firebase_performance: ^0.8.0+5
cloud_functions: ^3.2.7
firebase_messaging: ^11.2.6
Can anyone perhaps give a command that will give a more detailed error output or provide a helpful solution to make it function. Again, it is only failing on android, so we believe its an android specific issue.
flutter run -v
FAILURE: Build failed with an exception.
Execution failed for task ':app:compileFlutterBuildDebug'.
java.lang.NullPointerException (no error message)
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.
Running Gradle task 'assembleDebug'... (completed in 6.9s)
Exception: Gradle task assembleDebug failed with exit code 1
"flutter run" took 30,445ms.
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:687:9)
#2 FlutterCommand.run.anonymous closure (package:flutter_tools/src/runner/flutter_command.dart:1161:27)
#3 AppContext.run.anonymous closure (package:flutter_tools/src/base/context.dart:150:19)
#4 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
#5 FlutterCommandRunner.runCommand.anonymous closure (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
#6 AppContext.run.anonymous closure (package:flutter_tools/src/base/context.dart:150:19)
#7 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
#8 run.anonymous closure (package:flutter_tools/runner.dart:62:9)
#9 AppContext.run.anonymous closure (package:flutter_tools/src/base/context.dart:150:19)
#10 main (package:flutter_tools/executable.dart:94:3)