Integrating react-native with existing app with buildToolsVersion 24 - android

I'm trying to integrate react-native into an existing Android application, but keep running into the following error:
> Could not find com.android.support:appcompat-v7:23.0.1.
It seems like react-native needs sdkBuildTools version 23.0.1 and appcompat-v7 version 23.0.1.
However, the application I'm working on depends on sdkBuildTools version 24 and also appcompat-v7 version 23.2. Downgrading these dependencies is not an option.
Does this mean I can't integrate react-native into the app without rebuilding react-native from source with bumped up dependencies?

Go to android SDK manager and install build tool version 23.2 and change sdkBuildTools of every gradle in your project to 24 and also it will ask you after install that you have new version of SDK tools installed would you like to change the configuration, you can click on it .. If not then reach out to your app's gradle and change the appcompact version
One last step you need to do is change classpath version of your project and that will be notified by the android studio or i think 2.3.0 would be merely fine.
Cheers :)

Related

how to compile Shadowsocks source code on android studio? [duplicate]

This version of Android Studio cannot open this project, please retry with Android Studio 3.4 or newer.
but my android studio version is 3.2.1 and there is no new update from Google
Try to edit your project build.gradle file and set the android build gradle plugin to classpath 'com.android.tools.build:gradle:3.2.1' within the dependency section.
See also the documentation of the android grade plugin
It's a bit late, But easy and effective.
Click on About Android Studio,
Check the current version,
Open build.gradle of Project and put it in front of the class path. e.g Your studio version is 3.5.2, then your classpath should look like this
classpath 'com.android.tools.build:gradle:3.5.2'
You would need to lower your gradle version and android plugin version, or you can download latest version from beta or canary update channels.
To enable updates from other channels go to Help -> Check for Updates -> Congifure automatic updates and in that dialog select channel you want. After selecting check for update again and it will show you latest version.
This issue is caused due to use of newer version of gradle in the project.
There are two options to resolve this:
Option 1:
Change gradle/wrapper/gradle-wrapper.properties file
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
Change project level gradle build.gradle file
classpath("com.android.tools.build:gradle:3.3.2")
Option 2:
Update your Android Studio to newer version. (Highly recommended)
In IntelliJ IDEA this is an open bug: https://youtrack.jetbrains.com/issue/IDEA-252823
As a workaround, you can change the build tools version as other people advise.
My project was failing with this dependency:
com.android.tools.build:gradle:7.0.0-alpha03
Now it's working with this:
com.android.tools.build:gradle:4.0.2
As a side note, you should change that dependency in build.gradle in some projects or in dependencies.kt in newer projects.
That was the most updated version that worked.
After an update the Android Studio does not show the layout's design for some reason. I tried newer versions as well, but it did not work. So I decided to downgrade my IDE.
When I opened my project, I got the same error. The solution was the following:
Open the Project Structure.
Select the Project field.
Use the appropriate Android Plugin Version. You can copy it from a new project's structure.
Change the Gradle version too what you need.
OK.
Find the gradle-wrapper.properties file and open it.
Change the distributionUrl to that gradle version url what you saved in the Project Structure.
Or if you don't mind, then you can update your AS.
Had the same Issue when i decided to install another version of Android Studio, what worked for me was:
Creating a new project with the current version of Android Studio just to go check the classpath version at the project level build.gradle inside the dependencies section, at the time it was this:
classpath 'com.android.tools.build:gradle:3.5.0-rc01'
Copied that line and replaced it on the project i was working on.
in project's build.gradle file comment classpath com.android.tools.build:gradle:. File → Project Structure select Android Gradle Plugin Version to match Android Studio version
You can now update your android studio to 3.4 stable version. Updates for stable version are now available. cheers!!!
i just change gradle version classpath 'com.android.tools.build:gradle:3.5.3' to
classpath 'com.android.tools.build:gradle:3.3.2' and now working.
I encountered with this error and just decrease gradle version and android plugin version to 5.1.1 and 3.4.2.
Close VPN worked for me! It suprised me.
this issue occur for me after downgrade Java JDK, after upgrade JDK my problem resolved.
Open android studio then go to help menu > check for update > Update your Android Studio to newer version.
If u r here because of Jetpack Compose, I had the same problem, and solved it by using the Arctic Fox Canary build of Android studio: you can download it at this link: https://redirector.gvt1.com/edgedl/android/studio/ide-zips/2020.3.1.12/android-studio-2020.3.1.12-mac.zip
This issue arises due to updates, You can resolve this by downgrading the gradle used from
com.android.tools.build:gradle:3.2.1 to a previous gradle like com.android.tools.build:gradle:3.0.0 or anything older than the current one
This usually happens when you're opening someone else's project after unzipping it. And the person has used an updated android Studio.
The way to solve it is
1.Go to Help and about to see your android studio version
2.Go to File>Project Structure> and set your Android Gradle Plugin version to your android studio version
3.Change the Gradle version to the one you usually use.(optional)
Build the project and it should run without any errors
This seems like incompatible gradle plugin vs gradle binary versions. You can find the releases here: Gradle Plugin release and compatiblity
Upgrade your grade plugin and grade binary to compatible versions and the app should start building.

