Open ailtonaires opened 1 week ago
facing same issue.. did you find any solution @ailtonaires
facing same issue..
just check your project level build.gradle file and remove extra thing which on is not used...
my android/build.gradle file souce code..........**
buildscript { ext { buildToolsVersion = "33.0.0" minSdkVersion = 21 compileSdkVersion = 33 targetSdkVersion = 33 kotlinVersion = "1.8.0" // googlePlayServicesVersion = "+" // firebaseMessagingVersion = "+" // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP. ndkVersion = "23.1.7779620" } repositories { google() mavenCentral()
maven { url 'https://maven.google.com' }
maven { url "https://www.jitpack.io" }
}
dependencies {
classpath("com.android.tools.build:gradle:7.3.1")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath('com.google.gms:google-services:4.3.15')
}
}
and android/app/build.gradle file like this......***
apply plugin: "com.android.application" apply plugin: "com.facebook.react" apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle" apply plugin: 'com.google.gms.google-services'
import com.android.build.OutputFile
/**
By default you don't need to apply any configuration, just uncomment the lines you need. */ react { ...........
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" // hermesFlags = ["-O", "-output-source-map"] }
/**
/**
/**
def jscFlavor = 'org.webkit:android-jsc-intl:+'
Date.toLocaleString
and String.localeCompare
that/**
android { packagingOptions { pickFirst 'lib/x86/libc++_shared.so' pickFirst 'lib/x86_64/libjsc.so' pickFirst 'lib/arm64-v8a/libjsc.so' pickFirst 'lib/arm64-v8a/libc++_shared.so' pickFirst 'lib/x86_64/libc++_shared.so' pickFirst 'lib/armeabi-v7a/libc++_shared.so' } ndkVersion rootProject.ext.ndkVersion buildToolsVersion rootProject.ext.buildToolsVersion compileSdkVersion rootProject.ext.compileSdkVersion
namespace "YOUR_PACKAGE_NAME"
defaultConfig {
applicationId "NAME"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 4
versionName "1.3"
vectorDrawables.useSupportLibrary = true
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include (*reactNativeArchitectures())
}
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
buildFeatures {
viewBinding true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// 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:
// https://developer.android.com/studio/build/configure-apk-splits.html
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
}
}
}
}
dependencies { // The version of react-native is set by the React Native Gradle Plugin implementation("com.facebook.react:react-android")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
implementation("androidx.core:core-splashscreen:1.0.0")
implementation ('com.google.firebase:firebase-bom:32.7.2')
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.squareup.okhttp3', module:'okhttp'
}
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
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)
and android/app/build.gradle. remove :+ implementation "com.facebook.react:react-native:+" => implementation "com.facebook.react:react-native" work for me 🙏
There is no reason to have direct firebase dependencies in your app level build.gradle, and certainly not with outdated versions.
Auto linking will bring those dependencies in for you from the react-native-firebase modules.
If you must depend on them directly for some project-specific reason (like you have custom native code on Android that uses firebase native apis directly...), remove the bom one, just depend on the specific modules you need and do not specify a version
facing same issue.. did you find any solution @ailtonaires
I removed the line below and it worked for me:
//firebaseMessagingVersion = "+"
Issue
When trying to compile the application on Android, I am receiving the following error:
The problem appears to be a duplication of classes between versions of firebase-common and firebase-firestore.
Project Files
`
`<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.groovoo">
`
I tried this, but it didn't work for me
https://stackoverflow.com/questions/78428458/how-to-fix-duplicate-class-com-google-firebase-timestamp/78438376#78438376
Click To Expand
#### `package.json`: ```json { "name": "Groovoo", "version": "99.0.0", "private": true, "scripts": { "start": "react-native start", "android": "react-native run-android", "test": "jest", "lint": "eslint ." }, "dependencies": { "@ethersproject/shims": "^5.7.0", "@invertase/react-native-apple-authentication": "^2.0.2", "@ptomasroos/react-native-multi-slider": "^1.0.0", "@react-native-community/async-storage": "^1.12.0", "@react-native-community/blur": "^4.3.2", "@react-native-community/datetimepicker": "^3.0.3", "@react-native-community/masked-view": "^0.1.10", "@react-native-community/netinfo": "^9.4.1", "@react-native-community/picker": "^1.8.0", "@react-native-community/push-notification-ios": "^1.5.0", "@react-native-community/toolbar-android": "^0.2.1", "@react-native-community/viewpager": "^4.1.6", "@react-native-firebase/analytics": "17.5.0", "@react-native-firebase/app": "17.5.0", "@react-native-firebase/auth": "17.5.0", "@react-native-firebase/firestore": "17.5.0", "@react-native-google-signin/google-signin": "^8.0.0", "@react-navigation/native": "^5.7.4", "@react-navigation/stack": "^5.9.1", "@xmpp/client": "^0.11.1", "@xmpp/debug": "^0.11.0", "aws-sdk": "^2.755.0", "axios": "^0.20.0", "base-64": "^0.1.0", "base64-arraybuffer": "^0.2.0", "create-react-class": "^15.6.3", "ethers": "^5.6.9", "fs": "0.0.1-security", "js-sha256": "^0.9.0", "jwt-decode": "^3.1.2", "lodash.filter": "^4.6.0", "lottie-react-native": "^3.3.2", "moment": "^2.27.0", "moment-timezone": "^0.5.33", "native-base": "^2.13.12", "otplib": "^12.0.1", "prop-types": "^15.7.2", "react": "16.13.1", "react-content-loader": "^5.1.4", "react-native": "0.63.2", "react-native-actionsheet": "^2.4.2", "react-native-autocomplete-input": "^4.2.0", "react-native-calendars": "^1.403.0", "react-native-camera": "^3.43.6", "react-native-circular-progress": "^1.3.6", "react-native-confirmation-code-field": "^6.5.0", "react-native-countdown-component": "^2.7.1", "react-native-country-picker-modal": "^2.0.0", "react-native-crypto-js": "^1.0.0", "react-native-datepicker": "^1.7.2", "react-native-device-info": "^3.1.4", "react-native-dotenv": "^2.6.2", "react-native-elements": "^3.4.2", "react-native-fast-image": "^7.0.2", "react-native-fbsdk": "^2.0.0", "react-native-fs": "^2.16.6", "react-native-gesture-handler": "^1.8.0", "react-native-get-random-values": "^1.8.0", "react-native-gifted-chat": "^0.10.1", "react-native-htmlview": "^0.17.0", "react-native-hyperlink": "0.0.22", "react-native-image-crop-picker": "^0.25.3", "react-native-linear-gradient": "^2.5.6", "react-native-modal-datetime-picker": "^9.0.0", "react-native-nfc-manager": "^3.13.5", "react-native-page-control": "^1.1.1", "react-native-phone-number-input": "^2.1.0", "react-native-picker-select": "^7.0.0-beta.0", "react-native-popup-dialog": "^0.18.3", "react-native-progress-wheel": "^1.0.5", "react-native-push-notification": "^7.3.0", "react-native-reanimated": "^1.2.0", "react-native-render-html": "^6.3.4", "react-native-safe-area-context": "^3.1.8", "react-native-screenguard": "^1.0.4-beta", "react-native-screens": "^2.11.0", "react-native-sideswipe": "^1.5.0", "react-native-svg": "^12.1.0", "react-native-vector-icons": "^7.1.0", "react-native-video": "^5.0.2", "react-native-view-overflow": "0.0.4", "react-navigation": "^3.13.0", "react-navigation-drawer": "^1.4.0", "react-navigation-stack": "^1.10.3", "react-navigation-tabs": "^1.2.0", "react-redux": "^7.1.1", "react-timer-mixin": "^0.13.4", "redux": "^4.0.4", "redux-thunk": "^2.3.0", "rn-tourguide": "^2.4.1", "semver": "^7.6.0", "string.prototype.replaceall": "^1.0.6", "uuid": "^8.3.1" }, "devDependencies": { "@babel/core": "^7.11.6", "@babel/runtime": "^7.11.2", "@react-native-community/eslint-config": "^2.0.0", "babel-jest": "^26.3.0", "eslint": "^7.9.0", "jest": "^26.4.2", "metro-react-native-babel-preset": "^0.63.0", "react-test-renderer": "16.13.1" }, "jest": { "preset": "react-native" } } ```