【问题标题】:You have not accepted the licenses arguments after run sdkmanager.bat --licenses - Android SDK运行 sdkmanager.bat --licenses - Android SDK 后,您尚未接受许可参数
【发布时间】:2018-01-11 07:05:57
【问题描述】:

这个问题在S.O中被问了很多次,但是没有一个对我有帮助,因为我在命令行中接受了许可。

我是 react 和 android 的新手。我已经安装了 android studio 和它的包。我启动了反应,但它抱怨许可证。

build.gradle:

apply plugin: "com.android.application"

import com.android.build.OutputFile



project.ext.react = [
    entryFile: "index.js"
]

apply from: "../../node_modules/react-native/react.gradle"


def enableProguardInReleaseBuilds = false

android {
     compileSdkVersion 25
    buildToolsVersion "25.0.2"

    defaultConfig {
        applicationId "com...."
         minSdkVersion 25
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false
            include "armeabi-v7a", "x86"
        }
    }
    buildTypes {
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            def versionCodes = ["armeabi-v7a":1, "x86":2]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }
        }
    }
}

dependencies {
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile 'com.android.support:appcompat-v7:25.1.1'
    compile "com.facebook.react:react-native:+"  // From node_modules
}

task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

当我跑步时

react-native run-android

结果是:

我使用命令行并接受了许可证(S.O)

但是,它再次抱怨许可证。

【问题讨论】:

标签: android react-native


【解决方案1】:

错误的 JAVA_PATH 也会导致此错误。我在环境变量中注册了错误的 java_path。将其更改为正确的路径后,一切都像魅力一样。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-01-03
    • 2018-07-14
    • 1970-01-01
    • 2018-04-30
    • 1970-01-01
    • 2017-02-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多