flutter_pdfview crashing device after opening pdf - android

I wanted to use flutter_pdfview in an app. During debugging everything worked fine, but once i build the app in Release mode I clicked around in the App and opened some PDF and at some pont a PDF does not load, so i got back to the page before, and at this point the touchscreen of my device does not respond any longer. I tetsted it on two devices with the arm64 version, both devices do not respond any longer at some point. However when I open the App on an armeabi device everything is working fine.
The error is: (Unhandled Exception: PlatformException(error, Neither user 10350 nor current process has android.permission.WAKE_LOCK., null)
I am using flutter_pdfview version 1.0.2+2,
my flutter doctor -v is:
• Flutter version 1.19.0-2.0.pre.142 at C:\flutter\flutter
• Framework revision 721927efd3 (7 days ago), 2020-05-21 17:52:02 -0700
• Engine revision 9ce1e5c5c7
• Dart version 2.9.0 (build 2.9.0-10.0.dev 7706afbcf5)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\Jakob\AppData\Local\Android\sdk
• Platform android-29, build-tools 29.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.
[√] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 42.1.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[!] IntelliJ IDEA Community Edition (version 2019.3)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.3.4
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.dev/intellij-setup/#installing-the-plugins
[!] VS Code (version 1.45.1)
• VS Code at C:\Users\Jakob\AppData\Local\Programs\Microsoft VS Code
X Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[!] Connected device
! No devices available
! Doctor found issues in 3 categories.

After some time, I fixed it by adding <uses-permission android:name="android.permission.WAKE_LOCK" /> to AndroidManifest.xml

Related

Flutter - Error: Null safety features are disabled for this library

I have been working on a flutter project for a long time. Now I have set up my new laptop and after reinstalling the tools for VS Code(Flutter, Android Studio) I face the error mentioned in the title of this question.
Error: Null safety features are disabled for this library.
Try removing the package language version or setting the language version to 2.10 or higher.
As advised, I have set my flutter-sdk version to >= 2.10.0 but it is still not working.
To enable the NNBD I would have to enable experimental support but people advise against it until it is fully released. So what should I do to get my codebase working? Enable NNBD experimental support or is there any other solution?
Here is my flutter doctor:
[√] Flutter (Channel stable, 1.22.3, on Microsoft Windows [Version 10.0.19041.572], locale en-AT)
• Flutter version 1.22.3 at C:\flutter
• Framework revision 8874f21e79 (6 days ago), 2020-10-29 14:14:35 -0700
• Engine revision a1440ca392
• Dart version 2.10.3
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at C:\Users\xyz\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[!] Android Studio (version 4.1.0)
• Android Studio at C:\Program Files\Android\Android Studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[√] VS Code (version 1.50.1)
• VS Code at C:\Users\xyz\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.16.0
[√] Connected device (1 available)
• Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 8.0.0 (API 26) (emulator)
! Doctor found issues in 2 categories.
If needed, I will provide extra information/logs/files.
I resolved running flutter clean and flutter pub get again.

Flutter release apk crash on launch

I am having an issue testing a release build on my device. If I use the app using flutter run or flutter run --release, the app runs with no errors reported and I can use the app without issue. However, using the generated APK from flutter build apk, the app crashes immediately stating the app failed to launch.
I have followed everything from here https://flutter.dev/docs/deployment/android#building-the-app-for-release so that shouldn't be the issue.
How do I begin to debug this issue?
This is the output from Flutter Doctor -v
[✓] Flutter (Channel stable, 1.20.4, on Mac OS X 10.15.7 19H2, locale en-GB)
• Flutter version 1.20.4 at /Users/student/flutter
• Framework revision fba99f6cf9 (3 weeks ago), 2020-09-14 15:32:52 -0700
• Engine revision d1bc06f032
• Dart version 2.9.2
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/student/Library/Android/sdk
• Platform android-29, build-tools 29.0.3
• Java binary at: /Applications/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 12.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.0.1, Build version 12A7300
• CocoaPods version 1.9.1
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 49.0.2
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] VS Code (version 1.49.3)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.15.0
With release mode. You can debug what's going on with https://fbflipper.com. Just download Flipper tool, install and run it and watch the logs.
Anyway, you can consider my points about android crash:
Wrong arch: check architecture supported between apk and device
Check broken in native libraries or class not found: Some libraries broken reference in release with ProGuard
Manifest broken: Some thing kind of missing or incorrect in configuration of manifest file

Error while trying to build flutter project

