I can't run app on emulator/ real device.when i try to run app from vscode. it shows this error message. screenshot of debug console
i uninstall app and flutter clean.
UPDATE:
This error just happened to me when I launched the app in the store. I'm correcting it now, change the Location library to Gelocator.
At first I thought it was an error in Flutter 3.7.0, I lowered the version to 3.3.10 and 3.3.9 and the same problem continued. My solution was to change the location library to geolocator. It has almost the same functions, I only had to make a few changes.
https://pub.dev/packages/geolocator
No need to change the package I was also facing this issue I just fixed it:
Go into C:\Users\Qc\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\location-4.4.0\android\build.gradle :
changed "com.google.android.gms:play-services-location:16.+" to "com.google.android.gms:play-services-location:21.0.1" works
dependencies {
api '"com.google.android.gms:play-services-location:21.0.1'
implementation "androidx.core:core-ktx:1.3.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
List item In project at android level go into build.gradle and add this line:
in my case, got to C:\Users\Md Emarat Hossain\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\location-4.4.0\android\build.gradle and changed "com.google.android.gms:play-services-location:16.+" to "com.google.android.gms:play-services-location:21.0.1" works
I changed from "com.google.android.gms:play-services-location:16.+" to "com.google.android.gms:play-services-location:21.0.1" in my project this PATH
"C:\Users\chint\flutter.pub-cache\hosted\pub.dartlang.org\geolocator_android-4.1.7\android\build.gradle"
I'm trying to sync build.gradle for a flutter app in android studio but it gave this error
this error comes after I tried solving "ssl peer shut down incorrectly" error using the first answer in this question .
I followed all three steps of that solution but without adding the certificates and then I reconverted the steps but I remained with the same error.
Then I was trying to upgrade the gradle but it was interuppted and then the above error occured.
well this error occurs to me when I try to make my app in production.
The app is created with flutter and I was able to create the apk for android, but when I try to do it for ios it won't let me.
The file that I am opening is Runner.xcworkspace and the problem is the import of a flutter library, it seems to me that I have to make some kind of connection with the pods.
here is the error, I want to tell you that I do not want to run the app, but to make an installer
The error that occurs when building a release (ie. flutter build ipa) and not when running a debug build is:
/[REDACTED]/ios/Runner/GeneratedPluginRegistrant.m:48:9: fatal error: module
'flutter_secure_storage' not found
#import flutter_secure_storage;
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
For me regenerating Podfile in the following way solved the issue:
rm ios/Podfile && flutter build ios
See Closed [ios][release] GeneratedPluginRegistrant.m Module not found
#43986
I upgraded Flutter to 2.0.0 recently and am stuck with this issue. flutter run and flutter run --profile work perfectly well, but flutter run --release makes app crash after startup. There is no stacktrace, there is no error or warning, there is no build issue or verbose warning, no hint really. I googled a lot, but similar questions were answered like "try to remove this line" or "try to add that line". I couldn't find any clear steps on how to debug what's wrong.
What steps should I take to debug this issue and find the root cause instead of trying meaningless changes on code hoping some of them will eventually fix the issue?
Use adb logcat
OR
Enable debugging in release build, by modifying your android/app/build.gradle
like this
buildTypes {
release {
debuggable true
shrinkResources false
minifyEnabled false
...
}
}
When the error is code related and not in flutter itself sentry should help.
Sentry's Flutter SDK enables automatic reporting of errors, messages,
and exceptions.
You can import it just as any other package
dependencies:
sentry_flutter: ^4.0.6
and configure it as early as possible in you app
import 'package:flutter/widgets.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
Future<void> main() async {
await SentryFlutter.init(
(options) => options.dsn = 'put_your_public_key_here',
appRunner: () => runApp(MyApp()),
);
}
To get your public key you just have to sign up on sentry.io and create a flutter project, no need to search for your key your it should be in the example code, it wont let you pass that point without initialiting it so you can't miss it.
The docs regarding flutter can be found here.
You can Use Firebase Analytics to see error logs from your released devices from firebase. Previously it was named as Fabric.
Or you can create your own log tracker, write the logs in a file and upload the log to your server.
You can give options to user to capture log and send to server within "Advanced Settings" or something like that.
try this flutter run --release --no-shrink
Check if you have given correct permission to the app in AndroidManifest.xml, in my case I simply fixed this issue by giving camera permission
<uses-permission android:name="android.permission.CAMERA" />
before the tag
In my case, after two day of confusion because app crashes only in release mode without any error on console, and errors shown in adb logcat not clear (unknown errors), after that I switching Flutter channel from stable to master, after run release on master channel errors started shown as clear messages, I solved these errors then crashes problem solved.
So my steps is:
1- Switching Flutter channel to master by run this command in terminal:
flutter channel master
2- Run upgrade command in terminal:
flutter upgrade
3- Run app as release:
flutter run --release
4- Watch console to see errors...
It shows error 'An error occured while applying post-build logic: Object reference not set to an instance of an object' when it builds two-file android build: APK + OBB.
Playscape's ApkCreator try to extract config file 'assets/playscape/PlayscapeConfig.xml' from APK. But config is inside .OBB file.
How to fix it?
We're currently do not support APK expansion files (for applications that are bigger than 50MB). We expect to support this functionality in a future version. Can you contact me directly so can discuss your game specifically. sharonh#playscape.com
Thanks,
Sharon