How to change Flutter Module's Directory - android

When I created a flutter module through the command "flutter create -t module..." and I forgot to use "cd.." to change the directory of the root folder, for me it is "C:\Projects" and it created the module inside my Android Project Directory, which is "C:\Projects\MyAndroidApp", How do I change the directory? and is it okay to have the flutter module inside 'MyAndroidApp' ?

You can simply move the project folder of the module to the intended location. This shouldn't cause much issues unless you're referencing the module on a Flutter project, which you might just need to update its path.

Related

Is there a way to clone an IntelliJ IDEA gradle project?

I'm trying to move my IntelliJ IDEA (2017.3) Android project to another computer just copying the files and it does not work. I am aware of this and this, but in the case of Android project it does not work. All the xml files inside .idea store paths relative to the home ($USER_HOME$) instead of project home ($PROJECT_DIR$). Oddly, Maven projects seem to generate paths relative to the project home and those ones can be copied. But not with gradle projects.
Anyone knows how to solve this ?
EDIT: Bear in mind that I want to copy ALL project settings included running configurations. I want that someone opens the project and find exactly what I have. I know I can reimport the project, but then I'll loose some configuration.
Here's the files and folders that need to be excluded from the copy (assuming that your project has a module called app), preferably if you copy the entire project folder to some where else on the same computer and then deleting the unneeded one by one:
folders .idea, .gradle or any folder who's name starts with a .. They are usually found within the root folder of the project and within the module root folder.
build folder found in the project root folder and in module root folder.
any file who's extension is .iml, found in the project root folder and in module root folder.
local.properties found in project root folder.
The rest of the files and folders need to be kept. With the above excluded, the project can be re-imported in Android Studio properly with the correct configurations relative to your second PC.
On a side note, these are the typical exclusions added in .gitignore of an Android Project Git Repo.
Ok, I found the problem. It is related to how gradle resolve symlinks. This is the issue. Summarizing, if you open your project with a path that contains a symlink, absolute paths will be created in the configuration files and your project won't be portable.
I have reopened the project again using an absolute path and then all the configuration files use PROJECT_DIR instead of USER_HOME

Can I delete the gradle folder from Android Studio project safely?

I have a folder named ".gradle" which is taking 600MB of space.
Normally, it contains a file named fileSnapshots.bin, which is around 20 MB.
But for one of my apps there are several sub folders in which there are several fileSnapshots.bin files created and these are around 150-200MB each.
Please see the following screenshot and tell me if I can delete this folder after closing my project?
If I delete it will my project rebuild safely next time?
Inside the project you can find the .gradle folder.
Inside you can find all settings and other files used by gradle to build the project. You can delete these files without problems. Gradle will recreate it.
Also these file are not committed and Version Control Systems. It means that when you checkout the project these files are not present on the project.
See
You can safely delete all, but you should keep at least 4.1, assuming that is what gradle.properties is using.
You could also prevent this directory from being created for all projects by installing Gradle yourself externally from Android Studio, and configuring it use that instead of Gradle Wrapper.

Android Studio 1.2 migration?

I am following some posts/questions about AndroidStudio-1.2 and it seems that there is a different project structure: app/src/main; while my old 1.0 project looked like: src/main (no app).
Not sure if this is causing this, but I am not able to get gradle to identify any test files, while running tests.
You probably have to rename src/test to src/androidTest.
The app directory is a subproject directory. By default AndroidStudio generate a structure ready for multi-module project. i.e. :
a root directory with the root build.gradle + gradle.settings (listing all modules in your project)
a subdirectory (named "app") where you can put all the sources for your application.
Later it is more easy to add a library module (just create a directory myLib in the root folder).
This structure is just proposed by AndroidStudio: you can also use AndroidStudio with only one level of directory and one single build.gradle.

Android gradle project directory variable

I am trying to write a script in gradle that requires opening up a file. I am trying to find the current directory where the project is installed. so I can open a file in my "raw" directory.
Note: I am aware that I can use a temporary file to find the current location of the application. However, I am trying to stay away from that solution.
I am trying to find out if gradle has a buildDir variable that I can use in my task instead.
See the Gradle docs. Specifically, you're interested in projectDir (The directory containing the build script) or buildDir (projectDir/build).

Moving a Cocos2d-x Android project around in the local file system

I've used create-android-project.sh to successfully create an Android app as part of my Cocos2d-x project. Now I want to move the app's directory and all contents to a different location in my local file system.
When I try to build the app after moving it I receive the error:
'make: *** Android NDK: Aborting. Stop.'
How can move my current project around the local file system and still have it build and run correctly?
If I need to re-create the Android project after modifying the creation scripts that's fine too. I looked through create-android-project.sh and it wasn't obvious to me how I can modify the script to create the project in another directory of my choice. Or perhaps I need to adjust some of the settings in Eclipse.
Changing the COCOS2DX_ROOT in build_native.sh to an absolute path makes the project compile successfully.
This is similar to NDK_ROOT defined at the top of the file.

Categories

Resources