【问题标题】:The project name '@mapbox/react-native-mapbox-gl' must not contain any of the following characters: [/, \, :, <, >, ", ?, *, |]项目名称 '@mapbox/react-native-mapbox-gl' 不得包含以下任何字符:[/, \, :, <, >, ", ?, *, |]
【发布时间】:2019-06-28 23:40:20
【问题描述】:

我在 react native 中使用 mapbox/react-native-mapbox-gl packpage,在命令行中运行 react native 应用程序时出现以下错误。

配置项目 ':@mapbox/react-native-mapbox-gl' 时出现问题。

项目名称 '@mapbox/react-native-mapbox-gl' 不得包含以下任何字符:[/, \, :, , ", ?, *, |]。设置 ' rootProject.name' 或调整 'include' 语句(有关详细信息,请参阅https://docs.gradle.org/5.0/dsl/org.gradle.api.initialization.Settings.html#org.gradle.api.initialization.Settings:include(java.lang.String[]))。

我已尝试删除项目名称中的 @ 和 / 符号。

在 1 秒内构建失败 无法在设备上安装应用程序,请阅读上面的错误以了解详细信息。 确保您有一个正在运行的 Android 模拟器或连接的设备,并且有 设置您的 Android 开发环境: https://facebook.github.io/react-native/docs/getting-started.html

【问题讨论】:

    标签: react-native npm react-native-android npm-start


    【解决方案1】:

    首先,只需检查项目名称和包含不应有重复条目。 然后试试这个

    更正依赖中的包名。

    只需删除名称中的 [/, \, , ", ?, *, |] 字符

    1. 项目名称/android/app/build.gradle

    dependencies {
         compile project(':react-native-vector-icons')
        // here is the change just remove /, \, :, <, >, ", ?, *, | in the project parameter
        compile project(':mapbox-react-native-mapbox-gl')
    }
    1. 项目名称/android/settings.gradle

    // Do the same as build.gradle by removing /, \, :, <, >, ", ?, *, | characters but remember don't remove in the projectDir
    include ':mapbox-react-native-mapbox-gl'
    project(':mapbox-react-native-mapbox-gl').projectDir = new File(rootProject.projectDir, '../node_modules/@mapbox/react-native-mapbox-gl/android/rctmgl')

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-08-16
      • 2016-01-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多