我是React Native的新手。我创建了一个应用程序,可以在所有Android设备/模拟器上构建和运行,但armeabi-v7a
除外。
我在Android armeabi-v7a
中运行应用时看到的错误日志是:
我的build.gradle
文件:
apply plugin: "com.android.application"
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
import com.android.build.OutputFile
apply from: "../../node_modules/react-native/react.gradle"
def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
defaultConfig {
applicationId "com.xxx"
minSdkVersion 16
targetSdkVersion 22
versionName = "2.1.1"
versionCode 115
versionName "2.0.5"
ndk {
abiFilters "armeabi-v7a", "x86"
}
// TODO: Maybe this can help with the "libglog_init.so" not found not found issue
// packagingOptions {
// exclude "lib/armeabi-v7a/libglog_init.so"
// }
//TODO: Possibly no longer required.
// packagingOptions {
// exclude "lib/arm64-v8a/libgnustl_shared.so"
// }
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a": 1, "x86": 2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
// TODO: Possibly not required
dexOptions {
preDexLibraries = false
}
defaultConfig {
multiDexEnabled true
}
}
repositories {
mavenCentral()
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.getRequested().getGroup() == 'com.google.android.gms') {
details.useVersion('9.8.0')
}
}
}
dependencies {
compile project(':react-native-vector-icons')
compile fileTree(include: ['*.jar'], dir: 'libs')
// From node_modules
compile('com.android.support:appcompat-v7:23.0.1')
compile 'com.facebook.react:react-native:+'
compile project(':react-native-video')
compile project(':react-native-maps')
compile project(':react-native-fs')
compile project(':tipsi-stripe')
compile project(':react-native-device-info')
compile project(':bugsnag-react-native')
compile project(':react-native-orientation')
compile project(':react-native-media-kit')
compile(project(':react-native-maps')){
exclude group: 'com.google.android.gms', module: 'play-services-base'
exclude group: 'com.google.android.gms', module: 'play-services-maps'
}
compile project(':react-native-image-resizer')
compile project(':react-native-image-picker')
compile project(':react-native-i18n')
compile project(':react-native-geocoder')
compile project(':react-native-push-notification')
compile 'com.google.android.gms:play-services-base:10.2.4'
compile 'com.google.android.gms:play-services-maps:10.2.4'
compile 'com.google.android.gms:play-services-analytics:10.2.4'
compile 'com.google.android.gms:play-services-location:10.2.4'
compile 'com.google.android.gms:play-services-gcm:10.2.4'
compile('com.facebook.android:facebook-android-sdk:4.22.1') {
force = true
}
compile project(':react-native-fbsdk')
compile 'com.android.support:design:23.0.1'
compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
transitive = true;
}
}
// 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'
}
我哪里错了?在所有设备上运行应用程序需要做什么?
P.S。:我正在使用React Native版本0.49.0