Cannot add task 'wrapper' as a task with that name already exists

后端 未结 7 1992
忘掉有多难
忘掉有多难 2020-12-02 14:46

When installing \'react-native init AwesomeProject\' I get this error when I run react-native run-android:

Could not determine         


        
7条回答
  •  庸人自扰
    2020-12-02 15:36

    You can also update

    task wrapper(type: Wrapper) {
        gradleVersion = '4.4'    
        distributionUrl = distributionUrl.replace("bin", "all")
    }
    

    to

    wrapper {
        gradleVersion = '4.4'
        distributionUrl = distributionUrl.replace("bin", "all")
    }
    

    As

    Overriding built-in tasks deprecated in 4.8 now produces an error.

    Attempting to replace a built-in task will produce an error similar to the following:

    Cannot add task 'wrapper' as a task with that name already exists.

    see the last paragraph of Tasks & properties: https://docs.gradle.org/5.2.1/userguide/upgrading_version_4.html

    and Customizing the Wrapper task: https://docs.gradle.org/5.2.1/userguide/gradle_wrapper.html#customizing_wrapper

提交回复
热议问题