Android Studio 2.2 doesn't generate R.java - android-studio

I can't create new projects anymore with this problem now despite my version is the latest 2.2.
Whenever I create a new project I get this message from gradle build:
Error:Execution failed for task ':app:compileDebugAidl'.
java.lang.IllegalStateException: aidl is missing

PROPLEM SOLVED:
android studio was notifying me of new updates to be installed and i made sure to check all (android SDK build tools) in tools packages folder in SDK manager

Related

How i can build old Android project in Android Studio

i have to build this project but getting error because it is so old.
here is the project git hub link
i am using latest android studio version
Try the following:
Change gradle version in build.gradle , change the version in the following line in the file: classpath 'com.android.tools.build:gradle:2.2.3'.
In the file gradle/wrapper/gradle-wrapper.properties, update the gradle version in this line: distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip . Sync the project again, it should work. If it doesn't restart android studio again. It should build successfully afterward.
PS: See what gradle version you use according to your android studio version.

How to use downloaded patch file of android studio again?

I was downloading an update for android studio. After the download was finished, there was some issue and the patch was not applied. Is there a way to use that downloaded file again? I don't want to download again because it will take a lot of time.
PS I'm using ubuntu.
To solve the “failed to apply patch” Android Studio problem you can follow these steps:
Move the Android SDK folder out of the Android Studio folder (quit Android Studio first).
Redo the Android Studio update process.
Once the update is complete, you will be prompted to enter the new location of the Android SDK.
If these steps do not work for you, update your Java runtime engine (JRE) and development kit (JDK) to the latest version. Alternatively, you could also just download the latest Android Studio build, install it (after renaming the folder of the previous build), and import your projects from the old buggy build.

Failed to find Build Tools revision 25.0.2 but they are installed

I am getting the error "Failed to find Build Tools revision 25.0.2" but when I go to android SDK manager, over to SDK Tools, check 'show package details', under Android SDK Build-Tools, it shows 25.0.2 as installed.
It is installed in {USER}/Library/Android/sdk/build-tools/
I'm running Android Studio 2.3.3. Is there anything obvious I'm doing wrong?
Fixed by invalidating cache & restarting (in file menu)
In file build.gradle you have to change the line:
buildToolsVersion:{version} to
buildToolsVersion:25.0.2
as pointed out here:
Gradle sync failed: failed to find Build Tools revision 24.0.0 rc1
Ensure that google maven is added to your project build.gradle:
maven {
url 'https://maven.google.com/'
name 'Google'
}
and buildToolsVersion:25.0.2 is updated to 25.0.3 (or newer)

Kotlin app build failed due to "Could not initialize class com.intellij.ide.highlighter.JavaFileType"

I've just updated Android Studio to 2.2 and now my Kotlin project won't build. The gradle synch works fine, but when attempting to build I'm immediately presented with an error that reads:
Error:Execution failed for task ':app:compileDebugKotlin'.
> Could not initialize class com.intellij.ide.highlighter.JavaFileType
I've checked that my Kotlin plugin is up to date. This error sounds like something to do with the IDE and highlighting Java code? Any help would be appreciated.
Open Tools | Kotlin | Configure Kotlin Plugin Updates in the main menu,
then choose Check for Updates. Be sure that yo're using Stable channel.
Close Android Studio, go to your project's directory, and delete build and app/build folders. Run Android Studio. Deleted folders would be recreated.
Hope it will help
In my case the kotlin plugin was not updated as #piotrek1543 said in other answer.
In addition to that the build.gradle had an old Kotlin version number 1.0.1-2 and the IntelliJ said in a warning on top of to switch to the current bundled version 1.0.4.
Now with the kotlin version like this the error is gone:
ext.kotlin_version = '1.0.4'

Gradle 'TestApp' project refresh failed

I am new to android studio. I have installed android studio 2.1 and imported an eClipse project into it as my first project. After finishing import job, an error occurred with this title:
Gradle 'TestApp' project refresh failed
►Error:A problem occurred configuring project ':app'.
I notice that in Tools > Android > SDK manager > System Settings > Android SDK > SDK Update Sites there are errors with Android Repository and Legacy Android Repository.
Android Repository https://dl.google.com/android/repository/repository2-1.xml
Legacy Android Repository https://dl.google.com/android/repository/repository-12.xml
I have reinstalled Android studio and then installed and updated all extra fields in SDK manager. I have Android 4.4.2 and 5.0.1 SDK platforms. I Have all tools items installed in SDK manager.
There are no errors in Standalone SDK Manager.
I tried creating a new project. But same error appears.
How can I resolve the issue and run this app?
I restarted the Android SDK Manager and at this time I noticed that I got Android SDK Platform-tools (upgrade) and Android SDK Build-tools (new).
After installing those, I was finally able to fully compile my project.
Note: The latest ADT (Version 23) should be installed.

Resources