My english is not very good, thx for your reading :)
"The SDK Build Tools revision (23.0.1) is too low for project",this error always show when I reinstall some modules. I know this error is caused by gradle version.
Usually, I just click Android Studio error tip to fix this problem, just like the blow picture shows.
The error tip
And I know AS modify my modules code to the recommended version, but i don't know the inner process.
I know another way is using the highest sdk build tool verison to config the main project's gradle setting and make sub project to read the main project's instead of own. just like this way
But, I worry about this way may cause some compatibility problem in the future.
I think the best way is what AS do
So, I really want to know what Android Studio do, can I use some AS command and gradle command to fix this error automatically?
Or my worry about compatibility is wrong?
Related
I have a problem and I would like your help :)
I received a native Java project from Android Studio and I want to know how I can configure my environment, the first time I tried I had a lot of errors with gradel.
Is there a way to know exactly what settings are needed to start project maintenance?
As long as you have installed Android Studio and are able to create sample projects, you should be set up.
Gradle should show you all the problems which your legacy project has. I assume, that you will see a lot of warnings which can be ignored at first.
You might have problems with a missing key.properties file.
Some dependencies might not be available anymore.
You have to resolve all the issues manually. There aren't any special settings.
My ultimate goal is to be able to write Clojure apps for Android, using Android Studio and Cursive. I started with leiningen but found out that it is a build system that is independent of what Andoid Studio uses ie Gradle. So I tried leiningen with Intellij, but couldn't get Android deploys to work except from the command line. Since I wanted to integrate with Android Studio, I decided to try Graclj: https://github.com/graclj/graclj which is a Gradle plugin for Clojure.
I can get the Graclj tutorial running in Android Studio, as per this guide:
https://github.com/graclj/learning-graclj/tree/learning-0.1.0
However:
Graclj expects the Clojure src and built classes and jars to be in the root project
Android Studio expects src and classes to be in the app subproject
After the tutorial I end up with separate Gradle build tasks for Graclj and Android Studio but I don't know how to integrate them
So, can anyone suggest a way that I can hook into Andoid Studio's build process?
Do I need to change some settings to the Graclj plugin to do this? If so, how?
Do I need to change some Android Studio plugin settings?
Do I need to add/change something in the Gradle build scripts?
Am I heading down a dead end? ;-)
I have looked at the Android Studio build process: http://developer.android.com/tools/building/configuring-gradle.html
but I don't know enough about Gradle to know what I'm supposed to be doing here.
If I need to supply any more info, just ask.
Any help appreciated!
Unfortuantely, I don't have any Android (let alone Android Studio) experience. However, I'll do my best to answer based on Gradle/Graclj knowledge.
Graclj does not require you to use the root project. You can apply the plugin(s) in any of the projects that you have in your build. However, I don't know how well a model-based plugin like Graclj will work with the "traditional" Android plugin. You could try the "experimental" one that's using the model approach, though there's a decent chance that it won't be compatible unless there's one that works with Gradle 2.12.
Alternatively, you might be able to add a dependency to the Android app project on the JAR produced by Graclj (which you may still want to put in a project besides the root). Not sure if there's a very good way to do this (haven't tried myself).
dependencies {
// my-other-proj being whichever one you use Graclj in
compile project(':my-other-proj')
}
Or maybe you would need to add it to a configuration first in the my-other-proj to interop with traditional plugins:
artifacts {
archives createMainJar
}
It is possible that you're at a dead end (for now). Graclj is very new, so this stuff should all be possible eventually.
Is it possible to create a new project without gradle support in Android Studio, i.e. likewise in Intellij IDEA IDE?
I found one way only: create new project with IDEA and reopen in AS :-(
Unfortunately, I don't know such preference or option in AS. If you found it, please comment.
ps.s Gradle is a big pain at least in current AS beta 0.8, I spent more than 80% work time to fight with it's fatal issues. I think Google team must make AS more and more friendly to developers, never used gradle.
As far as I understand android studio is dependent on gradle as the build engine, and therefore you couldn't create an android project without gradle support
I posted this question on the IntelliJ community forums but it seems as if they aren't very active so I'll just post it right here on S/O. I'm new to IntelliJ and I'm switching to use it from Eclipse which was really buggy and not useful to my needs. However, I'm attempting to build an Android project in IntelliJ Idea and it is only creating a .idea folder and the src directory without any inner files in them like it should. I've got the Android-SDK properly installed and I'm using JDK 1.7 and I'm even following the directions to properly start an Android project from the IntelliJ Wiki (found here) but it still leads me to no success. It seems as if I've got the Android Support plugin already installed with my program but then again I'm not really sure. Can I get some help please so I don't have to revert back to Eclipse again? Thanks.
Try to delete Android SDK and install it again, then download at least one Platform. IDEA runs SDK tools to create Android project template, for some reason it's failing on your system.
Check if it works better with JDK 1.6.
See the screencast that I've just recorded.
I have a problem running my android project through eclipse. It gives following error when I try to run it:
trouble processing "javax/net/SocketFactory.class": ... Conversion to
Dalvik format failed with error 1
I am using Android 2.3.1 API level 9. The android.jar that is downloaded from AVD Manager has the javax/net package inside it.
I have searched on this issue and it seems to be the issue related to conversion of classes into Dalvik. But "javax/net/SocketFactory.class" is part of the android.jar. Any suggestions ?
The problem is resolved. I was mistakenly adding two android libraries at a time. One is added by default and other is added via Maven dependency. Removing the android dependency from pom.xml works. But now it is not working on terminal through mvn install command. This is a separate issue now.
As you know android sdk comes complete with java sdk build in. This sdk is light weight and customized for use by the dalvik engine. Now, if we also add java jar’s along with the android app, obviously the android system will have trouble converting that java jar to dalvik. Hence the “conversion to dalvik” issue.
So now that you know what happens, lets figure out why it happens.
In my case it was the barcode, zxing framework that caused the problem. You have to find out what is causing the issue in your setup.