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
Related
Yesterday I have Updated my android studio, since then auto completion and error detection is not working.
First close Android Studio.
On mac just go to ~/Library/Application Support/Google/
And delete all the AndroidStudio< version > folders, after this you will see the errors.
Try resetting Android Studio settings. Close Android Studio, locate and delete this folder (copy to another location before deleting, so you can return to it if something goes wrong).
C:\Users<Your User>\AppData\Roaming\Google\AndroidStudio< version >
This should reset your Android Studio settings to default. Now check if auto-complete and error detection works or not.
I just updated to the latest stable Android Studio out there, version 4.2.1, with all the latest plugin and stuff. After doing it, saving a file didn't update the app. It just showed a bubble saying reload not performed analysis issues found, but when going there, only warnings appeared. Zero errors.
Tried a flutter upgrade that moved me from 2.0.6 to 2.2.1 with no luck. Also ran an Invalidate Caches / Restart, but didn't work either.
In my case the problem was the fact AndroidStudio placed some file:/// on some imports when I moved some file locations.
Check if you have any import using file:/// :
import 'file:///<your_awesome_file_path>.dart';
and try rewriting them removing the "file:///" argument:
import 'package:<your_awesome_package>/<your_awesome_file_name>.dart';
The hot reloaded will work again when you replaced all file:/// occurrences from the imports.
Make sure in Android Studio > File > settings > Languages & Frameworks > Flutter > check "Perform hot reload on save"!!!
This may help you:
In Android Studio go to File -> Settings -> Keymap ->Main menu ->Run, you should assign some key shortcut for that to happen. Default it will be Ctrl+\
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 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
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