All the source code is included when downloading the support libraries via SDK manager in Android Studio. Now I need to fix a bug in the support v4 code and add it as a *.jar in my application. But I don't understand how I open and build the source code in Android Studio. Do I import it as a new project? Do I open it as an existing project? What directory is the directory to be imported/opened? Can I just rebuild support-v4 code into a jar?
Thanks!
Related
I have a developed app using PanoramaGL library from this link. But it is for Eclipse and I want it for Android Studio because the eclipse project is building successfully in Android Studio but it is not running. Please help me..
Did you include the library in your build.gradle file ?
There is no difference between Libraries in Eclipse and Android Studio. Just be aware that Android Studio uses Gradle as its build system.
dependencies {
compile files('libs/PanoramaGL_0.2-beta.jar')
...
}
I am trying to add an existing project as a module. However, it wont compile as it says this library is missing:
android-support-v4.jar => com.android.support:support-v4:20.+
I have opened the sdk manager and installed the latest version of Android Support Library but the error remains. How can I fix this please?
Make sure that you have the "Android Support Repository" installed under "Extras" in the SDK manager.
The support libraries are managed in a local Maven repository, and that repository is the "Android Support Repository" component.
You can manually search the android support library jar in the android sdk directory and then copy it to a directory included in your projects library path. I believe the jar should be somewhere in the \extras\android\support directory.
Note: I must do that when developing android apps with netbeans + android plugin. Not sure if android studio is supposed to pick the support library automatically from the sdk folder.
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.
Hi in my project Iam using
compile 'com.android.support:support-v4:22.2.0'
for support library I don't want to use appcompat-v7 and mediarouter but they are getting generated under /exploded-aar/com.android.support.
My project was originally made for Ant build system and after I imported it in Android Studio it's been built for Gradle and it was working till I updated SDK (by mistake) and now I can't build project because of conflicts.
I tried to remove it from app.iml
<orderEntry type="library" exported="" name="appcompat-v7-22.2.0" level="project" />
But after I clean and rebuild project it's back again
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)