I was trying to continue my Flutter learning and just tried to open the project. I opened the android studio, it showed me the project that I had opened the last time. Then I proceed to File->Open to open the project I specifically used for learning (let's call it L). But then android studio was stuck on open file dialog box (shown in screenshot).
screenshot
It just stuck there for more than 10 minutes, until I decided that there is something wrong and hit the cancel button. I can still access my project using File->Open Recent, though.
Questions are, what caused it? What can I do to fix it?
I've tried:
Uninstalling android studio and reinstalling it
Running disk defragment (I don't know if it is relevant. I thought that maybe something in my drive caused it)
Somehow I was able to made it past the loading when I do the following:
Open Java Project from Open Recent
Let the gradle build run, wait until gradle finish downloading files
Click File->Open
But when I came back to L from Open Recent and go to open file menu, it stuck again
I also tried googling "android studio stuck on open project screen" or "android studio cannot open file" but there's nothing I can use there
Additional Information
Android Studio Version 4.1
Flutter version 1.20.3
Dart SDK version 2.9.2
Please help
Related
I am new in android studio and flutter and I have encountered several problems after installing them. I already went to flutter doctor and it's all checked so flutter isn't the problem. I can't start coding because of these problems:
Here the sample code made by flutter itself I can't run it has several errors and
Here I can't run any virtual device because it says that I don't have an internet connection which is not true. I cannot code if I can't run the sample dummy code.
Thanks
I think you haven't properly done the setup for Android Studio. Please check the documentation where you will get steps for proper installation.
Few things which you can check:
Flutter and Dart plugins should be installed in Android Studio
If you want to run on an emulator, you will have to download the image for it whose answer you can find in previous answers.
When you first open Android Studio, you should get an option to create a Flutter Application.
Try to reinstall android studio with stable internet connection.
i would advise you to follow below steps to download system images to create virtual device
Select sdk manager
Download a system image by selecting show package details.You can download api32 system images which is the latest for now.
Once downloaded you can see the image file while created avd.
Some errors i got and how i fixed it
(ERROR 1) [flutter] flutter doctor -v 'crumb' is not recognized as an internal or external command, operable program or batch file. Error: Unable to find git in your PATH. exit code 1
(FIX) Go to flutter installation folder and inside flutter/bin edit the flutter.bat file using a text editor and remove the line (20) that says
IF EXIST "%mingit_path%" SET PATH=%PATH%;%mingit_path%
The code should look like this on those lines
REM If available, add location of bundled mingit to PATH
SET mingit_path=%FLUTTER_ROOT%\bin\mingit\cmd
Save and Run flutter doctor and everything should work fine.
(ERROR 2) flutter doctor takes too long
(fix) I downloaded the previous version of the sdk it worked like a charm
(ERROR 3) Android sdkmanager not found. Update to the latest Android SDK and ensure that the cmdline-tools are installed to resolve this.
(fix) Open Android Studio
Tools Menu, SDK Manager
In the window that comes up there are inner panels, choose SDK Tools panel
Tick Android SDK Command-line Tools
Choose Apply button near the bottom of the window
This worked
(ERROR 4) `The term 'flutter' is not recognized as the name of a cmdlet, function, script file, or operable program.
(fix) put the correct part in the env variables like i had put D:\flutter insted of D:\flutter\bin that worked
I am trying to learn Flutter and I am following this tutorial here.
I was able to successfully able to set up flutter and I opened Android Studio and hit play and I see the template base app showing. The tutorial then asks me to edit lib/dart.main
But I do not see that file anywhere in the file tree to edit it... I feel Like I am missing something really obvious.
What's frustrating is I can see main.dart file is running but I cant find it in Android Studio to edit it in Android Studio...
I figured out my issue! In the top left where it says "Android" I had to click the drop down and change it to "Project"
and now you can see the /lib directory :-)
I'm new to learning flutter when I try to crate a new project on android studio gives me a arror message in the event section enter image description here
The MESSAGE: [Could not find an option named "platforms". Run 'flutter -h' (or 'flutter -h') for available flutter commands and options.]
And another problem is flutter doctor does not see the android studio enter image description here
1(By the way, I want to use this version of flutter, please do not give a suggestion like update.)
2(this problem did not exist before, it happened after turning my computer off and on)
And sorry for my english mistakes
Thank you.
flutter version flutter_windows_v1.12.13+hotfix.9-stable
andorid studio version: 4.1.3
Is this the answer to your question about andorid studio?
and you need to install JDK
You are using the wrong flutter SDK. Too low information in your question. Make sure that you have the right path to flutter SDK in your IDE. Check that the flutter SDK directory has the appropriate structure, all needed files and cetera. Channel and version of flutter also may have an influence on this problem.
Got this today out of nowhere. Things were going well, but suddenly when I tried to relaunch the app from fresh, for the error Could not find an option named "target"
UPDATE:
This appears to happen when I switch branches and merge while app is running/flutter is attached. If you're using VS Code,
open your launch.json
change something, I decided to change type: "dart" to type: "notdart"
save
try to debug which fails
then revert that change.
This should fix the issue.
Previous Answer/If you're not using VS Code
What worked for me was to
flutter clean
close the editor (VS Code for me)
close the emulator
give a minute for things to close down
open task manager and kill any left over processes of dart.exe flutter.exe and java.exe and adb.exe (was doing Android)
start VS Code/Android Studio and try to debug again. (when prompted I chose to cold boot the emulator as well)
This takes a while as the emulator has to cold boot and since flutter clean was run, the compilation hadto start from scratch as well.
I am a C# developer, but have been tasked with developing a Flutter app, and I am discovering I have no idea what I am doing. I have a copy of Visual Studio Code and have installed the Flutter SDK, but they aren't working together. The Dart and Flutter extensions are installed, but when I CTRL+SHIFT P and select Flutter: New Project, the prompt disappears and I find myself with nothing changed on the screen. Earlier, I was getting an error that VSCode could not find my SDK.
I am going nuts. Can someone tell me where to start debugging this problem?
Seems that you don't have the SDK installed.
Navigate to the View option on vs code then select Command Palette.
type the word flutter in the palette; it should give you a list of commands, for
instance, creating a new project and flutter doctor.
Select either Flutter: Run flutter doctor of Flutter: run new project
You will get an option at the bottom|right side of vs code to select installation folder for SDK (if you don't have it). You will then be prompted with Project name and location.
To run your sample project, you can use flutter run command.
VS Studio is looking for flutter in predefined folders as indicated in the "View Logs" button. To fix this, Add the flutter\bin folder in your environment variable.
In Windows, right-click "This PC" -> "Properties" -> "Advanced System Settings" -> In "Advanced" Tab, click on "Environment Variables", In "System Variables" section select "Path"
Next click "Edit", click "New" and put the location of the bin folder where flutter is installed.
Restart VS Studio, and re-run flutter doctor.
If you're running Flutter: New Project and then seeing nothing at all, then this is certainly a bug in the extension. It's supposed to prompt you for a project name and location.
If you can still reproduce this, please raise a bug on GitHub and if possible attach an Extension log. There may also be useful information in the dev console (Help -> Toggle Developer Tools).
Flutter setup for VSCode windows
You Need to download flutter libraries either from flutter or git
a. From flutter
https://storage.googleapis.com/flutter_infra/releases/stable/windows/flutter_windows_v1.12.13+hotfix.9-stable.zip
b. From git clone (make sure git is installed in your system)
C:\src>git clone https://github.com/flutter/flutter.git -b stable
Extract or clone flutter libraries in following directory
C:\flutter
Add a new environment veritable path C:\flutter\bin
Run flutter version to check flutter installed correctly
Install VSCode
Install Flutter and Dark extensions in VSCode
Press Ctrl + Shift + P to open command palette. Type in the search bar Flutter and click on Flutter: New Project.
It will create a demo project.
Run flutter to run demo project
Note - You may need to install android studio as it will set android SDK and emulator
I ported an android project from Eclipse to Android Studio. The project builds just fine. However I am not able to see any layout preview. When I go to the Design tab of a layout I get a
Loading Configuration...
message that never goes away (see image).
I have set correctly the Android SDK in the project structure.
This happens with all the xml files and I am not able to open the "Preview" window from
View -> Tool Windows -> Preview
I tried creating a new project and everything was showing fine. Am I missing something? Anyone faced a similar issue? Is there a chance that this is happening because the folder structure is not the default one? (The layouts are not under project/src/main/res/layout but under project/res/layout)
Try this
Build> Clean Project
Build> Rebuild Project
It worked for me
Just do a right click on the layout preview and click on
Show Included in contentmain.xml
you can see it in the following image
I had the same problem and I solved as follow
Update all build.gradle files with:
classpath 'com.android.tools.build:gradle:0.5.+'
Now android studio 0.2.+ uses gradle 0.5
Closes de IDE and via Terminal/Console
Do a clean: $gradle clean
Do a build: $gradle build
Assemble it: $gradle assembleDebug
Open the Android Studio and be happy ;)
Close android studio and go to path as follow:
C:\Users\user\ .AndroidStudio1.2\restart
There is a file named restarter,double click on it and open android studio again,create a new project and enjoy it
Maybe it is better to use the 0.3.6 version (latest), with this version of gradle : com.android.tools.build:gradle:0.6.+
Bear in mind that Android Studio will be expecting the Android SDK already installed (as I suppose you have), and also the environment variables ANDROID_HOME and GRADLE_HOME.
Try updating your API to the latest version in the SDK manager ---- worked for me
I had the same problem Follow this step :
First uninstall old android studio and delete .androidstudio file from C:\Users\yourpcname
update api to latest version in SDK manager.
Install Latest Android Studio Canary Build: 2.0 Preview 9
Done
In Android Studio
File>Invalidate Caches/Restart
that's how i fixed
You can try :
Select Preview window(Focus on it)
Unselect Floating mode and Pinned mode
goto Window -> Active Tool Window ->
Unselect Floating mode and Pinned mode
Now you can see Docked window option here(Window -> Active Tool Window ->)
Select Docked Window