Do all my dependencies (libraries that I am using) for my android studios project have to be using a Gradle version equal to or less than mine?

So let's say I have an application on android studios using Gradle version 4.1 with Gradle plugin version of 3.0. I have added implementation 'com.facebook.android:facebook-login:8.2.1' to my build.gradle file. However com.facebook.android:facebook-login:8.2.1 is using Gradle version 4.4.
So the only way for me to use this library (and that version) is if my project is on Gradle version 4.4 or greater?
Or is there a way for me to use that library (and that version) without changing my Gradle version?
Thanks.
Update: More Info
So specifically I am talking about using the stripe API. I was on version 6.1.2 but because of some new EU law, I need to update the version I am using to at least 9.1.1.
I noticed the only time I get this error 'apptransformClasseswithdesugarfordebug' when trying to run my app, is after they update there Gradle to use version 3.4.1 from 3.4.0 (not the Gradle plugin). On version of Stripe 9.0.0, my app is able to run, however, after switching to version 9.1.1, I get that error.
Note, my project is on Gradle version 3.1.4 and when it's on Stripe version of Gradle 3.4.0, my app is able to run.
So to wrap it up, I need to know if I need to be on the same version, although I doubt it because my app works with 9.0.0 of Stripe, which is using a different version of Gradle.

ionic run android failing with: values-v24/values-v24.xml:4 No resource found 'android:TextAppearance.Material.Widget.Button.Colored'

Uptil yesterday everything was working fine.
Now all of a sudden I am getting this error (mentioned in title).
minSdkVersion is set to 16
TargetSdk is set to 25
All answers for previous such queries have not helped.
Is there some upstream issue.
My team and I are all hitting the same issue. No code was updated in our app. We just ran the build and hit this error.
This arises from a mismatch between the Android compile SDK version and the support library / build tools version (see here).
Even if you changed no code in the project, if the Android SDK modules were updated or the cordova-android platform version changed, this would cause the observed error.
You can resolve it by updating the project to use the most recent cordova-android version:
cordova platform rm android
&& cordova platform add android#latest --save
&& cordova build android
Also make sure the Android SDK components (Support Library, build tools, platform tools) are up-to-date.

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...

Open project in Android Studio 1.0+ using gradle plugin 0.*.*

I am trying to open a Android Project in Android Studio 1.0.2 which uses
classpath 'com.android.tools.build:gradle:0.12.+'
as its dependency. On opening the project with above dependency I get the following error message.
The project is using an unsupported version of the Android Gradle plug-in (0.12.2). The recommended version is 1.0.0.
Is there a way to run such projects in Android Studio 1.0.+ without upgrading the Gradle plug-in version
Note:
I can upgrade the gradle version and plugin to get it to work OR simply use older version of Android Studio to open the project.
First approach is not desirable since this being a community project I will prefer to leave majority of files unchanged and changing gradle version will also hinder me from testing the build with 0.12.
To successfully build Android project using Android Studion and Gradle you need to use the AS, Gradle and Android Gradle Plugin with versions which are compatible with each other. Check out this page, it's said here, that you can use Android Gradle Plugin 0.12 with Android Studio 0.8.0 - 0.8.11 and there is no way to use it under Android Studio 1.0.
I suggest you convince other people to switch to the newest version of Android Gradle Plugin because 1.0.0 is the stable one and doesn't contain some bugs which were out there in the 0.12.+.

Categories

Resources