错误:命令失败:Windows 8.1上的gradlew.bat installDebug

时间:2019-01-27 12:20:34

标签: react-native

我正在Windows 8.1平台上创建react-native应用程序,而我正在使用react-native run-android创建构建,这给了我以下错误。请同样帮我。

Command failed: gradlew.bat installDebug
Error: Command failed: gradlew.bat installDebug
at checkExecSyncError (child_process.js:611:11)
at Object.execFileSync (child_process.js:629:13)
at runOnAllDevices (E:\showTimes\node_modules\react-native\local-cli\runAndroid\runAndroid.js:299:19)
at buildAndRun (E:\showTimes\node_modules\react-native\local-cli\runAndroid\runAndroid.js:135:12)
at isPackagerRunning.then.result (E:\showTimes\node_modules\react-native\local-cli\runAndroid\runAndroid.js:65:12)
at process._tickCallback (internal/process/next_tick.js:68:7)

1 个答案:

答案 0 :(得分:2)

在项目根目录/ android中创建local.properties文件,然后将路径添加到您的SDK位置 我的情况

@observer class Inner {
    _someChange = (event) => {
        this.props.holder.something = event.something
    }

    _anotherChange = (whatever) => {
        this.props.holder.anotherthing = whatever.anotherthing
    }

    render() {
        return <div>
            <Something onClick={this._someChange} onWhatever={this._anotherChange}/>
    </div>
}

@observer class Outer {
    @observable _holder = {
         something: 0,
         anotherthing: '',
    }

    render() {
        return <div>
            <Inner holder={this._holder}/>
            <AComponentNeedingTheHolderContent something={this._holder.something}/>
        </div>
    }
}