Adding React-Native-Admob in React-Native

[亡魂溺海] 提交于 2019-12-11 15:43:08

问题


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.


回答1:


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.




回答2:


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




回答3:


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"


来源:https://stackoverflow.com/questions/52676780/adding-react-native-admob-in-react-native

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!