Flutter run don't finish - android

In a new flutter project, I run flutter doctor command and it says everything is okay. When I try to run my app it doesn't finish or error out. It just says running. What should I do.

if everything is right with flutter doctor command, your app is probably initializing gradle which took some time before the app is properly running.
Run flutter run -v and you will see output telling you that the app is initializing gradle
This is how it looks in the Run window:
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
give it sometime to download gradle and it will run normally, of course this won't be an issue for future runs but always run flutter with the -v option

Related

Stuck in Building Flutter App in my device

Since the system update of my Vivo y20i device, I am having trouble installing my flutter app. When I run (Ctrl+F5) my app it get stuck in Running Gradle task 'assembleDebug'... sometimes it is stuck in Installing build/app/outputs/apk/app.apk. My developer option is turned on and also the USB Debugging, I tried every solutions that I found here in stackoverflow and other websites:
I run the ./gradlew clean and ./gradlew build and also tried ./gradlew clean build
Uninstall the app in my device then flutter clean. I always do the flutter clean
I uninstall everything, Android Studio and VSCode, and I upgrade my Flutter SDK to 2.5.0, and also did this.
but I am still facing the same problem. When I try flutter run -v, it works but then I can't update my app or do any changes in the app. Please help.
Here is my flutter doctor -v
Sometimes the problem can be with ADB Server.
Run this:
adb kill-server
Connect your device again and it should work.
Also
Settings>>Accounts and sync>>Delete Work Profile or any User Profile created on your phone.

Flutter run from terminal works while manually not

When I run flutter build apk --release everything works just fine, In addition when I connect my phone to the computer and run flutter install -v everything is ok. Also when I run flutter run -v my app is working on my phone just fine.
BUT when I'm sending the apk manually to my phone, install and open my app, it's stuck on the splash screen.
I don't know what can case it not to work manually (since I cannot track my logs).
I'm using firebase, my google-services.json is up to date.
flutter doctor is just fine.
android SDK version 30.0.2.
app/build.gradle compileSdkVersion 30.
gradle version 6.6.1.
classpath 'com.google.gms:google-services:4.3.5'
classpath 'com.android.tools.build:gradle:4.0.2'
Any suggestions how to validate my application? What can case such a problem?
Thanks you!!!
More Information
The only error on flutter run is:
Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.name.name signatures do not match previously installed version; ignoring!]
but as I said before the flutter run do works and my app uploads correctly, so I think it is not related to my problem.
Have You implemented release SHA keys ?
After many tests using flutter run -v I encountered that in some cases I'm getting:
Unhandled exception: MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences)
I do work with shared_preferences package and that answer sure solve my problem https://stackoverflow.com/a/63027655/12695188
Although this is a specific solution I will describe what I have done in order to find my problem:
flutter pub get
flutter build apk --debug
flutter build apk --profile
flutter build apk --release
connect your physical device to your computer
flutter install -v (to your physical device)
flutter run -v
Solve each problem you find on flutter run -v.
Hope this will help someone out there.

This is the output I get when running my dart code in flutter project in Android Studio

As I run my code on Android studio, and I want to see my code output in an emulator but while running an emulator it shows error system UI is not responding.
this error is provided because you have not accepted all the android SDK agrement, try to run this on terminal flutter doctor --android-licenses

How to build flutter app on Android device?

I just developing Application on Flutter framework.
Now, I just faced some problem, I think that it depends on the Gradle crash.
it doesn't work......till now
So, I attached the error message's image file.
this message came from the command(flutter run -v)
the result of 'flutter doctor --verbose
So, How can I build this thing???
run flutter doctor -v and do all the requisite steps.

React native bundlle js stuck

When I run react-native run-android --variant=Release or any other variant I defined in build.gradle I got stuck on Building 91% > :app:bundleReleaseJsAndAssets. If I run just debug it works fine. It happens as well when running ./gradlew assambleRelease.
When I manually run Build apk from Android Studio, then it successfully creates the apks.
EDIT: When I run apk generated from Android Studio, the app crashes on run. I expect this is due AppRegistry.registerComponent fails when you usually run the app trough studio not trough react-native cli
Usually it takes time in first round. Just try again and in my case it took around 10 mins to build the release.

Categories

Resources