The project works well in Eclipse and I have upgraded the android SDK to 22.0.1 too. when I follow the instruction
1, In Eclipse, select File > Export.
2, In the window that appears, open Android and select Generate Gradle build files.
3, Select the project you want to export for Android Studio and click Finish.
But the problem is the exported build.gradle is empty.only one comments there:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
and this empty file is never able to guide the android studio to import the project successfully.
Does anyone has idea what I should do? Thanks.
Related
When working on a Mac with Flutter in Android Studio (Arctic Fox 2021.3.1 Patch 4 and XCode 13.1 and/or 13.2):
If you move the root folder of your Flutter project using Finder, then open it in Android Studio and run it, the original folder location is still re-written (multiple sub folders with empty contents, usually, but not always).
Also, the moved project will no longer build from within XCode.
This means that if you don't know the final desired location for your project at the time you create it, you will not be able to move it without weird stuff happening.
How can you move a Flutter project that was created with Android Studio without it having weird side-effects?
More info on how to reproduce:
Close all IDEs
Open Android Studio
Using Android Studio, create a new default FLUTTER project using Java as the Android code choice
Using Android Studio, run this project on an Android Emulator
Using Android Studio, run this project on an IOS simulator
Using Android Studio, open the project in XCode (right-click ios folder and select Flutter\Open project in Xcode)
Using XCode, run the project on an IOS simulator
[everything should have worked so far]
Close all IDEs
Using Finder, move the project folder to a new location that is at the same depth as its current folder, but with a different parent folder. Meaning if current location is: [root]/x/y/a/my_project_original, the destination would be: [root]/x/y/b/my_project_copy
delete the original folder and remember where it was
Using Android Studio, open the project from its new location
Using Android Studio, open the project in XCode (right-click ios folder and select Flutter\Open project in Xcode)
Attempt to run on IOS simulator
[observe error - "Command PhaseScriptExecution failed with a nonzero exit code" // "file not found exception"]
Using Finder, check to verify original folder location has NOT been re-written
Using Android Studio, run the project on Android emulator
[observe that original folder has been re-written!]
Here are the steps I follow to move a project's location on my mac :
Close your project on Android Studio (File > Close Project)
Close Android Studio
Move your project to your new location
Open Android Studio
Delete your project from the Recent Projects (on the list of Recent Projects, click on the Settings icon on the right, and "Remove from recent projects")
Click on "Open" and select your project in the new location.
Delete the .idea file and build/ folder
The steps should be the same within XCode (in the main window, remove the old location from your recent projects, and Open the new location)
You can move your Flutter project anywhere, as long as you don't move the files inside the project relative to each other.
A note about pod install: If you are immediately running from Xcode, you need to run pod install inside the ios folder after adding a plugin to your pubspec.yaml. If you run flutter run or use Android Studio to run it, that will run pod install for you automatically. However, you don't have to run pod install after moving the project, I've just tested it.
If you move the root folder of your project using Finder, then open it
in Android Studio and run it, the original folder location is still
re-written (multiple sub folders with empty contents, usually, but not
always).
This only happens if you kept Android Studio open when moving the files. You shouldn't open the old project reference in Android Studio, you should open the project using File > Open....
Also, the moved project will no longer build from within Xcode.
If you provide the errors, that will help us help you.
How can you move a Flutter project that was created with Android Studio without it having weird side-effects?
I have not found any side effects of moving a Flutter project. Quit Android Studio if it is running, and open it using File > Open.... Or if you are in terminal, run (if installed using Jetbrains toolbox) open -a ~/Applications/JetBrains\ Toolbox/Android\ Studio.app/
I have a flutter project I want to migrate to AndroidX. The docs say I should open Android Studio and click "Sync Project with Gradle Files" but that option is disabled for me as seen in the following picture:
how can I enable this option and migrate to AndroidX?
Open Android Studio.
Select Open an existing Android Studio Project.
Open the android directory within your app.
Wait until the project has been synced successfully. (This happens automatically once you open the project, but if it doesn’t, select Sync Project with Gradle Files from the File menu).
If you are asked to backup the project before proceeding, check Backup project as Zip file, then click Migrate. Lastly, save the zip file in your location of preference.
The refactoring preview shows the list of changes. Finally, click Do Refactor:
That is it! You successfully migrated your project to AndroidX.
Select Migrate to AndroidX from the Refactor menu.
i have been imported flutter project and it worked well ,but i faced this problem when i tried to open it again.the project folders is not accessible as in the images
[]
[]
,thus when tried to run the project from terminal i get the error that referred to in the image one.
note:
the flutter path is set as in []
In your android Studio, right side you have "gradle" and "Flutter outlie" views. Out of which click on gradle. then right click on your root project and select "sync project with gradle files"
Then enable dart support in your project. To enable dart Go to File > Settings > Language & Frameworks > Dart > Enable Dart Support
This will solve your issue.
When I try to import from eclipse,and select root directory -> select the folder where I have all the my-gdx-game-android,html,desktop.. It only imports the android and it shows a message:
Could not set the project description for 'my-gdx-game-android'
because the project description file (.project) is out of sync with
the file system.
Make sure when you import your projects that you select Existing Projects into Workspace and not Existing Android Code into Workspace.
If you select the second one, Eclipse will only import Android specific projects. The base project in libgdx is a pure Java project that doesn't rely specifically on Android so it won't be imported using that function. This is also true for your html and desktop projects since they're not Android projects.
How to compile GreenDao examples and DaoExampleGenerator without eclipse?
You can use Android Studio to do it.
Gradle is integrated and download dependent libraries.
Just be aware on the paths in Android studio (uses the main project path containing all modules (one module in android studio is a project in Eclipse).
It worked for me.
dropdown on the run button click on Edit Configuration, then, click + button and add new Application and on config : Check on below image then click apply and ok.
Next what you need to do is on dropdown, choose your daogenerator then run the application it will compile the dao class
then it should looks like above and click run. It should works!
Good luck!!