Adding React-Native-Admob in React-Native - android

I am trying to add React-Native-Admob 2.0.0-beta.5 into React-Native v0.55.4 for Android.
compileSdkVersion =26
buildToolsVersion ="27.0.3"
targetSdkVersion = 26
supportLibVersion = "26.1.0"
minSdkVersion = 18
And React-Native-Admob has
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 16
targetSdkVersion 22
}
And when i Compile the error Exception occur
The SDK Build Tools revision (23.0.1) is too low for project ':react-native-admob'. Minimum required is 25.0.0
I can't downgrade my project's SDK, other package uses that SDK.

You don't need to downgrade, you need to upgrade. Dependencies were probably added in the SDK that admob relies on. You can download the specified version packages for the SDK through Android studio and then set your SDK version in the file to the appropriate version necessary for admob.
Edit
I see that you are saying that admob is using version 23. You may need to submit an issue with them on GitHub for this.

you can change the buildToolVersion of the library you are using, just go to -> node_modules/{your-library}/android/build.gradle, change buildToolsVersion from 23.0.1 to 25.0.0.
if the studio asks for any updates regarding build, just update it, and it might work.
another solution:
although I haven't tried it, it has a lot of emoji love on GitHub,
https://github.com/oblador/react-native-keychain/issues/68#issuecomment-304836725

Goto
"node-module/react-native-admob/android/build.gradle" file, then change the compileSdkVersion and buildToolsVersion to following values
compileSdkVersion 27
buildToolsVersion "27.0.3"

Related

SDK version 29 not modified after migrated the developer preview android-R

I'm trying to implement newer android SDK in my app with below configurations,
android {
compileSdkVersion 'android-R'
buildToolsVersion "30.0.0-rc4"
defaultConfig {
minSdkVersion 14
targetSdkVersion 'R'
}
...
}
I need some clarification,
We have faced the SDK version 29 was not modified after migrated the developer preview android-R. I think the SDK version is 30 right?
I have compared both android 29 & android R build.prop files & SDK version is the same as 29. But in android-R build.prop file release or codename parameter is 'R'. Please confirm for us.

Why I can't use low version buildTools?

When I use 25.0.0, my project appear some bug(Floating Action Button doesn't show). But I can choice low version.
Error:The SDK Build Tools revision (24.0.3) is too low for project ':app'. Minimum required is 25.0.0
change classpath 'com.android.tools.build:gradle:+' to classpath 'com.android.tools.build:gradle:2.2.2' , and now ,I can use 24.0.3
I would guess that you have a build.gradle file that defines buildToolsVersion "25.0.0". But you only have version 24.0.3 installed.
Either upgrade your build tools by installing a newer version using Tools/Android/SDK Manager/SDK Tools or change the requirements on the app's build.gradle file to require the version you seem to have (24.0.3).
Make sure your compileSdkVersion does not overlap with your buildToolsVersion.
What I do in my project is I match the compileSdkVersion and buildToolsVersion. Looks like this.
compileSdkVersion 24
buildToolsVersion '24.0.2'
defaultConfig {
minSdkVersion 19
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
Also, you can always check for updates from the SDK Manager in Android Studio.
Please take a look at this also,
What is the buildToolsVersion for android SDK 24?
Cheers!

What is the buildToolsVersion for android SDK 24?

There's not much I can say about this. Oh well. Google released a new version of android called Nougat (android N). It is compileSdkVersion 24. However, on the build tools page in the official documentation, it is not mentioned.
I want to give my app to 100% of the people using Google Play Store, which includes android N users.
tl;dr: What should I fill in the buildToolsVersion field?
Thanks.
buildToolsVersion
Using android gradle plugin version > 3 you can remove the android.buildToolsVersion property
Quoting from the New Features section of the Android Gradle plugin release notes for version 3.0.0:
You no longer need to specify a version for the build tools. By default, the plugin automatically uses the minimum required build tools version for the version of Android plugin you're using.
[minSdkVersion, targetSdkVersion, compileSdkVersion]
buildToolsVersion should be set to 25 and 25.0.0, as seen below:
compileSdkVersion 25
buildToolsVersion '25.0.0'
useLibrary 'org.apache.http.legacy'
defaultConfig {
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
You can get the latest buildToolsVersion from SDK Manager in Android Studio.

Gradle project sync failed android studio

I downloaded Arc library form github and imported it as module then I got this error.
Error:Cause: failed to find target with hash string 'android-4' in: C:\Users\shahek\AppData\Local\Android\sdk
Open Android SDK Manager
I also installed Api 15.
This is my build.gradle setting.
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.shahek.myapplication"
minSdkVersion 18
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
You must install version 23 and all this things must be solved.
If it don't help you,
try to download this library from github and add into project and modify min sdk version in gradle/manifest to yours 18.
Good luck.

Error in Android studio New Application

Whenever i start new application in android studio this error pop ups
what should i do
It seems that is because your Compile SDK version is below 23.
Make compileSdkVersion 23 in your buiild.gradle file and rebuild your project.
You should use compileSdkVersion 23 in your build.gradle.
First make sure that you set
compileSdkVersion 23
buildToolsVersion "23.0.1"
and
targetSdkVersion 23
Then Clean-Rebuild-Gradle .
Try this way .I hope it works .

Categories

Resources