Android Studio's Play button is not enabled - android-studio

I am completely new to flutter. I am trying to build https://github.com/flutter/udacity-course/tree/master/course/02_category_widget/task_02_category_widget but the Play Button won't enable.
I tried creating an APK of the project from the command line:
flutter build apk
and
flutter install
It creates an APK and runs on my Android device. I also tried creating a new Flutter Project and the Play button is working well on that. What am I missing in this project?

Check by running flutter doctor if you have everything installed
Check that Android Studio knows where your Flutter SDK is located. File->Settings->Languages and Frameworks->Flutter

Related

Flutter is not being recognized on the machine

I formatted my computer and installed windows 10 again because I wanted to play and Linux was having problems.
I am trying to install flutter and dart for application development, but he is accusing this error.
Flutter doctor
I tested it before changing the flutter to beta and it recognized the flutter and dart plugins, however I want to leave it in the stable channel.
However, my code doesn't recognize it, I believe it is because of these errors with the flutter and dart plugins.
Code
I already installed the plugins through android studio and also vscode.
I tried to uninstall and install again, restart the computer, set path ...
I managed to solve it, I will leave here the solution for those who had the same problem as me.
I changed the channel to the Master and ran a flutter upgrade.
Now everything is running smoothly.
Maybe some bug with the stable channel, I can't say.
So:
Flutter channel master
Flutter upgrade
VOILÁ
Flutter doctor
Did you install flutter plugin in android studio properly? (Recheck in android studio.)
if yes then remove it and reinstall it.
if (1) not working then update your android studio.
keep your flutter sdk in c drive
if still flutter cannot trace plugin then set flutter sdk and dart sdk manually in android studio.
for dart
for flutter

How to run an app on an iPhone simlator with Android Studio on mac?

I want to get started with flutter. I have downloaded flutter and the Android Studio and XCode. In Android Studio, I can select the ios simulator from the drop down menu, but all that does is turn the simulator on and doesn't actually run my app. I am not sure what else do I have to do?
Open your app on Xcode, xcode will configure somethings. When you compile from android studio to an iphone emulator, xcode compiles the project, so it needs to configure the project at least once. You may need to go to the project's ios folder and run pod install to install the ios dependencies.

How can I build the apk from android studio from flutter

now I'm making an app using flutter and trying to upload the app as internal test on Google play store. I saw people asking how to do it, but could not figure it out...
On the official document, it says "Build > Build > Generate Signed Bundle/APK" and I can generate APK, but I don't see the "Generate Signed Bundle/APK".
When I select "Build APK" in the picture above, it gives me the message like
You are building a fat APK that includes binaries for android-arm,
android-arm64, android-x64. If you are deploying the app to the Play
Store, it's recommended to use app bundles or split the APK to reduce
the APK size.
To generate an app bundle, run:
flutter build appbundle --target-platform android-arm,android-arm64,android-x64
Learn more on: https://developer.android.com/guide/app-bundle
To split the APKs per ABI, run:
flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
Learn more on: https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
Running Gradle task 'assembleRelease'...
27.9s ✓ Built build/app/outputs/apk/release/app-release.apk (19.2MB). Process finished with exit code 0
Also, I saw this chat (How to build signed apk from Android Studio for Flutter), but I cannot see "open android module in android studio"
Even when I opened the android project with different window, I cannot see the option as well..
it will be really helpful if someone can teach me how to generate the APK from my current situation...
Thank you so much..
The reason why Open Android module in Android Studio is missing under Tools > Flutter is likely because you're using an older version of Flutter DevTools on Android Studio. You can run flutter pub global activate devtools on the Terminal to update the DevTools installed on the machine as mentioned on this guide.
to build apk use this line in terminal
flutter build apk --release --no-sound-null-safety

Flutter in Android Studio: Build Bundle/APK greyed out

I installed Flutter and Android Studio following this link here:
https://flutter.dev/docs/get-started/editor
I've been coding in flutter for two months now and can run my app in simulator or on a connected device no problem.
But when I try to actually build an apk via "Build" --> "Build Bundle(s) / APK", this option is greyed out.
Android Studio: 3.3.2
You can't build apk using Build option in Android Studio if you are running your Flutter project.
There are 2 solutions to build it.
In terminal, write flutter build apk (this will build apk for release version not the debug version)
Open your module in Android Studio and you can use Build option of the Android studio to build the debug apk.
For option 2, you can go to build.gradle file and you should see an option in Android Studio asking you to open the module separately (see the screenshot) Tap on this option and you can then build your apk in both debug and release mode.
I realize this might have already been answered, but I have another solution to this issue. I was having the same problem after modifying my pubspec.yaml file, so after trying to build within terminal nothing would happen. Apparently, you have to open the .yaml file within Android Studio from your project directory in order to for AS to realize that there's been a change to the file. After I opened the file from the project folder, the option for Build > flutter > Build Bundle(s) /APK > Build App Bundle finally reappeared again. Just sharing my experience and hope it can help someone else who may come across this rather strange issue.
Reopen the project from your projects directory, not from recent projects option. This solved for me
Please follow these steps:-
Go To Project Structure>Project>NOSDK
Change NOSDK to the latest
ANDROID API PLATFORM
Then go to MODULE and DO THE SAME

Cannot create flutter project or run flutter project in Android studio. (flutter works fine)

I'm getting into flutter so I followed the install doc on the website and had no issue, installed the flutter and dart plug-ins on both Android Studio and Intelli J. The flutter doctor -v command results in the following
But yet when I try to create a new flutter project in Android Studio a folder is created with the project name but it is empty and I get the following in the event button on the welcome screen.
Error creating project
Flutter create command was unsuccessful
So I decided to create the project manually in gitbash where the create command worked perfectly.
I opened the project in Android Studio and discovered another problem even with the emulator running or phone attached the devices section of the run ribbon displays no device and always says loading in the dropdown when clicked.
So again I opened gitbash and in the project root folder type flutter run and the default flutter test app appeared on the emulator.
In Summary, Android studio can open but not create the project nor can it run it but the project can be run from gitbash on the emulator I launched from Android studio.
BTW: IntelliJ has a similar result when creating a project.
I have no idea what was causing the issue but a fresh install of Git seems to have resolved the issues.

Resources