Open mg7237 opened 4 years ago
After updating minSDK to 19. Now the app compiles however it is giving run time error which trying to run on Android simulator. Below if the error log.
Running "flutter pub get" in flutter_app_example...
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
✓ Built build/app/outputs/flutter-apk/app-debug.apk.
Waiting for Android SDK built for x86 to report its views...
Debug service listening on ws://127.0.0.1:50073/x5PM3IpmBSA=/ws
Syncing files to device Android SDK built for x86...
E/flutter (16700): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: ServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized.
E/flutter (16700): If you're running an application and need to access the binary messenger before runApp()
has been called (for example, during plugin initialization), then you need to explicitly call the WidgetsFlutterBinding.ensureInitialized()
first.
E/flutter (16700): If you're running a test, you can call the TestWidgetsFlutterBinding.ensureInitialized()
as the first line in your test's main()
method to initialize the binding.
E/flutter (16700): #0 defaultBinaryMessenger.
Issues: exmple code provided on the pub dev site is not getting compiled. Details below:
Steps to Reproduce
Logs
Running Gradle task 'assembleDebug'... /Users/manishgupta/AndroidStudioProjects/flutter_app_example/android/app/src/debug/AndroidManifest.xml Error: uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:flutter_pdf_viewer] /Users/manishgupta/AndroidStudioProjects/flutter_app_example/build/flutter_pdf_viewer/intermediates/library_manifest/debug/AndroidManifest.xml as the library might be using APIs not available in 16 Suggestion: use a compatible library with a minSdk of at most 16, or increase this project's minSdk version to at least 19, or use tools:overrideLibrary="com.pycampers.flutterpdfviewer" to force usage (may lead to runtime failures)
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:processDebugManifest'.
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 39s Exception: Gradle task assembleDebug failed with exit code 1
Flutter doctor:
Flutter (Channel master, 1.24.0-4.0.pre.82, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-IN) • Flutter version 1.24.0-4.0.pre.82 at /Users/manishgupta/StudioProjects/flutter • Framework revision e5814756a2 (3 hours ago), 2020-10-27 01:47:03 -0700 • Engine revision 1857470267 • Dart version 2.11.0 (build 2.11.0-260.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at /Users/manishgupta/Library/Android/sdk • Platform android-29, build-tools 29.0.2 • Java binary at: /Applications/Dev Tools/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.7) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 11.7, Build version 11E801a • CocoaPods version 1.9.1
[✓] Android Studio (version 4.1) • Android Studio at /Applications/Dev Tools/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] Connected device (1 available) • Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
• No issues found!