Comments (8)
I am also facing this issue.
Have you got any solution @kikikiswanto?
from react-native.
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
/**
This is the configuration block to customize your React Native Android app.
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"] }
/**
Set this to true to create four separate APKs instead of one, one for each native architecture. This is useful if you don't use App Bundles (https://developer.android.com/guide/app-bundle/) and want to have separate APKs to upload to the Play Store. / def enableSeparateBuildPerCPUArchitecture = false /*
Set this to true to Run Proguard on Release builds to minify the Java bytecode. / def enableProguardInReleaseBuilds = false /*
The preferred build flavor of JavaScriptCore (JSC) For example, to use the international variant, you can use: def jscFlavor = 'org.webkit:android-jsc-intl:+' The international variant includes ICU i18n library and necessary data allowing to use e.g. Date.toLocaleString and String.localeCompare that give correct results when using with locales other than en-US. Note that this variant is about 6MiB larger per architecture than default. / def jscFlavor = 'org.webkit:android-jsc:+' /*
Private function to get the list of Native Architectures you want to build. This reads the value from reactNativeArchitectures in your gradle.properties file and works together with the --active-arch-only flag of react-native run-android. */ def reactNativeArchitectures() { def value = project.getProperties().get("reactNativeArchitectures") return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] } 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)
for me solved with comment one line,
/android/build.gradle
buildscript {
ext {
buildToolsVersion = "31.0.0"
minSdkVersion = 21
compileSdkVersion = 33
targetSdkVersion = 33
googlePlayServicesVersion = "+" // default: "+"
//firebaseMessagingVersion = "+" // default: "21.1.0"
thanks @SantoshYadavSridix
from react-native.
Too Old Version of React Native | |
---|---|
ℹ️ | It looks like your issue or the example you provided uses a Too Old Version of React Native. Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support. |
from react-native.
Missing Reproducible Example | |
---|---|
ℹ️ | We could not detect a reproducible example in your issue report. Please provide either:
|
from react-native.
I am using react native 0.71.12
from react-native.
I have the same problem.
Execution failed for task ':app:checkDebugDuplicateClasses'.
A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
Duplicate class com.google.firebase.Timestamp found in modules jetified-firebase-common-21.0.0-runtime (com.google.firebase:firebase-common:21.0.0) and jetified-firebase-firestore-24.4.5-runtime (com.google.firebase:firebase-firestore:24.4.5)
any solution?
from react-native.
I am facing the same issue
from react-native.
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
/**
This is the configuration block to customize your React Native Android app.
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"]
}
/**
Set this to true to create four separate APKs instead of one,
one for each native architecture. This is useful if you don't
use App Bundles (https://developer.android.com/guide/app-bundle/)
and want to have separate APKs to upload to the Play Store.
/
def enableSeparateBuildPerCPUArchitecture = false
/*
Set this to true to Run Proguard on Release builds to minify the Java bytecode.
/
def enableProguardInReleaseBuilds = false
/*
The preferred build flavor of JavaScriptCore (JSC)
For example, to use the international variant, you can use:
def jscFlavor = 'org.webkit:android-jsc-intl:+'
The international variant includes ICU i18n library and necessary data
allowing to use e.g. Date.toLocaleString and String.localeCompare that
give correct results when using with locales other than en-US. Note that
this variant is about 6MiB larger per architecture than default.
/
def jscFlavor = 'org.webkit:android-jsc:+'
/*
Private function to get the list of Native Architectures you want to build.
This reads the value from reactNativeArchitectures in your gradle.properties
file and works together with the --active-arch-only flag of react-native run-android.
*/
def reactNativeArchitectures() {
def value = project.getProperties().get("reactNativeArchitectures")
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
}
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)
from react-native.
Related Issues (20)
- FBReactNativeSpec/FBReactNativeSpec.h: No such file or directory (in target 'React-Codegen' from project 'Pods') HOT 6
- Unable to run the app on Android 14. HOT 7
- Cannot Make API call to http endpoint when using formData[Tried with both fetch and axios] HOT 3
- 'If-None-Match' and 'If-Modified-Since' Headers being Appended to Outgoing Network DELETE Requests Resulting in Server 501 Error
- Undefined symbol: _OBJC_CLASS_$_RCTRootView - Linker command failed with exit code 1 (use -v to see invocation)
- React native downloading react-android-0.74.1-debug.aar again and again wtih so slow speed HOT 3
- Modai from "react-native" crashes the App in iOS. Works fine in android HOT 2
- react-native-xcode.sh doesn't filter out link local addresses correctly HOT 5
- Reloading a dev app rapidly crashes the app HOT 11
- Last FlatList item component re-mounted when adding new elements at the beginning of the list
- Installing hermes-engine (0.74.1) HOT 1
- On Android horizontal Animated.ScrollView, animated children with a transform: translate are not pressable correctly HOT 3
- Packaging failure HOT 2
- Wrong orientation width and height values on iPad only, HOT 4
- React native webview image download without external storage permission HOT 2
- Is it possible to use have an Android library as the native module of a React Native project? HOT 10
- Calling JS callback asynchronously from C++ thread. HOT 3
- Error with react-native-compat + Expo Go crashes on iOS when trying to create a Web3Wallet instance HOT 3
- Layout breaks when UIContextMenuInteraction is used with the new architecture
- NullPointerException: Attempt to invoke virtual method 'JavaTimerManager$IdleCallbackRunnable.cancel()' on a null object reference HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native.