项目运行 react-native run-android 运行报错

Author: xiajianCreated Apr 1, 2017Updated Mar 28, 2019

报错内容如下:

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Error: more than one library with package name 'com.projectseptember.RNGL'
  You can temporarily disable this error with android.enforceUniquePackageName=false
  However, this is temporary and will be enforced in 1.0

相当的沮丧,看 android/settings.gradleandroid/app/build.gradle 之后,发现 @fangwei716 重复引入了gl-react-native

android/settings.gradle 多引入了 :gl-react-native, 删掉如下行

include ':gl-react-native'
project(':gl-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/gl-react-native/android')

android/app/build.gradle 删掉如下行:

    compile project(':gl-react-native')

然后,就可以 happy 的运行起来了。

Source: fangwei716/30-days-of-react-native