fun joker
fun joker

Reputation: 1727

Cannot get property compileSdkVersion on extra properties?

I am using react-native app on windows. When I do react-native run-android I get error compileSdkVersion on extra properties see screenshot 1 below. To solve that issue in android folder ->build.gradle I added following code:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

ext {
    compileSdkVersion = 26
}

And in android->app->build.gradle:

android {
compileSdkVersion rootProject.ext.compileSdkVersion  <--Added this line
buildToolsVersion '25.0.0'

defaultConfig {
    applicationId "com.faithcircle"
    minSdkVersion 16

But if I do above changes it doesn't work why so ? It gives me new error see screenshot 2 below.

Screenshot1:

enter image description here

Screenshot2:

enter image description here

Upvotes: 2

Views: 2751

Answers (1)

Vishal Gupta
Vishal Gupta

Reputation: 208

Android need the deployed version of sdk.. Thats why you need to first deploy the sdk in your project.. It will create the android folder in your app.. That will have one build.gradle... And there you can pass your buildsdkversion parameters and all

Upvotes: 2

Related Questions