从Android上的源代码构建本机React失败,版本为0.55.4

时间:2019-05-14 12:50:48

标签: react-native gradle android-gradle react-native-android

我在从Android(0.55.4)源构建本机反应时遇到问题。 我收到错误消息: Android/sdk/ndk-bundle/build/core/add-application.mk:178: *** Android NDK: APP_STL gnustl_shared is no longer supported. Please switch to either c++_static or c++_shared

反应本机版本:

Environment:
  OS: macOS 10.14.4
  Node: 10.14.2
  Yarn: 1.12.3
  npm: 6.4.1
  Watchman: 4.9.0
  Xcode: Xcode 10.2.1 Build version 10E1001
  Android Studio: 3.4 AI-183.5429.30.34.5452501

Packages: (wanted => installed)
  react: 16.3.1 => 16.3.1
  react-native: github:sinhpn92/react-native#0.55-stable => 0.55.4

复制步骤

build.gradle:

buildscript {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'
        classpath 'de.undercouch:gradle-download-task:3.4.3'

        classpath 'com.google.gms:google-services:3.2.1'
    }
}

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven {
            url "https://maven.google.com" // Google's Maven repository
        }
        google()
    }
}

app / build.gradle:

android {
   ...
   configurations.all {
       exclude group: 'com.facebook.react', module: 'react-native'
   }
}
dependencies {
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
//    compile "com.facebook.react:react-native:0.55.4"  // From node_modules
    compile project(':ReactAndroid')
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}
...

settings.gradle:

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

local.properties:

sdk.dir=/Users/xxx/Library/Android/sdk
ndk.dir=/Users/xxx/Library/Android/sdk/ndk-bundle

gradle-wrapper.properties:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

有什么建议解决此版本? 感谢您抽出宝贵时间来解决我的问题

0 个答案:

没有答案