I am facing problems with the build of my apps(the old ones are working but all my new projects are receiving this message)
i already tried rebooting my pc and reinstalling flutter, but this doesn't change the error, and i can't find the solution anywhere
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
'D:\projects\CalendarProject' is not recognized as an internal or external command,
operable program or batch file.
Exception: Gradle task assembleDebug failed with exit code 1
this projects\CalendarProject is a old project, but every project i try to build i receive this message pointing to D:\projects\CalendarProject
also my flutter doctor seems perfectly fine
[√] Flutter (Channel stable, 1.20.4, on Microsoft Windows [Version 10.0.18363.1082], locale en-US)
• Flutter version 1.20.4 at C:\src\flutter
• Framework revision fba99f6cf9 (4 days ago), 2020-09-14 15:32:52 -0700
• Engine revision d1bc06f032
• Dart version 2.9.2
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at D:\android\AndroidVirtual
• Platform android-29, build-tools 29.0.3
• ANDROID_SDK_ROOT = D:\android\AndroidVirtual
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[√] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 44.0.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[!] IntelliJ IDEA Community Edition (version 2019.1)
• IntelliJ at C:\Users\Joâo Pedro\IntelliJ IDEA Community Edition 2019.1.3
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.dev/intellij-setup/#installing-the-plugins
[√] VS Code (version 1.49.0)
• VS Code at C:\Users\Joâo Pedro\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.14.1
[√] Connected device (1 available)
• Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
I think it is a config in android folder that is generating this error, but can't imagine what could it be
Are you using flutter in android studio? if so, try opening the project in "vs code", there seems to be a problem with flutter in android studio...
Solved:
the folder that i was using to create projects was inside a folder called "D:\projects\CalendarProject(V3)" (exemple:D:\projects\CalendarProject(V3)\flutter_app)
, don't know is it is a android sdk or flutter bug, but apperently one of them thought CalendarProject(V3) was a function and was trying to run it. this explains the message
'D:\projects\CalendarProject' is not recognized as an internal or external command,
operable program or batch file.
Fixed by changing the directory
you can recreate the error with:
>>mkdir teste(v3)
>>cd "teste(v3)"
>>flutter create app
>>cd app
>>flutter build apk

My flutter app is getting stuck at "Installing build\app\outputs\apk\app.apk..." and then nothing happens

As i mentioned in the question,i cannot see anything in the console but Installing build\app\outputs\apk\app.apk... and i just cannot understand the reason because my app is working in the device. I can change the pages but the little informations that i want to see, the prints that i entered in the code are not visible and its very annoying.
Before asking here i have been looking the other questions about this problem but the answers in that questions did not worked for me so i end up asking this in here, i hope you can help me.
here is the console after i click the run button;
Launching lib\main.dart on LG H850 in debug mode...
Running Gradle task 'assembleDebug'...
√ Built build\app\outputs\apk\debug\app-debug.apk.
Installing build\app\outputs\apk\app.apk...
an here is the flutter doctor
[√] Flutter (Channel stable, v1.17.0, on Microsoft Windows [Version 10.0.18362.778], locale tr-TR)
• Flutter version 1.17.0 at C:\Users\Mahir Yakup Şahin\flutter
• Framework revision e6b34c2b5c (8 days ago), 2020-05-02 11:39:18 -0700
• Engine revision 540786dd51
• Dart version 2.8.1
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\src\Android
• Platform android-29, build-tools 29.0.2
• ANDROID_HOME = C:\src\Android
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
• All Android licenses accepted.
[√] Android Studio (version 3.6)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 45.1.1
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
[√] VS Code (version 1.45.0)
• VS Code at C:\Users\Mahir Yakup Şahin\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.10.1
[√] Connected device (1 available)
• LG H850 • LGH850b31f3def • android-arm64 • Android 8.0.0 (API 26)
• No issues found!
I will be very grateful for any kind of help.
And also i tried in the vscode as well, here is the result,
enter image description here
and sometimes i get an error like this;
enter image description here
Try "flutter clean", that helps in lot many cases..seems like yours is also one of those..
Also..make sure that you have enough storage space on your device (phone or emulator, whatever you re using)..the description on the second image seems like because of the storage issue.

flutter embedding - Upgrading Pre 1.12 Android Projects Breaks Plugins

While building my flutter project, I was forced to follow the instructions in this link https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects for my shared_preferences package to work.
I followed the instructions there. Now my plugins seem to not work. for example signing with google throws this error: error MissingPluginException(No implementation found for method init on channel plugins.flutter.io/google_sign_in)
Similar errors happen with almost all of my plugins.
here is my flutter doctor -v logs
• Flutter version 1.10.15-pre.404 at C:\src\flutter
• Framework revision 9093cf15f6 (2 hours ago), 2019-11-04 22:30:16 -0500
• Engine revision 7b968ff95f
• Dart version 2.7.0
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
• Android SDK at C:\Users\Ajmal Jalal\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.1
• Java binary at: C:\Program Files\Android\Android Studio1\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
X Android license status unknown.
Try re-installing or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit https://flutter.dev/setup/#android-setup for detailed instructions.
[√] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio1
• Flutter plugin version 41.0.2
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[√] VS Code (version 1.39.2)
• VS Code at C:\Users\Ajmal Jalal\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.5.1
[√] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)
! Doctor found issues in 1 category. ```
This question was answered here in flutter's github page, and the answer there resolved my issue:
https://github.com/flutter/flutter/issues/44161

Categories

Resources