无法在额外属性上获取属性 compileSdkVersion? [英] Cannot get property compileSdkVersion on extra properties?

查看:24
本文介绍了无法在额外属性上获取属性 compileSdkVersion?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 上使用 react-native 应用程序.当我执行 react-native run-android 时,出现错误 compileSdkVersion on extra properties 请参阅下面的屏幕截图 1.为了在 android 文件夹 ->build.gradle 中解决这个问题,我添加了以下代码:

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
}

然后在 android->app->build.gradle:

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

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

defaultConfig {
    applicationId "com.faithcircle"
    minSdkVersion 16

但是如果我做了上述更改,它为什么不起作用?它给了我新的错误,请参见下面的屏幕截图 2.

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

截图 1:

截图 2:

推荐答案

Android 需要部署版本的 sdk..这就是为什么你需要首先在你的项目中部署 sdk ..它将在您的应用程序中创建 android 文件夹..那将有一个 build.gradle ...在那里你可以传递你的 buildsdkversion 参数和所有

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

这篇关于无法在额外属性上获取属性 compileSdkVersion?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