Android Studio import Eclipse project from command line - android-studio

It possible automate import Eclipse Android Project (generated by Unity 5.4.3) into Android project with command line using android sdk?
For some reasons (eg methods limit and others) i need build android project with gradle. But Unity 5.4.3 not supported build with gradle and i can't update it for new version because i have some problems with convert my unity project to the new 5.5-5.6 versions.

According to the Android Studio official document, there seems no way to import an Eclipse Android Project into Android Studio using command line (bat or sh). I know that Unity 5.5 and 5.6 are not quite stable yet, but it's still your best bet to upgrade.

Related

Android Studio C++ Support Missing

I just installed Android Studio 3.6.3 on Windows 10 and I created a new Native C++ project. I can build and run the native project and I can debug Java code in the project.
The problems I'm having are:
I can't step into the C++ code when debugging
I can't set breakpoints in *.cpp files.
When I right click folders in the project view to add a new file, I only see options to add Java, Kotlin, and Android platform files. There aren't any options to add C++ source or header files.
When I open a C++ file Android Studio recommends installing plugins supporting *.cpp. The plugin it's recommending is for Arma 3 plugin development.
The "Attach Debugger To Process" menu only has Java as a debugger option. That list should also contain Native, Dual, and Auto.
I've made sure to install CMake and NDK (Side By Side) in the SDK Manager and I've configured the NDK in the project settings. I've tried reinstalling Android Studio 3.6.3 and I've also downloaded Android Studio 4.0 RC 1, but I have the same problems.
What steps am I missing to get C++ support in Android Studio?
Managed to get it working. Turns out just running the uninstaller wasn't enough, I had to follow the steps in this answer to completely uninstall Android Studio. I then reinstalled and everything seems to be good.

Upgraded to Android Studio 1.5.0, then 1.5.1 and can no longer create a project

I'm doing a bit of Android dev on the side, so I'm no gradle expert. Just trying to create a project for Android 4.0.3+. This used to work before upgrading to Studio 1.5. Any ideas how to get this setup so can make projects again? I have no idea what appcompat-v7.15+ is or what to install so it can find it.

Open cocos2d-x-3.7 in Android Studio

What is the proper way to open cocos2d-x-3.7 in Android Studio?
I tried:
Open existing project in Android Studio project > Choose proj.android-studio directory (In another attempt, I also tried to choose the base directory MyGame)
Run
Error: couldn't find "libcocos2dcpp.so.
Moreover, it also does Classes directory in the Project.
Android Studio is only partially supported in cocos2d-x 3.7 and 3.8. With the default project you will only be able to run your app without debugging using Android Studio.
Prior to running your app in Android Studio you will have to compile using the Android Studio flag:
cocos compile -p android --android-studio
You will have to run this command after any changes to your app are made, since the default Android Studio currently doesn't compile your project.
Furthermore the default Android Studio project does not include the Classes directory.
Suggestion: Use Eclipse or Xcode to develop your cocos2d-x projects for now. Hopefully future versions of cocos2d-x will have better support for Android Studio out of the box, this is critical considering Google is dropping support for Eclipse.
When you try to run the application on Android Studio, you get the error couldn't find "libcocos2dcpp.so" because it doesn't have the NDK for building your game.
I recommend you to compile proj.android and import that, cocos2d-x 3.7 doesn't support full Android Studio yet. Do this:
cocos compile -p android
Then import your proj.android to Android Studio.
Now you can run your application but you won't able to debug it, bad news (it will just install the APK on your device or virtual device).
Hope it helps.
Error: couldn't find "libcocos2dcpp.so.
For this you need to compile android studio project first so .so files and classes folder will be generated.
Open your command line and enter the following command to compile your android studio project:
cocos compile -p android --android-studio --ap android-24 --app-abi x86
This will create required files in your proj.android-studio directory.
Now import this project into Android Studio and try to run it.

How to import a android project into android studio?

I want to study the source code of android-smspopup .But when I download the source code and import this into android studio, the android studio pop up a dialog with a title"Import Gradle Project" and a blank to fill named Gradle home. Does any one know why this happens? And what to fill in Gradle home?
The source code doesn't include the Gradle wrapper files, which it should; the Gradle wrapper is responsible for automatically downloading the correct version of Gradle so you don't have to go through this trouble. I would recommend that you copy the Gradle wrapper over from another project into this source tree and use it. In another project that you've created with the New Project wizard, copy these files to the root directory of the project:
gradlew
gradlew.bat
gradle (directory)
When you open up the project in Android Studio it's likely to complain about the version of the Android Gradle plugin and offer to fix it for you; let it do that. If you're running the latest version of Android Studio (0.4.6 as of this writing), it's fairly smart about getting the versions of Gradle and the plug-in right, but in older versions it could get a little confused and have to ask you multiple times.
NOTE: instead of copying the wrapper files over, you can instead install a compatible version of Gradle and put the installation directory in when it asks for Gradle home. That will work, but be aware that Android Studio is very finicky about what version of Gradle it's compatible with; usually it requires a specific version that isn't forward-compatible, so for example, if it wants 1.10, 1.11 won't work. As you upgrade Android Studio you'll have to upgrade Gradle as well and it will be a bit of a drag; if you use the wrapper it's easier to make that change.
By the time Android Studio hits 1.0, it will sort out the version issues with Gradle, and it won't be so picky about version numbers, but in the short term, it's a limitation.

Migrate project to Gradle

I've got a project that used to be in Eclipse. I've since moved it from there into Android Studio, though it's not using the Gradle build system yet.
I've setup my gradle files so that I can do gradlew build from the command-line and it will generate an APK for me.
My question now is how do I get Android studio to build using the gradle files that I've got setup instead of the using the "old" way?
For what it's worth, I'm on Windows 7.
Not sure how you are compiling the project with Android Studio without actually using Gradle because AFAIK Android Studio always uses Gradle under the hoods to build sources.
Anyway, if you have your Gradle config file ready you only have to import it to a new project in Android Studio (File > Import Project... and then select the build.gradle or settings.gradle)

Resources