Я продолжаю сталкиваться с этой ошибкой, когда пытаюсь запустить свой реактивный проект на Android. iOS работает отлично.
Если у кого-нибудь есть какие-нибудь предложения, это было бы здорово! Я перепробовал все остальные связанные вопросы по переполнению стека, и ни один из них не помог мне
Error
* Что пошло не так:
Не удалось выполнить задачу ': app: transformClassesWithMultidexlistForDebug'.
com.android.build.api.transform.TransformException: ошибка при создании основного списка dex.
Команда не выполнена: ./gradlew installDebug
Ошибка: команда не выполнена: ./gradlew installDebug
в checkExecSyncError (child_process.js: 602: 13)
в Object.execFileSync (child_process.js: 622: 13)
в runOnAllDevices (/Users/benjilightstone/Coding/eSports->Competition-frontend-two/node_modules/react-native/local->cli/runAndroid/runAndroid.js:299:19)
в buildAndRun (/Users/benjilightstone/Coding/eSports-Competition->frontend-two/node_modules/react-native/local->cli/runAndroid/runAndroid.js:135:12)
в isPackagerRunning.then.result (/Users/benjilightstone/Coding/eSports-Competition-frontend-two/node_modules/react-native/local-cli/runAndroid/runAndroid.js:65:12)
в
at process._tickCallback (internal / process / next_tick.js: 189: 7)
Уровень приложения build.gradle
apply plugin: "com.android.application"
apply plugin: "com.google.firebase.firebase-perf"
apply plugin: 'io.fabric'
import com.android.build.OutputFile
def enableProguardInReleaseBuilds = false
android {
lintOptions {
disable 'GradleCompatible'
disable 'InvalidPackage'
}
// because of firestore:
dexOptions {
javaMaxHeapSize "4g"
}
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "com.benji.esportscompetition"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
// because of firestore:
multiDexEnabled true
}
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"
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
// 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
}
}
}
}
dependencies {
implementation project(':react-native-sensitive-info')
implementation project(':react-native-firebase')
implementation project(':react-native-splash-screen')
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+"
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation project(path: ':react-native-firebase', configuration: 'default')
// Required dependencies
//noinspection GradleCompatible
implementation "com.google.firebase:firebase-core:16.0.6"
implementation "com.google.android.gms:play-services-base:16.0.1"
implementation('com.google.firebase:firebase-ads:15.0.1') {
// exclude `customtabs` as the support lib version is out of date
// we manually add it as a dependency below with a custom version
exclude group: 'com.android.support', module: 'customtabs'
}
// Authentication
implementation "com.google.firebase:firebase-auth:16.1.0"
// Analytics
implementation "com.google.firebase:firebase-analytics:16.0.6"
// Performance Monitoring
implementation "com.google.firebase:firebase-perf:16.2.3"
// Remote Config
implementation "com.google.firebase:firebase-config:16.1.2"
// Cloud Storage
implementation "com.google.firebase:firebase-storage:16.0.5"
// Invites
implementation "com.google.firebase:firebase-invites:16.0.6"
// Dynamic Links
implementation "com.google.firebase:firebase-dynamic-links:16.1.5"
// Real-time Database
implementation "com.google.firebase:firebase-database:16.0.5"
// Cloud Functions
implementation "com.google.firebase:firebase-functions:16.1.3"
// Cloud Firestore
implementation "com.google.firebase:firebase-firestore:17.1.5"
// Cloud Messaging / FCM
implementation "com.google.firebase:firebase-messaging:17.3.4"
// Crashlytics
implementation('com.crashlytics.sdk.android:crashlytics:2.9.5@aar') {
transitive = true
}
// For Firebase Ads
implementation "com.android.support:customtabs:27.1.1"
// For React Native Firebase Notifications
implementation 'me.leolin:ShortcutBadger:1.1.21@aar'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:design:27.1.0'
}
// 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'
}
apply plugin: 'com.google.gms.google-services'
Package.json
{
"name": "eSportsCompetition",
"version": "5.1.0",
"private": true,
"devDependencies": {
"babel-jest": "23.6.0",
"fs-extra": "^6.0.1",
"jest": "23.6.0",
"metro-react-native-babel-preset": "0.49.2",
"react-test-renderer": "16.7.0",
"reactotron-react-native": "^3.2.0",
"replace-in-file": "^3.4.2"
},
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios --simulator=\"iPhone X\"",
"apk": "cd android && ./gradlew assembleRelease",
"rename": "node ./bin/rename.js",
"start": "react-native start",
"test": "jest"
},
"jest": {
"preset": "react-native"
},
"dependencies": {
"axios": "^0.18.0",
"react": "16.6.3",
"react-native": "0.58.0-rc.2",
"react-native-firebase": "^5.2.0",
"react-native-rate": "^1.1.6",
"react-native-sensitive-info": "5.2.9",
"react-native-splash-screen": "^3.2.0",
"react-native-status-bar-height": "^2.2.0",
"react-native-table-component": "^1.2.0",
"react-navigation": "^3.3.2"
}
}