posted Dec 18, 2013, 7:02 PM by Tor Norbye
We've just released Android Studio 0.4.0, with the following improvements:
- Support for the new Android Gradle plugin, 0.7.0, which has improvements for render script, lint, BuildConfig, ProGuard, and additional features around source folders and flavors, along with many bug fixes. For more information, see the Build System documentation.
- Note that Studio 0.4.0 requires the the new version of the Gradle plugin, so you have to migrate your projects to 0.7.0. If you just update your IDE, after loading your old project the IDE will show this error balloon:
At this point you can click on the "Search in build.gradle files" link, which will locate the gradle version definition:
Change those to "0.7.0" (or 0.7.+ to pick up the latest dot release) :
Now you need to sync the project model. (Yes, we're still working on detecting these changes more intelligently). Click on the "Sync Project with Gradle Files" toolbar button:
If you're using the Gradle wrapper, you also need to switch it from Gradle 1.8 to Gradle 1.9. If you don't, the sync will show the following error balloon:
Just click the error link to have Studio automatically convert the wrapper and you're all set.
Studio now supports Gradle Offline mode. This is useful if you find yourself without a network connection, and your dependencies are using the plus-syntax to pick up the latest available version. In that case, Gradle will once per day (by default) connect to the artifact repository to see if there is a more recent version. If that network connection fails, the build fails. If you don't have a network connection, this is problematic. You can now open the Compiler > Gradle options and enable Offline mode, which will tell Gradle to ignore update-to-date checks:
Note that if you add a new dependency you'll still need to have a network connection to download the artifact. If you somehow forget that you are in offline mode, there is a balloon tip for that:
- Initial Eclipse (ADT) project import. You can now directly import Eclipse projects (rather than having to export them to Gradle from Eclipse as in the past). This importer also makes structural changes to the import:
- It migrates the project structure from the old ADT directory structure to the new Gradle-build system one
- It removes inlined library projects that it recognizes (ActionBarSherlock, v7 GridLayout) and replaces the source code with a simple Gradle dependency to the corresponding library
- Similarly it removes .jar files that it recognizes and replaces them with Gradle dependencies
- It generates an import summary where it lists potential import issues (for example, if you were using library projects without manifest merging, there is potential manifest registration duplication now)
- (The import does not yet fully support path variables and linked resources; this will be fixed in 0.4.1)
- The Asset Studio wizard is now available (until this point it was only available as part of the New Project wizard for generating launcher icons). Right click on a drawable folder and invoke "New > Image Asset":
You can also create nine-patch images now by right clicking on .png images and invoking "Create Nine Patch...".
A large number of bug fixes, particularly around SDK handling and project import/upgrade, but also to the rendering sandbox, custom view rendering, template handling, etc.
If you are already running Android Studio, just restart it, or manually check for updates via Help > Check for Update... (on OSX, look in the Android Studio menu). This will download and install a small patch rather than download a full IDE image.
If you need to download a full install, visit the Android Studio Canary Build 0.4.0 page. Note that if you are currently running 0.2.10 or 0.2.11, on Mac OSX, you will not be able to patch update to 0.3.4; you will need to install a fresh build due to a bug in the patch updater in those versions.
If you run into problems, be sure to check the Known Issues page which we'll update as necessary.