I'm new to flutter. I want to open (android)module of flutter to another window. But there's no option visible in java file or any other android file.
here is my flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v1.7.8+hotfix.4, on Mac OS X 10.14.5 18F132, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[!] iOS tools - develop for iOS devices
✗ libimobiledevice and ideviceinstaller are not installed. To install with Brew, run:
brew update
brew install --HEAD usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
brew install ideviceinstaller
[✓] Android Studio (version 3.1)
[!] VS Code (version 1.42.1)
✗ Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (1 available)
! Doctor found issues in 2 categories.
It is not neccessary, but advised to install Android Studio for Flutter. It makes it very easy to install and configure all the settings etc. What you definitely need is the Android SDK and JDK. You can definitely install and run flutter without Android Studio (you can also use Visual Studio).
Step 1: Open the Android Studio and select Tools from the menu bar and click on SDK Manager. Step 2: In the newly open window click on the plugins and in the search bar search for Flutter and Dart and then install it. Step 4: Now after installing Flutter and Dart we are ready to import a Flutter project.
Easiest tip that worked for me: Create new file under android, give it the following name:
[project_name]_android.iml
Leave it empty then re-try the option. Works like charm!
The problem is caused by missing .iml
project files. These files are added automatically to the .gitignore
file but they should not. To fix it:
.idea
folder.[project_name].iml
android/[project_name]_android.iml
To avoid it in the future, make sure .iml files are not excluded in the gitignore. There is a Github issue on this topic.
create a file in android studio inside android name
[project_name]_android.iml
copy paste bellow code
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" />
</component>
</module>
another solution: you can copy this file from another app and rename as like [project_name]_android.iml then paste in your project
Got to your project view on the left, then find the folder labeled "android" (it will have your current project name next to it in brackets). Right click, then navigate to Flutter > Open Android module in Android Studio
.
Alternatively, if you open any file (e.g. build.gradle
) in that "android" subdirectory, you will see Open for Editing in Android Studio
at the top right. If you happened to click "hide" on this banner previously, simply restart the IDE. Source.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With