Flutter apk not installing - flutter

I am unable to install my apk on an android device except only for this apk. I am using the flutter build apk command to generate apk. After sharing apk to some device it was getting app not installed as shown in this..
I am using VSCode and here I am sharing the flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.8.1, on Microsoft Windows [Version 10.0.19043.1466], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[√] Android Studio (version 2020.3)
[√] VS Code (version 1.63.2)
[√] Connected device (3 available)
Other apk's are working fine except this one on my device.

Try all these steps:
Make sure that you have enough storage space
Enable the installation from Unknown Sources
Make sure that the APK file isn’t corrupted or incomplete
try to clear cache of package installer and reboot
Check if the app is already installed in your device.
Check if the play protect option is enabled, if it is then turn off it in play store from navigation drawer.
Make sure “applicationId” in build.gradle file is unique.
Just go to the Settings --> Apps --> Click on your App. ---> In App info page at the action bar menu there will be an option called " Uninstall for All users " click that.

This type of issue is occur when you transfer apk file directly via any messaging platform or USB ... Some time it will happen and apk file will corrupt.. So I suggest to create a link for distribution of your app..
You can upload your apk in Google drive or use Firebase App Distribution or just WeTransfer. And Generate the link and then transfer that link....

Related

vs code cannot launch android emulator

i was just starting with flutter and i was using android studio before and i have an emulator but now i wanted to start with flutter and tried to run the default flutter project but says no device and when i try to connect to the emulator i have it just keeps loading and says "Failed to launch Pixel 3a API 29: Error: Emulator didn't connect within 60 seconds"
tried a lot to fix it but still the same error.
and by the way when i run flutter doctorit displays
Doctor summary (to see all details, run flutter doctor -v):
1.[✓] Flutter (Channel stable, 2.0.2, on Linux, locale en_US.UTF-8)
2.[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
✗ Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/linux#android-setup for more details.
3.[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
4.[✓] Android Studio (version 3.5)
5.[!] Connected device
! No devices available
! Doctor found issues in 3 categories.
thanks in advance.
I have faced this problem before, Try these steps:
Open your android studio, go to avd manager
Now select your emulator, click on dropdown in actions and wipe data
Check whether you have intel x86 emulator accelerator ticked in sdk tools in android studio.
If the problem still persists, you can remove this emulator and install a new one.

Flutter error while adding web support to app

I just found out that I can change my flutter app to a website without writing external code. I decided to test it on my app but I got this error and I have no idea how to fix it. I followed the steps on the "website" but still I get the error. My stacktrace is :-
This application is not configured to build on the web.
To add web support to a project, run `flutter create .`.
Launching lib\main.dart on Web Server in debug mode...
Syncing files to device Web Server...
org-dartlang-app:/web_entrypoint.dart:8:8: Error: Error when reading 'lib/generated_plugin_registrant.dart': The system cannot find the file specified.
import 'package:discountapp/generated_plugin_registrant.dart';
^
org-dartlang-app:/web_entrypoint.dart:11:3: Error: Method not found: 'registerPlugins'.
registerPlugins(webPluginRegistry);
^^^^^^^^^^^^^^^
Failed to compile application.
I run flutter create . and it says
C:\Users\Hemant\AndroidStudioProjects\discountapp\ios>flutter create .
Recreating project ....
Wrote 3 files.
All done!
[√] Flutter: is fully installed. (Channel beta, 1.20.0-7.2.pre, on Microsoft Windows [Version 10.0.18363.959], locale en-US)
[√] Android toolchain - develop for Android devices: is fully installed. (Android SDK version 29.0.3)
[√] Chrome - develop for the web: is fully installed.
[√] Android Studio: is fully installed. (version 4.0)
[√] Connected device: is fully installed. (3 available)
In order to run your application, type:
$ cd .
$ flutter run
Your application code is in .\lib\main.dart.
C:\Users\Hemant\AndroidStudioProjects\discountapp\ios>flutter create .
Recreating project ....
Wrote 3 files.
All done!
[√] Flutter: is fully installed. (Channel beta, 1.20.0-7.2.pre, on Microsoft Windows [Version 10.0.18363.959], locale en-US)
[√] Android toolchain - develop for Android devices: is fully installed. (Android SDK version 29.0.3)
[√] Chrome - develop for the web: is fully installed.
[√] Android Studio: is fully installed. (version 4.0)
[√] Connected device: is fully installed. (3 available)
In order to run your application, type:
$ cd .
$ flutter run
Your application code is in .\lib\main.dart.
Running flutter run will run it on my phone. I will provide any code needed. Please help
You have to run flutter create . in application's root folder, but not in ios subfolder.
Rename ios folder to _ios
Run this command in your Terminal: flutter create --platforms=web .
Rename back _ios folder to ios
This will write all needed files to run your app on the browser.

flutter run -bash: Desktop/flutter/bin/flutter: No such file or directory

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.1, on Mac OS X 10.14.6 18G103, locale pl-PL)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from:
https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK
components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup
for detailed instructions).
If the Android SDK has been installed to a custom location, set
ANDROID_SDK_ROOT to that location.
You may also want to add it to your PATH environment variable.
[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
[!] Android Studio (not installed)
[!] Connected device
! No devices available
I created a my_app folder and typed:
cd my_app
flutter run
The "flutter run" command does not work. How to fix this?
Have you installed android sdk?
If not then installing Android Studio will will install all the required dependencies.
I faced this problem it easy to solve
Open Android Studio
And go to preference
Plugins
Download flutter & dart
You need Android SDK, if you plan on using Android Studio then SDK will be downloaded with the Android Studio
https://developer.android.com/studio is the link to download

Problem with Flutter Web. Chrome Beta is uninstalled but still showing up

I am facing a problem with the flutter web initialization. I followed the steps in https://flutter.dev/docs/get-started/web Everything went smooth
flutter channel beta
flutter upgrade
flutter config --enable-web
When I do Flutter Doctor I get
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, v1.17.0, on Microsoft Windows [Version 10.0.18363.778], locale en-IN)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
X Android license status unknown.
Try re-installing or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions.
[X] Chrome - develop for the web (Cannot find chrome executable at C:\Program Files (x86)\Google\Chrome Beta\Application)
! C:\Program Files (x86)\Google\Chrome Beta\Application is not executable.
[√] Android Studio (version 3.6)
[√] VS Code (version 1.44.2)
[√] Connected device (1 available)
! Doctor found issues in 2 categories.
I don't have chrome beta on my PC anymore. I have normal chrome. How to change it. Somebody help me out.
Also, I got found this online as a solution but I don't know what it means.
export CHROME_EXECUTABLE=path/to/chrome
This is not the solution but an alternative method you can try. If you are in the beta channel of flutter you can just type flutter build web that will create a web build in your web folder. You can run it on any other server just like normal web application. If you want to do this to an existing project first run flutter create . then flutter build web.

