When trying to build OpenStreetMapView from git://github.com/osmdroid/osmdroid, I get this error:
failed to find target with hash string android-23: D:\Users\myusername\AppData\Local\Android
How can I fix this? Previous questions similar to this suggest checking that android 23 is not installed, but in my case, it is.
Below is some pertinent info:
ANDROID_HOME is D:\Users\myusername\AppData\Local\Android\sdk
D:\Users\myusername\AppData\Local\Android\sdk\platforms\ contains the directory \android-23\, (as well as android-19, android-21, android-22, android-MNC)
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "org.osmdroid.example"
minSdkVersion 8
targetSdkVersion 23
versionCode 16
versionName "4.4-SNAPSHOT"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
}
lintOptions {
abortOnError false
}
}
dependencies {
compile 'android.support:compatibility-v4:23+'
compile project(':osmdroid-android')
//compile 'org.osmdroid:osmdroid-third-party:4.4-SNAPSHOT'
}
I tried changing targetSdkVersion and compileSdkVersion to 22. This causes the error message to change to "android-22" instead of "android-23".
SDK Manager:
In my case, clearing caché didn't work.
On SDK Manager, be sure to check the box on "show package descriptions"; then you should also select the "Google APIs" for the version you are willing to install.
Install it and then you should be ok
In Android Studio File -> Invalidate Caches/Restart solved the issue for me.
The answer to this question.
Gradle gets stupid from time to time and wiping out the cache is the only solution that I've found. You'll find a hidden .gradle folder under your user home folder and another one wherever the checkout location is for osmdroid.
I fixed the issue for me by opening the Android SDK Manager and installing the build tools for all 23.x.x versions.
See the screenshot.
Update: Does not apply to the Android Studio released after this answer (April 2016)
Note: I think this might be a bug in Android Studio.
Go to Project Structure
Select App Module
Under the first tab "Properties" change the Compile SDK Version to API XX from Google API xx (e.g. API 23 instead of Google API 23)
Press OK
Wait for the completion of on going process, in my case I did not get an error at this point.
Now revert Compiled Sdk Version back to Google API xx.
If this not work, then:
With Google API (Google API xx instead of API xx), lower the build tool version (e.g. Google API 23 and build tool version 23.0.1)
Press Ok and wait for completion of on going process
Revert back your build tool version to what it was before you changed
Press Ok
Wait for the completion of process.
Done!
Following these reccomended directions seemed to work:
Hint: Open the SDK manager by running: /path/to/android/tools/android
You will require:
1. "SDK Platform" for android-23
2. "Android SDK Platform-tools (latest)
3. "Android SDK Build-tools" (latest)
There are 2 solutions to this issue:
1) Download the relevant Android SDK via Tools -> Android -> SDK Manager -> SDK Tools (ensure you have 'Show Package Details') checked. Your case would be Android 6.0 (Marshmallow / API level 21)
2) Alternatively, open your build.gradle file and update the following attributes :
compileSdkVersion
buildToolsVersion
targetSdkVersion
either to the most recent version of the Android API that you have installed / another installed version you'd like to use (although I'd always recommend going with the latest version for the usual reasons: bug fixes etc.)
If you're following step 2 it's also important that you remember to update the Android support library version if your app is using it. This can be found in the dependencies section of your build file and looks something like this:
compile 'com.android.support:appcompat-v7:27.0.2'
(replace 27.0.2 with the most recent support library version for the API level you intend to use with your app)
Had the same issue with another number, this worked for me:
Click the error message at top "Gradle project sync failed" where the text says ´Open message view´
In the "Message Gradle Sync" window on the bottom left corner, click the provided solution "Install missing ... "
Repeat 1 and 2 if necessary
23:08 Gradle sync failed: Failed to find target with hash string 'android-26' in: C:\Users\vik\AppData\Local\Android\Sdk
Android SDK providing a solution in the bottom left corner
For me the problem was in that I wrote compileSdkVersion '23' instead of 23. The quotes were the problem.
It worked for me by changing compileSdkVersion to 24 and targetSdkVersion to 24 and change compile to com.android.support:appcompat-v7:24.1.0
This poblem is solved for me after Run as administrator the Andorid Studio
Open the Android SDK Manager and Update with latest.
Nothing worked for me. I changed SDK path to new SDK location and reinstalled SDK.Its working perfectly.
Tools > Android > SDK Manager.
I had this issue when using windows. It turned out that the SDK location in my profiles was the issue. So I had to relocate my SDK folder to documents and then it worked.
Mine was complaining about 26. I looked in my folders and found a folder for 27, but not 26. So I modified my build.gradle file, replacing 26 with 27. compileSdkVersion, targetSdkVersion, and implementation (changed those numbers to v:7:27.02). That changed my error message. Then I added buildToolsVersion "27.0.3" to the android bracket section right under compileSdkVersion.
Now the make project button works with 0 messages.
Next up, how to actually select a module in my configuration so I can run this.
Download the specific Android release from the link specified in the build console.
The problem is caused because the code you are running was created in an older API level, And your present SDK Manager doesn't support running them.
So do try the following;
1.Install the SDK Manager that support API level 23.
Go to >SDK Manager, >Android SDK , then select API 23 and install.
2.second alternative is to update your build.grade app module to change
compileSdkVersion,compile,and other numbers to your currently supported API level.
Note:please ensure to check the API and Revision numbers and change them exactly. otherwise Your project won't synchronize
Ensure the IDE recognizes that you have the package. It didn't on mine even after downloading 28, so I uninstalled then reinstalled it after realizing it wasn't showing up under File-Project Structure-Modules-App as a choice for SDK.
On top of that, you may want to change your build path to match.
Slightly related, the latest updates seem able to compile when I forced an update all the way to 28 for CompileSDK, and not just up to the new API 26 min requirement from Google Play. This is related to dependencies though, and might not affect yours
AndroidSDK > SDK platforms > and install API Level 23
Related
I am getting the error: "Ambiguous method call" on initializing Toolbar using Android Studio 3.0 RC1. I have extended my Activity with AppCompatActivity and compiling my application using 'compileSdkVersion 26'.
Attaching a screenshot of the error.
If you recently updated your project to API, Try doing
File -> Invalidate Caches / Restart
then
File -> Sync Project with Gradle Files
this resolve for me.
Upgrade to appcompat 27 solved this for me
For me, it was the compileSdkVersion which was different than the support libraries used
You have
import android.support.v7.app.AppCompatActivity
import android.app.Activity
both in your code.
Remove import android.app.Activity as I can see, it's not required for you.
For me changing build tool version to 27.0.2 worked, given that all your other dependencies are API 27 as well.
buildToolsVersion '27.0.2'
I have recently upgraded to build tools version 27.0.2 and faced the same problem. But noticed that I had the compileSdk version set to 25. Changing compileSdk to 27 resolved the issue.
"File - Invalidate Caches / Restart" Solved my problem.
For me none of the given solutions worked, however I had this issue because I had both 25 and 27 android sdk installed on my computer. As soon as I removed the sdk 25, the problem disappeared.
This can suddenly appear when running a code analyzer like FindBugs-IDEA. A quick way to clear the warning is to temporarily change the buildToolsVersion in your app/build.gradle then change it back again.
For example, follow these steps:
Open your app/build.gradle file.
Change buildToolsVersion to '26.0.1' then sync project (press the 'Sync Now' button when it appears at the top)
Change the buildToolsVersion back to whatever you had before.
Press the 'Sync Now' button
This should clear the error.
Maybe you have difference between compileSdkVersion and targetSdkVersion
I ran into the same issue with Android Studio 3.0.0 build 171.4408382. Building via Gradle on the command line worked just fine, but the IDE presented me with the above mentioned error. I have tried to use API level 26 with appcompat v26.1.0 and API level 27 with appcompat v27.0.1, but neither combination worked.
My "solution" was to downgrade compileSdkVersion and targetSdkVersion to API level 25 and the appcompat library to version 25.4.0.
For all of the mentioned version combinations I used Gradle plugin v3.0.0 and the Android build tool v27.0.1.
In my case, I removed the constraint layout dependency in the build.gradle (app) file and it solved the issue.
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:25.1.0'
//implementation 'com.android.support.constraint:constraint-layout:2.0.4'
}
if answers does not resolve your problem , you can reset your android studio.
I solved with reset my android studio.
For reset: https://stackoverflow.com/a/19397632/3129822
First make sure that you have no transitive dependencies that are using older support libraries. Run the following command and make sure that no older support libraries are in use.
gradlew :app:dependencies
Make sure that your gradle file is updated with latest dependencies. eg: compileSdkVersion 27, targetSdkVersion 27, buildToolsVersion 27.0.3. etc. It would also benefit to make sure that non of your app flavors have been using a custom targetSdkVersion.
Ctrl + click on the findViewById method. It will show you the 2(perhaps more?) conflicting methods. In my case the conflict was between the findViewById method from API 23 and API 27. Therefore I had to remove the SDK and sources for Android version 23. Once I removed it and did Invalidate Caches/Restart it solved my problem.
My compileSDK version was lower than the targetSDK version so all I had to do was match them and sync project and the error was resolved.
Removing "Android Fast Networking" library solved my problem
I've had the same issue
Mine was related to the compileSdkVersion number from build.gradle app.
Changed to the latest and it worked for me.
Upgrading your targetSdkVersion or buildToolsVersion might resolve the problem.
No need to Invalidate Caches / Restart if this is a new project.
I was working with a new project and in gradle files did not have version numbers set in them, there was "N" across minsdkversion and targetsdkversion, changing to desired sdk version solved the problem
Upgrading both appcompat to 27 and compleSdkVersion to 30 works for me.Just upgrade those in gradle build.
Just upgrade your minSdkVersion 26 Its works for me.
When we create a Android project with minimum SDK lower than 16 and after that we want to add new activity using 'New/Activity/Gallery' we see the indication 'Selected activity templates has minimum SDK level of 16'. So we need to modify 'minSdkVersion' in build.gradle file which leads us to 'Sync Now' process.
If we must build and maintain an app with min SDK lower then 16, we have to change 'constraint layout' to another layout. However when we do this the constraint layout dependency still remains in the dependencies section in the 'build.gradle' file. This caused me the error.
In summary, this is applicable when we need to build a android project with minimum SDK version lower than 16.
When we add a new activity, we change the minSdkVersion in the build.gradle above '16' then click of 'Sync Now'. After that we can choose one of activity template and create a new activity.
Now we change 'constraint layout' in the xml file corresponds to the new activity we created to for example 'linear layout' or 'relative layout'
At this point we make sure delete the dependency which refers to constraint layout in the 'build.gradle' and then click the 'Sync Now' again.
I think the best practice to avoid this error message is to make Android project with minimum SDK 16 and above.
These steps worked for me on Android Studio for Mac (Arctic Fox v11):
In 'build.gradle' file (for module), change appcompat implementation version to something invalid (e.g. Change 'com.android.support:appcompat-v7:25.1.0' to 'com.android.support:appcompat-v7:25')
Click 'Gradle sync now' and let it finish. This should generate lots of errors
Correct the verison back to original (e.g. 'com.android.support:appcompat-v7:25.1.0'). Click 'Gradle sync now' and let it finish
Original issue with findViewId should disappear
so i reinstalled linux on my computer and after i reinstalled android studio i tried getting an app that i wrote on to my phone which previously had not been a problem. The App ist targeted at devices with API 16 or higher but apparently Android Studio now features something called N preview which does not let me run anything on my phone. specifically when i hit the run button it tells me that
minSdk(API 23, N) != device Sdk(API 22)
i know this seems as though the target API isnt set correctly but when i started the project i set it to 16. Now how do i get around this? Also whats the cleanest way to change the target API on a project? Do i just change the build gradle?
Thanks a lot!
app gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 'android-N'
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.example.josias.myapplication"
minSdkVersion 16
targetSdkVersion 'N'
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.+'}
Change
compileSdkVersion 'android-N' to compileSdkVersion 22 and targetSdkVersion 'N' to targetSdkVersion 22
The same happened to me on Android Studio, so I could not start a new emulator.
I had to:
Gradle Scripts -> build.gradle (module:app) -> minSdkVersion 14
(update "minSdkVersion" value to "14".
Now I am able to start a new emulator.
See the explain of CommonsWare. The key point is a preview version, so
older level device was prevented to install app anyway when using N compileSdkVersion.
This wortk for me in Android Studio: hold ctl+alt+shift press 'S', This will open project structure. Click on the tab 'Flavors', check in min sdk version if appear a version of your device sdk if you see select it and click 'OK', but if you didn't see a option for your sdk device click on cancel. Go to build.gradle(app) file and type in the min sdk version the version of your sdk device(android studio will recomend you to intall the version sdk). After that hold ctl+alt+shift press 'S' and the version sdk min will be there, just select it and click 'ok'. :)
check your build.gradle file to ensure the proper min sdk is set...android studio overrides the manifest with the build.gradle
I renctly encountered this problem, and this is very strange, on the other thread there's people suggest you should change you usb setting to "MTP/FTP" or something, this doesnt make sense and dont work out on my case.
After search some example case in this problem, I found that most of people have this problem when minSDK/'targetSDK'/'compileSdkVersion' is not a int but a letter.
I changed my MNC/N' to 23, andbuild - clean build`, problem solved.
hope it can help someone.
Change the minSdkVersion to your target device sdkVersion in build.gradle(Module:app)file will be appear on left side in Gradle Scripts.. Ex: minSdkVersion 24 //change the version value to ur target device value(like 23 or 22 or 21 or etc)
According to your configuration you have to change the minSdkVersion 23 to minSdkVersion 22, becoz your target device at API LEVEL 1
you can do a thing just open the sdk manager since i had one and just install ,the ÄNDROID N (API 23 N PREVIEW PACKAGES) give it a try instead of changing the gradle files
Changing the minSdkVersion may not always help. Check your SDK Manager, as already suggested, and make sure that you have the necessary versions installed as well (I had changed mine in Gradle, but it only made things worse on my end).
When trying to build OpenStreetMapView from git://github.com/osmdroid/osmdroid, I get this error:
failed to find target with hash string android-23: D:\Users\myusername\AppData\Local\Android
How can I fix this? Previous questions similar to this suggest checking that android 23 is not installed, but in my case, it is.
Below is some pertinent info:
ANDROID_HOME is D:\Users\myusername\AppData\Local\Android\sdk
D:\Users\myusername\AppData\Local\Android\sdk\platforms\ contains the directory \android-23\, (as well as android-19, android-21, android-22, android-MNC)
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "org.osmdroid.example"
minSdkVersion 8
targetSdkVersion 23
versionCode 16
versionName "4.4-SNAPSHOT"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
}
lintOptions {
abortOnError false
}
}
dependencies {
compile 'android.support:compatibility-v4:23+'
compile project(':osmdroid-android')
//compile 'org.osmdroid:osmdroid-third-party:4.4-SNAPSHOT'
}
I tried changing targetSdkVersion and compileSdkVersion to 22. This causes the error message to change to "android-22" instead of "android-23".
SDK Manager:
In my case, clearing caché didn't work.
On SDK Manager, be sure to check the box on "show package descriptions"; then you should also select the "Google APIs" for the version you are willing to install.
Install it and then you should be ok
In Android Studio File -> Invalidate Caches/Restart solved the issue for me.
The answer to this question.
Gradle gets stupid from time to time and wiping out the cache is the only solution that I've found. You'll find a hidden .gradle folder under your user home folder and another one wherever the checkout location is for osmdroid.
I fixed the issue for me by opening the Android SDK Manager and installing the build tools for all 23.x.x versions.
See the screenshot.
Update: Does not apply to the Android Studio released after this answer (April 2016)
Note: I think this might be a bug in Android Studio.
Go to Project Structure
Select App Module
Under the first tab "Properties" change the Compile SDK Version to API XX from Google API xx (e.g. API 23 instead of Google API 23)
Press OK
Wait for the completion of on going process, in my case I did not get an error at this point.
Now revert Compiled Sdk Version back to Google API xx.
If this not work, then:
With Google API (Google API xx instead of API xx), lower the build tool version (e.g. Google API 23 and build tool version 23.0.1)
Press Ok and wait for completion of on going process
Revert back your build tool version to what it was before you changed
Press Ok
Wait for the completion of process.
Done!
Following these reccomended directions seemed to work:
Hint: Open the SDK manager by running: /path/to/android/tools/android
You will require:
1. "SDK Platform" for android-23
2. "Android SDK Platform-tools (latest)
3. "Android SDK Build-tools" (latest)
There are 2 solutions to this issue:
1) Download the relevant Android SDK via Tools -> Android -> SDK Manager -> SDK Tools (ensure you have 'Show Package Details') checked. Your case would be Android 6.0 (Marshmallow / API level 21)
2) Alternatively, open your build.gradle file and update the following attributes :
compileSdkVersion
buildToolsVersion
targetSdkVersion
either to the most recent version of the Android API that you have installed / another installed version you'd like to use (although I'd always recommend going with the latest version for the usual reasons: bug fixes etc.)
If you're following step 2 it's also important that you remember to update the Android support library version if your app is using it. This can be found in the dependencies section of your build file and looks something like this:
compile 'com.android.support:appcompat-v7:27.0.2'
(replace 27.0.2 with the most recent support library version for the API level you intend to use with your app)
Had the same issue with another number, this worked for me:
Click the error message at top "Gradle project sync failed" where the text says ´Open message view´
In the "Message Gradle Sync" window on the bottom left corner, click the provided solution "Install missing ... "
Repeat 1 and 2 if necessary
23:08 Gradle sync failed: Failed to find target with hash string 'android-26' in: C:\Users\vik\AppData\Local\Android\Sdk
Android SDK providing a solution in the bottom left corner
For me the problem was in that I wrote compileSdkVersion '23' instead of 23. The quotes were the problem.
It worked for me by changing compileSdkVersion to 24 and targetSdkVersion to 24 and change compile to com.android.support:appcompat-v7:24.1.0
This poblem is solved for me after Run as administrator the Andorid Studio
Open the Android SDK Manager and Update with latest.
Nothing worked for me. I changed SDK path to new SDK location and reinstalled SDK.Its working perfectly.
Tools > Android > SDK Manager.
I had this issue when using windows. It turned out that the SDK location in my profiles was the issue. So I had to relocate my SDK folder to documents and then it worked.
Mine was complaining about 26. I looked in my folders and found a folder for 27, but not 26. So I modified my build.gradle file, replacing 26 with 27. compileSdkVersion, targetSdkVersion, and implementation (changed those numbers to v:7:27.02). That changed my error message. Then I added buildToolsVersion "27.0.3" to the android bracket section right under compileSdkVersion.
Now the make project button works with 0 messages.
Next up, how to actually select a module in my configuration so I can run this.
Download the specific Android release from the link specified in the build console.
The problem is caused because the code you are running was created in an older API level, And your present SDK Manager doesn't support running them.
So do try the following;
1.Install the SDK Manager that support API level 23.
Go to >SDK Manager, >Android SDK , then select API 23 and install.
2.second alternative is to update your build.grade app module to change
compileSdkVersion,compile,and other numbers to your currently supported API level.
Note:please ensure to check the API and Revision numbers and change them exactly. otherwise Your project won't synchronize
Ensure the IDE recognizes that you have the package. It didn't on mine even after downloading 28, so I uninstalled then reinstalled it after realizing it wasn't showing up under File-Project Structure-Modules-App as a choice for SDK.
On top of that, you may want to change your build path to match.
Slightly related, the latest updates seem able to compile when I forced an update all the way to 28 for CompileSDK, and not just up to the new API 26 min requirement from Google Play. This is related to dependencies though, and might not affect yours
AndroidSDK > SDK platforms > and install API Level 23
I have an Android project targetting the Android SDK v21. Now I need to debug it on a device with Android 4.4 (i.e. SDK v20). How do I tell Android Studio to attach an older version of the source to the internal classes so that I can step through them?
Here the best solution is to set compile SDK version to 20. So that build tools will compile your project using SDK version 20 and you can debug your app.
When you use several modules in your project you need to set same compile SDK version to each module.
I can not confirm my answer works, but it is working for me.
I replace my compileSdkVersion, buildToolsVersion, minSdkVersion and targetSdkVersion with new one like following in my build.gradle file.
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.example.mytest"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
After changing it, you may not need to convert old to new or new to old sdk component.
You need to open module settings (Right click on your app module and select Open Module Settings or just select module and press ⌘ + ↓ on Mac)
And select compileSdk and buildTools to v20
Another way to do it is to open build.gradle file for the "app" module to change compileSdk and buildTools.
I would like to explain little before the solution.
Google provides the SDK APIs in the form of JAR (android.jar) files. The JAR files are stored at SDK LOCATION\platforms\android-API#.
For example the android.jar file for the Android 4.4(Kitkat) API-19 is located at YOUR SDK LOCATION\platforms\android-19\android.jar.
The Gradle compilation with the Android Studio uses the compileSdkVersion field in the build.gradle to select a specific android.jar for the compilation.
What is compileSdkVersion?
The version of the API the app is compiled against.
This means you can compile and use Android API features included in that version of the API
All the previous version features are also included during compilation.
If you try and use API 21 feature, such as public void openCamera (String cameraId, CameraDevice.StateCallback callback, Handler handler)
Added in API level 21 but set compileSdkVersion to 20, you will get a compilation error.
If you set compileSdkVersion to 21 you can still run the app on a API 20 device as long as your app's execution paths do not attempt to invoke any APIs specific to API 21.
How to set compileSdkVersion?
There are two ways
1. Selecting API from the GUI
1) Select "File->Project Structure..."
2) Select "app->Properties"
3) Set the "Compile Sdk Verion" from the drop down box to the required SDK version.
4) "compileSdkVersion" will be set automatically in the "app" module's
"build.gradle" file.
2. Setting the API in the gradle.build file
1) Open the build.gradle file of the "app" module
2) Set the compileSdkVersion to required value such as 19 for the API#19.
I hope that helps...
Happy Coding...
The best solution for me was to add a new module (Android Library) to the project and set the compile SDK to the requested api level. That way you can still compile your main app with the original SDK level but still get the sources integrated with your debugging Android version.
You can create a new Android Virtual Device with the preferred API level and debug the application on it.
Simply open module settings and change compileSdk and buildTools to v20
I'm following the Google I/O conference and just a week before they announced that Android Studio 0.8 is available for downloading. Before that I used 0.6 and I was developing an application. Now I'm having both 0.6 and 0.8 on my Ubuntu. I added all the update from SDK for Android Watch and TV and all the Material Design stuffs. And today when I opened my project in the 0.8 version, after a few updates of some things, I'm receiving an error
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 8 cannot be smaller than version L declared in library com.android.support:appcompat-v7:21.0.0-rc1
If someone has any idea what is this all about - share please. I tried to pull my project from my repository in GitHub, but without any result. Thank you.
It looks like you have declared a dependency on version 21 of appcompat-v7 in your build.gradle.
At this time, the preview of the Android L support libraries only works with apps that declare the L preview as their min SDK.
Either revert to a previous version of the support library (I believe the latest is com.android.support:appcompat-v7:19.1.0) or update your project to support a minimum of 'L'.
just try this:
android {
android {
compileSdkVersion 20 //or whatever you want
buildToolsVersion '19.1.0'
defaultConfig {
minSdkVersion 14 //or whatever you want
targetSdkVersion 20 //or whatever you want
}
}
dependencies {
compile 'com.android.support:appcompat-v7:19.+'
}
}
and if you have another module in your project, check manifest files in those modules too.
I had a similar issue like that before. After I updated to 0.8.1, it showed an error below when compiling my previous projects.
"uses-sdk:minSdkVersion 8 cannot be smaller than version L declared in library com.android.support:appcompat-v7:21.0.0-rc1".
This is how I fixed it.
In your project, find build.gradle file in app folder and open it.
At dependencies section, change the value of compile 'com.android.support:appcompat-v7'. For example, in my case, it was compile 'com.android.support:appcompat-v7:+', and I changed it to compile 'com.android.support:appcompat-v7:20.+'. Of course, you could change it to compile 'com.android.support:appcompat-v7:19.+' if you like.
I hope it would help. Let me know if you are still stuck on it.
I had similar problems. Although I'm not sure exactly what caused the problem or which step fixed the issue, I did the following and ultimately got things working again:
I closed down Android Studio
I ran SDK Manager and and checked that everything was up to date. I have the following installed:
Android SDK tools Rev. 23
Android SDK Platform-tools Rev. 20
Android SDK Build-tools Rev. 20
Android L (API 20, L preview)
Android 4.4W (API 20)
Android 4.4.2 (API 19)
I restarted Android Studio and started a new (blank) project to test and ran it -> Success!
I found the process pretty finickity, so your mileage might vary. Let me know how you go.
I had the same error. I found the solution.
dependencies {
compile ('com.android.support:support-v13:20.0.0'){
force = true
}
compile ('com.android.support:support-v4:20.0.0'){
force = true
}
compile ('com.android.support:appcompat-v7:20.0.0'){
force = true
}
}
I think that instead of 20.0.0, you can specify a different version if you use less than 20 targetSdkVersion.
I had the same issue.
I made the following changes to the dependencies section in build.grade file located in the app folder.
'com.android.support:appcompat-v7:20.0.0' to 'com.android.support:appcompat-v7:20.+'