Can´t use add-on in Android Studio: "platform not found" - android

In our project we are using an add-on instead of the standard Android SDK.
There is a new version of the add-on, it is in the add-ons folder, listed among the SDKs to compile with, but when we select it, we get an error from gradle saying:
Error: Module 'app' platform 'add-on_name' not found.
Open Android SDK Manager and install all missing platforms.
Our current setup is:
Android Studio 3.0 canary 5
gradle wrapper distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip
gradle classpath 'com.android.tools.build:gradle:2.3.2'
buildToolsVersion '25.0.3'
I have submitted the issue with the add-on developer, but it seems more like an Android tools/Gradle bug, so I am trying my chances here. It used to work without issues before Gradle 2.0/Android Studio 2.3

Related

gradle in android studio is not selecting the installed sdk

I have started learning android and i'm stuck at something.
I have installed android sdk api 22 and when i'm syncing it with gradle , the following error is popping up:
Failed to find target with hash string 'android-27' in: C:\Users\user
\AppData\Local\Android\android-sdk
it says that it is missing android sdk api 27 but i have installed android sdk api 22
why is it not selecting the installed sdk
1.>Uninstall your android studio. remove all folders. and sdk from c drive.just remove all file folder related to android studio.
2.>Download latest android studio from android developer site using below link.
https://developer.android.com/studio/?gclid=CjwKCAiAyrXiBRAjEiwATI95mQYBGcmv_eUPnDUijy-THzdWA_dIIc-6iM1CEZ0w-k02TxfN4wqbXBoCTAYQAvD_BwE
3.Install android studio from downloaded .exe file.
will work fine if android studio will install successfully.
android studio don't need sdk externally.
Check the app/build.gradle file, maybe you specified sdk version 27 on it, you can change it with api 22.

Gradle dependency error after upgrading to Android Studio 3

I have just upgraded Android Studio to the latest version. With the new version a new gradle version is being used and several changes have been made to gradle as well. I have followed the guides to update my gradle file and all errors are gone except the following one:
Error:Execution failed for task ':app:preFreeDebugBuild'.
Android dependency 'com.google.android.gms:play-services-ads' has different version for the compile (10.0.1) and runtime (11.0.4) classpath. You should manually set the same version via DependencyResolution
I have checked and made sure that only version 11.0.4 is used in my gradle file (google ads, analytics etc). The problem seems to arise from using the Facebook ads SDK - I have checked the latest integration guide on AdMob and I am using the latest Facebook SDK, i.e.,
implementation 'com.facebook.android:audience-network-sdk:4.26.0'
implementation 'com.google.ads.mediation:facebook:4.26.0.0'
If I remove the above statements the project compiles with no problems. If I include the facebook sdk I get the error above so I am thinking that the Facebook SDK is using version 10.0.1 of Google ads and that is why the problem is happening.
Is there a way to fix this?
I upgrade Android Studio to 3.0 but keep gradle plugins version at 2.3.0. This will keep all your dependencies with compile, no need to change to implementation.
I had a similar issue today after updating to Android Studio 2.3.
I had to update my build tools to 25.0.0 you can do this by changing the buildToolsVersion and changing the compileSdkVersion to 25 in the build.gradle file in your main module.
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
...
}

How to set the minimum SDK Build Tools version required in an Android Studio project?