Cannot run first project under flutter

Mac with Mojave
Flutter installed
Flutter Doctor passed all the tests
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.14.2 18C54, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.2)
[✓] IntelliJ IDEA Community Edition (version 2018.3)
[✓] Connected device (2 available)
I started IntelliJ IDE, and clicked on create new project
I selected the Android Emulator: Nexus 5S, and the emulator opened up properly.
I clicked on the green arrow to run, but I got the following error message:
════════════════════════════════════════════════════════════════════════════════
No valid code signing certificates were found
You can connect to your Apple Developer account by signing in with your Apple ID
in Xcode and create an iOS Development Certificate as well as a Provisioning
Profile for your project by:
1- Open the Flutter project's Xcode target with
open ios/Runner.xcworkspace
2- Select the 'Runner' project in the navigator then the 'Runner' target
in the project settings
3- In the 'General' tab, make sure a 'Development Team' is selected.
You may need to:
- Log in with your Apple ID in Xcode first
- Ensure you have a valid unique Bundle ID
- Register your device with your Apple Developer Account
- Let Xcode automatically provision a profile for your app
4- Build or run your project again
5- Trust your newly created Development Certificate on your iOS device
via Settings > General > Device Management > [your new certificate] > Trust
For more information, please visit:
https://developer.apple.com/library/content/documentation/IDEs/Conceptual/
AppDistributionGuide/MaintainingCertificates/MaintainingCertificates.html
Or run on an iOS simulator without code signing
════════════════════════════════════════════════════════════════════════════════
Finished with error: No development certificates available to code sign app for device deployment
Any ideas?
It looks like it's trying to run on an ios device that doesn't have a valid certificate. Flutter doctor is saying there are 2 devices connected. If you have an ios device attached to your computer, try disconnecting it so that flutter doesn't try to use it instead of the emulator.