Код: Выделить всё
error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable > Duplicate class com.google.firebase.iid.FirebaseInstanceIdReceiver found in modules firebase-iid-20.1.5.aar -> jetified-firebase-iid-20.1.5-runtime (com.google.firebase:firebase-iid:20.1.5) and firebase-messaging-23.4.1.aar -> jetified-firebase-messaging-23.4.1-runtime (com.google.firebase:firebase-messaging:23.4.1) Go to the documentation to learn how to [url=d.android.com/r/tools/classpath-sync-errors]Fix dependency resolution errors[/url]. * Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org. BUILD FAILED in 11s.
Код: Выделить всё
implementation ('com.google.firebase:firebase-messaging:23.4.1') {
exclude group: 'com.google.firebase', module: 'firebase-iid'
}
build.gradle
Код: Выделить всё
buildscript {
ext {
buildToolsVersion = "34.0.0"
minSdkVersion = 24
compileSdkVersion = 34
targetSdkVersion = 34
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.22"
RNNKotlinVersion = kotlinVersion
}
subprojects { subproject ->
afterEvaluate{
if((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
}
}
}
}
repositories {
google()
mavenLocal()
mavenCentral()
maven {
url 'https://maven.google.com'
}
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
classpath 'com.google.gms:google-services:4.4.0'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
}
allprojects {
repositories {
google()
mavenLocal()
jcenter()
mavenCentral()
maven {
url "$rootDir/../node_modules/react-native/android"
}
maven {
url 'https://maven.google.com/'
name 'Google'
}
maven { url 'https://jitpack.io' }
maven {
url 'https://api.mapbox.com/downloads/v2/releases/maven'
authentication {
basic(BasicAuthentication)
}
credentials {
username = '******'
password = '**************'
}
}
maven {
credentials {
username '************'
password '************'
}
url '************'
}
}}
}
apply plugin: "com.facebook.react.rootproject"app/build.gradle
Код: Выделить всё
apply plugin: "com.android.application"
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"
import com.android.build.OutputFile
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
react {
}
def enableProguardInReleaseBuilds = false
def jscFlavor = 'org.webkit:android-jsc:+'
android {
ndkVersion rootProject.ext.ndkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdk rootProject.ext.compileSdkVersion
namespace "com.*******"
defaultConfig {
applicationId "com.*******"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.4"
missingDimensionStrategy 'react-native-camera', 'general'
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
v1SigningEnabled false
v2SigningEnabled false
enableV3Signing true
enableV4Signing true
}
release {
storeFile file('******')
storePassword '********'
keyAlias '*******'
keyPassword '********'
v1SigningEnabled false
v2SigningEnabled false
enableV3Signing true
enableV4Signing true
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
}
dependencies {
implementation("com.facebook.react:react-android")
implementation project(':react-native-orientation')
implementation project(':react-native-gesture-handler')
implementation project(':react-native-vector-icons')
implementation 'com.google.android.gms:play-services-maps:18.2.0'
implementation project(':react-native-material-letter-icon')
if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
implementation jscFlavor
}
}
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)Подробнее здесь: https://stackoverflow.com/questions/787 ... act-native
Мобильная версия