When I try to run my React Native project in the Android emulator I get the following error:
The SDK Build Tools revision (23.0.1) is too low for project ':app'.
Minimum required is 25.0.0
My android/app/build.gradle file specifies:
buildToolsVersion "23.0.1"
On Android Studio, it also logs the same error for each of the packages I'm using:
I believe this started happening after I inadvertently updated some stuff that Android Studio suggested.
All the build.gradle files that I've checked specify version 23.0.1, but for some reason 25.0.0 seems to be overriding that setting.
How do I go about correcting this?
Ran into this issue and realized that the error is quite vague. Coming from an iOS background into React Native, I've had to learn a lot more about the Android ecosystem. The problem is that your project Gradle version is too high.
In your project's (top level) build.gradle you may be using:
classpath 'com.android.tools.build:gradle:2.3.1'
Gradle v2.3.1, implicitly sets the minimum SDK Build Tools revision to 25.0.0.
To fix, you can simply revert back to:
classpath 'com.android.tools.build:gradle:2.2.3'
This will allow your project's modules to use buildToolsVersions 23.0.1 or 25.0.2
Install required Build Tools version 25.0.0
Update buildToolsVersion in build.gradle file and sync project
Set compileSdkVersion 25 and targetSdkVersion 25
Clean and Build your project again
Finally, Run on device
Hope this will help~
May be you are updated your studio version and open your old project if you do that then you want to go to package explorer app and right click on it and open modual setting one window open then select the project and set the Gradle version
and android plugin version
example
My studio version is 2.3
then Gradle version = 3.3
and Android plugin version = 2.3.0
if you not find then create new project blank project and see the setting and apply on your project
Android SDK Build Tools are required to build Android apps (see https://developer.android.com/studio/command-line/index.html#tools-build). It's recommended to always use the latest version.
In your case react* libraries aren't compatible with current build tools version (23.0.1) so you need to upgrade (25.0.2 is the latest version at the moment).
The version is specified in build.gradle of your module. After syncing project everything would be fine or an error will be displayed that will suggest installing the missing version. Android Studio will do that for you.
android {
...
buildToolsVersion "25.0.2"
Uninstall all new-ones 'Android SDK Build-Tools' versions after comes 23.0.1 in SDK Manager and Sync and try again for that project only...

Android Studio: Failed to sync Gradle project

Gradle sync failed: Cause: failed to find target with hash string 'android-18' in: C:\Users\Android\sdk Consult IDE log for more details
I am finding this error every time, when importing a project into android studio.
Go into the Android SDK manager and install the platform SDK for API 18. Or, go into the project settings and change the target API and build tools versions to be what you already have installed.
I am finding this error every time, when importing a project into android studio.
For addressing this issue, you may want to change SDK level of the imported project to whatever you'd like. (However you should mak sure your chosen SDK level meets features used by the library)
For this, you should open build.gradle file of that project and change SDK level there.
defaultConfig {
minSdkVersion 4
targetSdkVersion /* SDK LEVEL */
}
Another option would be installing SDK level 18 via SDK manager.
For handling this issue, you have to update the gradle version in build.gradle of your project to latest gradle version of your android studio. After that if android studio terminal shows any of the following then
1) install the missing platform(s)
or
2) install build tools
or
3) Fix Gradle wrapper and re-import project
do that and sync your project.

Import of Eclipse project into Android Studio using build.gradle file fails

I'm trying to import my Eclipse based Android project using the build.gradle file. I get the following message: "failed to find Build Tools revision 18.0.0". However, according to the Android SDK Manager, I have Android SDK Build-tools 18.0.1 installed.
I am doing all this on a 64-bit Windows 7 machine, if that's relevant.
How do I fix this?
UPDATE: I actually only updated to Build-tools 18.0.1 this morning. I then noticed that, when making a new project in Android Studio, it wouldn't allow me to create a project using Android 4.3 (4.2.2 was the latest allowable version). I tried dropping the target version of my project to Android 4.2.2, and re-exporting it. Now Android Studio complains about not being able to find Build-tools 18.0.1 when I try to import this project.
I was an Android Studio virgin too up until 10 minutes ago. I ran into the same problem. If you check your SDK Manager in Android Studio (or Eclipse I believe) it will show which tools you have installed. I am/was missing build tools 18.0.1 too and getting the error....but it was because I hadn't installed them.
So without modifying the Gradle build files, I was able to install the build tools using the SDK Manager and get everything up and running.
See this image:
As an aside, I also had to update the API version as well because it selected an API version that wasn't installed (which I don't get because it was when I compiled with Eclipse).
Hope this helps.
This did the trick for me.
In build.gradle file inside the main module modify the line
buildToolsVersion "18.0.0"
to
buildToolsVersion "18.0.1"
I'm very new to Android Studio (as of last night). I encountered the same problem. I opened up the 'build.gradle' file and modified the lines with: "compileSdkVersion 18" and "buildToolsVersion 18.0.1" to 17 and 17.0.0 respectively. It seems to do the trick!
you must make sure the build.gradle file contains the same version of the installed build tools.
you can find this out by looking in the /sdk/build-tools/android-X.Y.Z/source.properties file under the Android Studio installation
e.g.
Pkg.UserSrc=false
Pkg.Revision=18.1.1
then plug that revision number into the gradle build file:
android {
compileSdkVersion 18
buildToolsVersion "18.1.1"
...
}
I had issues with Gradle too. A full delete and install the latest version fixed it.
I also had the same problem then I have checked my Enviornment Variable and it is pointing to my old sdk which does not have Build tool 18.0.x After pointing it to new sdk everything goes well.

Categories

Resources