A bug in preview 5 means that building non-Gradle projects in the IDE is not working well. (Note - this isn't a supported and tested scenario; Android Studio has never let you create non-Gradle projects, but we've tried not to break it.)
If you're currently using Android Studio 2.0 Beta, you cannot create AVDs with the N Preview system images, so you currently need to use the Android Studio 2.1 preview to create AVDs until a fix is applied to the 2.0 channel.Instant Run currently is not compatible with the Jack compiler, so it is disabled for projects configured to use the Jack compiler until the fix is applied. (Using the Jack compiler is necessary only when using Java 8 language features.)
Various tools that read .class files (such as JaCoCo, Mockito, and some lint checks) are currently not compatible with the Jack compiler.
The issue is that the Gradle daemon is trying to use IPv4 instead of IPv6.
Workaround 1: On Linux, put the following in your ~/.profile or ~/.bash_profile: export _JAVA_OPTIONS="-Djava.net.preferIPv6Addresses=true"
Workaround 2: in Android Studio's vmoptions file, change the line -Djava.net.preferIPv6Addresses=true to -Djava.net.preferIPv6Addresses=trueMore details: Networking IPv6 User Guide
The root cause is a missing certificate in
The specific render error message is:
Despite the error message, the layout preview is correct and the message can be safely ignored. The issue has already been fixed in 2.0 preview. See bug 192102 for more details.
The specific render error message is:
This is bug 170841 which will be fixed in version 1.2.3 of the Android Gradle plugin.
Workaround 1: First manually build the project, then manually sync the project (using the Sync with Gradle files in the toolbar, or from the Tools > Android menu), then finally press Refresh in the toolbar above the layout editor.
Workaround 2: Switch the Android Gradle plugin from 1.2.x to 1.1.3 for now. When 1.2.3 is released you can switch back to the 1.2.x versions.
Workaround 3: Try updating to Android Studio 1.3 Canary. Please report back on the issue tracker whether it worked for you or not.
There are some known interactions between the iBus daemon on Linux and Android Studio. This is discussed more in this document: Android Studio & ibus-daemon interactions.
In Android Studio 1.2 Preview 1 & 2, selecting "Update & Restart" to update from one version to the next, does not actually restart. Just manually exit the IDE, and start it again. Once you do that, the patch will be installed and the IDE updated.
There was a bug in the find_java.bat command that shipped with SDK Tools 24.0.0. This was fixed in version 24.0.1, but unfortunately, that command is used on some systems to launch the SDK Manager itself.
If you are unable to launch the SDK Manager to update, you can download find_java.zip from this page, and unzip it into the root of your Android SDK installation; it will replace the files
(If you are using Android Studio 1.0.1, the IDE will prompt you to update to tools 24.0.1 which it will do inside the IDE, so that update should work without needing to call
If you are updating from Android Studio 0.8.x to Android Studio 1.0.0-RC, you'll need to update your Gradle plugin version from 0.13.x to 1.0.0-rc4. There were a couple of last minute API changes; for example, change "runProguard" to "minifyEnabled", etc. See the release notes under http://tools.android.com/tech-docs/new-build-system for more details on the changes if you run into build/Gradle sync issues.
Please see the migration document.
If your build fails with an error message like this:
you are using an obsolete version of the Android support libraries. Open up the SDK manager and update to the latest (non-preview) versions.
When updating to version 0.8.13 or newer, the patch installation may detect the Android SDK folder inside your application folder. If this occurs, you must move your sdk folder outside of the application folder for the update to take place. Once Android Studio is updated, on its first run it will ask you for the location of the sdk. Projects that were referencing the old sdk location will be automatically updated once opened in Android Studio. We do not recommend moving the sdk directory back into Android Studio as this would interfere with the application signature, particularly on MacOS, and would prevent future updates to do verifications and avoid corrupted installations. More information in issue 78129.
To move the SDK folder in Windows or Linux, simply go to Android Studio's folder and drag the "sdk" folder to another location, such us your user directory or alongside Android Studio's folder. On MacOS go with Finder to the application folder called "Android Studio.app", right click on it and select "Show Package Contents". When its contents are shown you can now drag the "sdk" folder to its new location.
(We have some additional information and screenshots for this in Android Studio 0.8.14 in Beta Channel).
Issue: If you have specific resource folders in your Java modules, then those resources won't be found when running tests from the IDE. Running tests using Gradle from the command line will work. Executing the gradle check task from the IDE will also work. See Issue 64887 for more details.
This issue happens because as of IntelliJ 13, you can only have a single folder as the classpath. IntelliJ's builder copies all resources into that build folder. But Gradle doesn't copy over the resources.
You can use any of the following workarounds until then:
- Run the gradle check task from the IDE rather than running a unit test
- Or update your build script to manually copy resources into the build folder. See comment #13.
When creating a new project, the template JUnit configuration may be created with two "Before launch" steps: Make and Gradle-aware Make. This is then propagated to all created JUnit run configurations. To fix the issue, go to Run -> Edit Configurations and change the default JUnit configuration to only include the Gradle-aware Make step. To fix this for all future projects, close the current project (File -> Close Project) to get to the welcome screen, select Configure -> Project Defaults -> Run Configurations and make the same change.
Not all run configurations that are available when right-clicking a test method are valid. Specifically:
Additional problem is that Android Studio remembers the run configuration created in a given context (e.g. right-clicking a given class/method) and will not offer to run a different one in the future. To fix this, go to Run > Edit Configurations and remove the incorrectly created configurations.
In Android Studio 0.8.3+:
Studio 0.8.3 does not work properly on Linux with the "Awesome WM" window manager version 3.4. It's supposed to work with 3.5.
JAyatana allows Java Swing applications to integrate with the global menu in Ubuntu's Unity graphical shell. We have reports of Studio running into a NullPointerException under Unity:
java.lang.NullPointerException at com.jarego.jayatana.swing.SwingGlobalMenu.getSwingGlobalMenuWindowController(SwingGlobalMenu.java:204) at com.jarego.jayatana.swing.SwingGlobalMenu.installLockParentGlobalMenu(SwingGlobalMenu.java:160) at ...
There are two possible workarounds:
Newer Ubuntu versions are also disabling JAyatana by default because of these unintended interactions with Java applications.
On Windows, files that are in use by a process cannot be deleted.
When you attempt to use the builtin update mechanism in the IDE, it sometimes refuses to install the update, usually providing an error message like "Can't delete C:\some\path\file".
To work around this, open the task manager and attempt to kill processes that may be using the file, such as any gradle daemons.
Google Play Services 5.0.77
If your builds suddenly stop working with this error message:
Error: Failed to find: com.google.android.gms:play-services:5.0.77
this is caused by the play services artifact being removed from the local Google Maven repository because it contained some critical bugs. It was been replaced by version 5.0.89 instead. (More information)
(This issue is fixed in Android Studio 0.8.6)
A new version of the Google Play Services library was released recently: 5.2.08. If you are using an older version of the library, Android Studio will automatically offer to upgrade it to the new version. However, due to a bug, it drops the leading zero in "08", which means it replaces the dependency with "5.2.8" instead of "5.2.08" which does not work. To fix this, edit the dependency to read "5.2.08" instead of "5.2.8". (More information).