I have just updated my Android Studio to Android Studio 0.8.2. But, after the update I kept getting these 3 errors while I was trying to run my project:
1. First error
Error:Execution failed for task > java.io.FileNotFoundException: C:\Program Files (x86)\Android\android-studio\sdk\tools\proguard\proguard-android-optimize.txt (The system cannot find the path specified)
2. Second error (this happened only after the 1st error had been fixed)
Error:Execution failed for task > Manifest merger failed : uses-sdk:minSdkVersion 9 cannot be smaller than version L declared in library com.android.support:appcompat-v7:21.0.0-rc1
3. Third Error (when running the app for Android L)
Error:compileSdkVersion android-L requires compiling with JDK 7
1. First error solution As a workaround I did the following steps:
- downloaded the proguard txt file (you can download it from here:[ddownload id=”453″ text=”proguard-android.txt”]).
- renamed it from proguard-android to proguard-android-optimize.txt
- created a new folder and named it proguard under
C:\Program Files (x86)\Android\android-studio\sdk\tools\
I don’t know exactly why I got this error as on my the other PC I did the update and everything was ok, but I found on the internet that there are other developers who had this problem (here). 2. Second error solution So after some research I found out that in one of my modules I had this in the dependencies from build.gradle:
which I suppose represents the latest version which is 21.0.0. The support libraries of the preview of Android L work only if the minSDK is Android L. So, as in my case as I didn’t want to run the app for Android L, I had to set specifically the appcompat-v7 to 20 (the latest one before Android L). Below is the code:
3. Third Error Solution
This means that Android L is working only with jdk 7. So in order to fix this error you have to do the following steps:
3.1. Install jdk 7. You can download the .dmg and .exe files from here.
3.2. After the dmg is downloded click on it to install the jdk.
3.3. After the jdk is installed open Project Structure from here:
or from File – Project Structure.
3.4. Now JDK location should be changed from :
Notice that on Mac OS they changed the path from /System/Library to /Library!
Change JDK location from:
Search In Blog
Want to donate?
Recent Posts: My Android Solutions
If you ever wondered how to read and parse a simple JSON file stored in the assets directory of your Android project, here is a way to do it.
In this tutorial I will create a simple Sectioned RecyclerView that will show 2 sections and a few items in each section and how to move an item from one section to another. Note: For RecyclerView I used AndroidX imports and not android.support.v7.widget.RecyclerView! Setup We need to import the recycler view from AndroidX. The build.gradle…
Recently, I had to add a perfect square CardView and I wanted to achieve this without hardcoding its width and height. I happily discovered the power of ConstraintLayout and this is how I managed to create a perfect square which should work on every dimension. In my project I created a RecyclerView with 2 columns,…