When I try to run an Android emulator, I get the following error screen. The same occurs when I export the apk. When I go to the directory where the apk will be saved, the a
I had this issue too. It caused by mistake in dimens.xml (git helps me found it).
I used
<dimen name="map_search_view_top_margin">100</dimen>
instead
<dimen name="map_search_view_top_margin">100dp</dimen>
Hope it helps.
In my case the root of the problem was, I deleted some resources that some xml files were refering to, and in that case neither of "Clear Project" "Rebuild Project" "Gradle VM Option" or "deleting .gradle folder" helped at all.
What more to say is, none of the mentioned xml files were in use, and no error was displayed anywhere. I only detected the problem when (in desperate) sync'ed Gradle, and then opened the Gradle console and scrolled up and read the red error lines.
Note the error will usually be listed as the first line (improperly formatted for Android Studio Gradle console such as:
AGPBI: {"kind":"error","text":"Float types not allowed (at \u0027icon_alpha_active\u0027 with value \u00270.75\u0027).","sources":[{"file":"/Users/mingsheng/path/to/my/errenous/integers.xml","position":{"startLine":5,"startColumn":38,"startOffset":272,"endColumn":42,"endOffset":276}}],"original":""}
Where "text" = error message, "sources: file" = errenous filepath/name
In this example, I have entered a Float value in the integers file.
I am often getting that error when I have a typo in my xml. Open the gradle console and scroll up to the first red lines that appear. It will tell you the exact problem.
I had the same issue. After an hour of struggle, it's finally fixed.
First I updated Android Studio to 1.3.2. That did not fix the problem immediately, but at least it gave a proper error when trying to run the application.
(for me, there was something wrong with JAR dependencies so I removed them and it's running now, but that's probably irrelevant)
None of the solutions worked for me. So I found this solution here:
My Android Studio was using JDK 1.8, so I switched back to JDK 1.7 and now it is working!
Go to
File > Project Structure > SDK Location
I had JDK Location set as jdk1.8.0_05. I just changed it to jdk1.7.0_79 and everything works fine now.