How to build flutter app on Android device? - android

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.

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.

How to Build flutter Apk in mobile?

Excuse me guys, I'm sorry. I want to ask, can I install flutter on my Android Mobile ?? I tried to search on Google but the results failed, from trying to install on Termux but failed, try to install on VHEditor but the problem is I can't install flutter SDK in Environment Variable. maybe you guys can answer my question.so, can i build flutter apk in android mobile??
I am assuming you meant building an apk version of the app instead of running it on an emulator.
To do that run in your IDE terminal or flutter console
Flutter build apk
I guess there is no way of installing Flutter on phone, The best way to use flutter on phone is to ssh into a server and compile it's apk
yes we can build flutter apps in mobile through termux and here is simple guide for reference but i am still giving simple one liner installing command but for "how to use" please check reference link
curl -s https://raw.githubusercontent.com/Hax4us/flutter_in_termux/master/install.sh | bash -s
reference : https://www.hax4us.com/2021/12/install-flutter-in-termux.html?m=1

Android sdkmanager tool was found, but failed to run

I'm trying to use flutter on Android Studio. I have the flutter plugin installed on Android Studio and when i try to create a new flutter project it behaves normally, in the sense of it lets me write the project name, the flutter sdk path and so on. But when i click on finish absolutely nothing happens. I just see the Android Studio Welcome page where i can create new Projects. So i figured I'd see what flutter doctor -v has to say about it and it gives me these errors:
So i try to find a solution by typing : flutter doctor --android-licenses but i get another error:
And yes i have set the PATH variable and i have installed Android SDK Tools.
I tried everything but nothing seems to do the job.
Any help would be appreciated.
if you are using windows OS, backup your data, reinstall windows..remember to choose option to keep your files and application..after finish..check updates and update windows..
then run flutter doctor --android-licenses

Flutter Problems: Android Studio not found at /path/to/android/studio

Flutter doctor is showing me Errors in these categories. Although I have Flutter Dart plugins installed. I have also failed to understand the other problem. I am using Android Studio 3.2 and I need Help to fix this issue.
As #bayardcodeboy said
You just run flutter doctor -v
It will show a description of how to fix the problem.
For my problem, I run the command
flutter doctor -v
flutter config --android-studio-dir=F:\android_studio
Because I install it in drive F on my computer.
Hope this will help.

Categories

Resources