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)
- TextInput (IOS) : maxLength & multiline true = onChangeText multiple call HOT 4
- 2 files found with path 'lib/arm64-v8a/libopencv_java4.so' from inputs: - /Users/wegile-1003/.gradle/caches/transforms-3/8ec77b58992a0a620e60c240eaed7c29/transformed/jetified-rppg_core-0.2.0/jni/arm64-v8a/libopencv_java4.so - /Users/wegile-1003/.gradle/caches/transforms-3/a576edfdc1ae89d711e78c8d27ec535b/transformed/jetified-opencv-android-4.1.2/jni/arm64-v8a/libopencv_java4.so If you are using jniLibs and CMake IMPORTED targets, see HOT 4
- No visible error is shown on iOS Bridgeless when there is an error before `AppRegistry.registerComponent` HOT 1
- yarn ios error ! error Could not find scheme greenhouse. Please make sure the schema you want to run exists. HOT 3
- App Crashes When Hermes is Disabled on Some Android 10 Devices `couldn't find DSO to load: libhermes.so SoSource` HOT 4
- React Query isStale is not working after upgrading react-native to 0.74 HOT 1
- In Android touchMove is cancelled when intercepted by native gesture from child HOT 3
- Zoom in & reset shortcuts are broken on experimental debugger HOT 3
- Library not loaded: '@rpath/FBLPromises.framework/FBLPromises' Referenced from HOT 5
- Socket Rocket Upgrade to 0.7.0 in react native version 0.73 HOT 4
- Image .gif frame timing off-by-one error in iOS HOT 2
- Pressable gets stuck under the new architecture HOT 2
- How to run react native custom library inside react native project without publishing to npm? Local setup steps are not working. HOT 3
- NSInvalidArgumentException __76-[RCTModalHostViewManager presentModalHostView:withViewController:animated:]_block_invoke.38 Application tried to present modally a view controller <RCTModalHostViewController: 0x7fcf53855110> that is already being presented by <UIViewController: 0x7fcf4791 HOT 7
- UI problem with iOS floating keyboard in iPad - 0.73.7 HOT 4
- React-Codegen Error when build iOS HOT 3
- [codegen] inconsistent use of `toSafeCppString` in `generateEnum` (GenerateModuleH.js) HOT 1
- Implement requestIdleCallback and cancelIdleCallback on the new architecture HOT 6
- Some touchable components are not working (Native Android devices only) HOT 2
- [iOS] Data race as a result of concurrent access to NativeToJsBridge::m_batchHadNativeModuleOrTurboModuleCalls
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.