-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flutter lib folder - Missing Menu option Create New Folder #2539
Comments
Apparently, IntelliJ (and, therefore, Android Studio) interprets We need to mark the |
In my test the IntelliJ IDEA editor for the lib folder, it has the Create Directory in the menu option. Just the Android Studio does not. :) |
Looks like it depends on the version of IntelliJ. This isn't something we'll be changing. |
Just to confirm. While I agree there is no New Folder menu option, the New Package does the job: I found that doing a mkdir is equivalent to using the New Package meu option. |
Curious thing, I added the folders from Windows Explorer and they appear as a java package on IntelliJ IDEA.... but a project I cloned from git, such as |
|
Happened to me when created app via command line - |
@ph55 yeah, same! it only happens when you create a project using |
Under File-> Project Structure-> Module-> Source-Tab you can unmark the /lib folder. This worked for me as a workaround. Credits: https://stackoverflow.com/questions/51491363/how-to-create-directory-folder-in-android-studio |
@Phpadawan Thanks for your suggestion. It ended up working for me as well. Now all is great:) thanks and all the best.! |
I am also having the same problem on my new project. But on my last project"Directory" option was visible |
@Rakibahsaf I don't know how or why it happens, but yes sometimes you have that option and other times you don't. Have you tried doing what @Phpadawan suggested? |
I try what @Phpadawan proposed, but i can just do one level of folder, i can't nested one in other, if i tried to do that, studio change the name of the folder including the two names, by example if i have a folder named "bloc" and i want to create a new folder inside with the name "code", studio change the name of the folder "bloc" to "bloc.code"... any suggestion? |
or you can simply use VS code to create folders inside folders |
I don't have "Project Structure" under "File" in my Flutter project |
In case you didn't create Flutter project via Android Studio (using CLI), you may need to do the following steps to see "Project Structure" menu option:
Then you'll be able to get to "File -> Project Structure -> Module -> Sources" and unmark "lib" as a source folder. As it's suggested above Android Studio recognizes folder named "lib" as a folder for packages by default, so that's the reason why a "Directory'" cannot be created inside |
I would suggest to check if you have the file yourProjectName.iml in the root folder of project. If that file does not exist then Android Studio doesn't know which folder structure to create and for this you cannot see you lib folder when it displays the window to set the flutter entry point. |
Go to file > Click Project Structure > Click Module > Click Lib > Unmark sources > Click Apply |
it is working for me now thanks |
@livintan Worked! But do you know why is that? |
I right-clicked on myproject.iml and clicked on import, which worked. |
Steps to Reproduce
Note, the only way to create Folders is to create a New Dart File with a new Folder name before it. This is very inconvenient when trying to create multiple folders without content.
Version info
flutter doctor -v
[✓] Flutter (Channel beta, v0.5.1, on Mac OS X 10.13.6 17G65, locale en-US)
• Flutter version 0.5.1 at /Users/doe/Development/flutter
• Framework revision c7ea3ca377 (2 months ago), 2018-05-29 21:07:33 +0200
• Engine revision 1ed25ca7b7
• Dart version 2.0.0-dev.58.0.flutter-f981f09760
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.1)
• Android SDK at /Users/doe/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.1
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.4.1, Build version 9F2000
• ios-deploy 1.9.2
• CocoaPods version 1.5.2
[✓] Android Studio (version 3.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 27.1.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
[✓] Connected devices (1 available)
• iPhone X • 705E75D9-7E01-4AB5-948A-226B8AFD9F8A • ios • iOS 11.4 (simulator)
• No issues found!
Thank you.
The text was updated successfully, but these errors were encountered: