У меня проблемы с запуском моего приложения с response-native-firebase + response-native-maps.
Приложение вылетает при запуске на Android, в то время как в iOS оно работает без проблем.
Окружающая среда:
ОС: macOS Mojave 10.14.1
React Native: 0.57.4
реактивные карты: 0.22.1
реактивная база огня: 5.1.0
Мой топ build.gradle:
buildscript {
repositories {
google()
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.google.gms:google-services:4.0.1'
}
}
allprojects {
buildDir = "$rootDir/build/${rootProject.name}/${project.name}"
repositories {
google()
mavenLocal()
maven { url 'https://maven.google.com' }
maven {
url "$rootDir/../node_modules/react-native/android"
}
maven { url 'https://maven.fabric.io/public' }
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
}
}
И мое приложение build.gradle:
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "py.com.kynox.pelotajara"
minSdkVersion 16
targetSdkVersion 27
versionCode 138
versionName "1.3.8"
ndk {
abiFilters "armeabi-v7a", "x86"
}
multiDexEnabled true
}
signingConfigs {
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}
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
}
}
}
dexOptions {
dexInProcess = false
}
flavorDimensions "devStages"
productFlavors {
dev {
applicationIdSuffix ".dev"
versionNameSuffix "-dev"
println "Using Dev google-service.json"
copy {
from 'src/dev/'
include '*.json'
into '.'
}
copy {
from 'src/dev/'
into 'src/main/'
include 'res/**'
}
dimension "devStages"
}
prod {
applicationIdSuffix ""
versionNameSuffix ""
println "Using Production google-service.json"
copy {
from 'src/prod/'
include '*.json'
into '.'
}
copy {
from 'src/prod/'
into 'src/main/'
include 'res/**'
}
dimension "devStages"
}
staging {
applicationIdSuffix ".staging"
versionNameSuffix "-staging"
println "Using Staging google-service.json"
copy {
from 'src/staging/'
include '*.json'
into '.'
}
copy {
from 'src/staging/'
into 'src/main/'
include 'res/**'
}
dimension "devStages"
}
}
}
dependencies {
/* PLAY SERVICES */
implementation "com.google.android.gms:play-services-base:16.0.1"
/* FIREBASE */
implementation project(':react-native-firebase')
implementation "com.google.firebase:firebase-core:16.0.4"
implementation "com.google.firebase:firebase-messaging:17.3.4"
implementation "com.google.firebase:firebase-invites:16.0.4"
implementation "com.google.firebase:firebase-config:16.1.0"
/* RN AND OTHER LIBRARIES*/
implementation 'com.facebook.react:react-native:+'
implementation project(':lottie-react-native')
implementation project(':react-native-view-shot')
implementation project(':react-native-share')
implementation project(':react-native-vector-icons')
implementation(project(':react-native-maps')){
exclude group: 'com.google.android.gms'
}
implementation project(':react-native-linear-gradient')
implementation project(':react-native-fabric')
implementation('com.crashlytics.sdk.android:crashlytics:2.6.3@aar') {
transitive = true;
}
implementation(project(':react-native-fbsdk')) {
exclude(group: 'com.facebook.android', module: 'facebook-android- sdk')
}
implementation 'com.facebook.android:facebook-android-sdk:4.31.0'
implementation ("com.google.android.gms:play-services-maps:+") {
force = true;
}
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.0'
implementation 'com.android.support:multidex:1.0.1'
implementation fileTree(include: ['*.jar'], dir: 'libs')
}
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
Приложение вылетает при запуске, logcat выдает эту ошибку:
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/maps/GoogleMapOptions;
Кто-нибудь смог заставить эти два работать вместе?