Compilation failed (android) after installation of react-native-keychain - react-native

This is a new installation on a RN 0.62.2 and Nodejs 12.18.0. After yarn add react-native-keychain, the app launch of npx react-native run-android failed with the error:
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
C:\D\code\js\xyz_app\node_modules\react-native-keychain\android\src\main\java\com\oblador\keychain\DeviceAvailability.java:30: error: cannot find symbol
return context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_FACE);
^
symbol: variable FEATURE_FACE
location: class PackageManager
C:\D\code\js\xyz_app\node_modules\react-native-keychain\android\src\main\java\com\oblador\keychain\DeviceAvailability.java:34: error: cannot find symbol
return context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_IRIS);
^
symbol: variable FEATURE_IRIS
location: class PackageManager
2 errors
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':react-native-keychain:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
Tried a few times with installation and the error is the same. The modules has been used in other app before and the error may be related to the recent update of the module. The OS is win10. react-native-keychain is 6.1.1. Here is the package.json:
"#react-native-community/masked-view": "^0.1.10",
"#react-navigation/native": "^5.5.1",
"#react-navigation/stack": "^5.5.1",
"react": "16.11.0",
"react-native": "0.62.2",
"react-native-device-info": "^5.6.1",
"react-native-elements": "^2.0.2",
"react-native-gesture-handler": "^1.6.1",
"react-native-keychain": "^6.1.1",
"react-native-reanimated": "^1.9.0",
"react-native-safe-area-context": "^3.0.5",
"react-native-screens": "^2.8.0",
"react-native-vector-icons": "^6.6.0"

Bumped up the SDK version from 28 to 29 in build.gradle seems working. Here is the file after change:
buildToolsVersion = "29.0.3"
minSdkVersion = 16
compileSdkVersion = 29
targetSdkVersion = 29

A senior dev advised me to do this:
"I see, react-native-keychain is using lambdas which are available from java 8 upwards. We should tell it to use java 8 .
Add this block"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
in node_modules/react-native-keychain/android/build.gradle
add as shown below.

Related

How to solve the Build failed with an exception in React Native

This is an error I'm facing
BUILD FAILED in 1m 33s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installEmembershipcardDebug -PreactNativeDevServerPort=8081
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Note: D:\ememberProject\eMembership-React-Native\node_modules\#react-native-community\art\android\src\main\java\com\reactnativecommunity\art\ARTGroupShadowNode.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\ememberProject\eMembership-React-Native\node_modules\#react-native-async-storage\async-storage\android\src\main\java\com\reactnativecommunity\asyncstorage\AsyncStorageModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\ememberProject\eMembership-React-Native\node_modules\#react-native-async-storage\async-storage\android\src\main\java\com\reactnativecommunity\asyncstorage\AsyncStoragePackage.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\ememberProject\eMembership-React-Native\node_modules\react-native-camera\android\src\main\java\com\google\android\cameraview\Camera2.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\ememberProject\eMembership-React-Native\node_modules\#react-native-firebase\messaging\android\src\main\java\io\invertase\firebase\messaging\ReactNativeFirebaseMessagingModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\ememberProject\eMembership-React-Native\node_modules\react-native-html-to-pdf\android\src\main\java\android\print\PdfConverter.java uses or
overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\ememberProject\eMembership-React-Native\node_modules\react-native-safe-area-context\android\src\main\java\com\th3rdwave\safeareacontext\InsetsChangeEvent.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\ememberProject\eMembership-React-Native\node_modules\react-native-share\android\src\main\java\cl\json\RNSharePathUtil.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
e: D:\ememberProject\eMembership-React-Native\node_modules\react-native-screens\android\src\main\java\com\swmansion\rnscreens\CustomSearchView.kt: (8, 76): Type mismatch: inferred type is Context? but Context was expected
Note: D:\ememberProject\eMembership-React-Native\node_modules\react-native-svg\android\src\main\java\com\horcrux\svg\VirtualView.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-screens:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
* 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 1m 33s
at makeError (D:\ememberProject\eMembership-React-Native\node_modules\execa\index.js:174:9)
at D:\ememberProject\eMembership-React-Native\node_modules\execa\index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (D:\ememberProject\eMembership-React-Native\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (D:\ememberProject\eMembership-React-Native\node_modules\#react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.
PS D:\ememberProject\eMembership-React-Native>
This is an android/build.gradle
buildscript {
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 31
ndkVersion = "21.4.7075529"
kotlin_version = '1.7.0'
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.2")
classpath 'com.google.gms:google-services:4.3.10'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
google()
maven { url 'https://www.jitpack.io' }
}
}
What I have tried...
I think the commands which is necessary to solve the error I almost tried to solve...
And also I have set the environment setup very properly as the react native setup docs says ...
I have updated gradle version , kotlin version, react native version , npm version , node version etc...
I have also updated Firebase app , Firebase message and Firebase.. where Firebase app and messages version should be same...
I have also set up the SDK TOOLS, Android SDK in Android studio ...
I have uninstalled the nodes, vs code and again reinstalled it but again facing the same issue i.e. Build Failed....
Package.json
"dependencies": {
"#react-native-async-storage/async-storage": "^1.16.0",
"#react-native-community/clipboard": "^1.5.1",
"#react-native-community/masked-view": "^0.1.11",
"#react-native-community/netinfo": "^7.1.5",
"#react-native-firebase/app": "^14.12.0",
"#react-native-firebase/messaging": "^14.2.2",
"#react-navigation/drawer": "^6.1.8",
"#react-navigation/native": "^6.0.6",
"#react-navigation/stack": "^6.0.11",
"android": "^0.0.8",
"axios": "^0.24.0",
"linkify-html": "^3.0.5",
"moment": "^2.29.1",
"react": "17.0.2",
"react-native": "0.69.1",
"react-native-barcode-builder": "^2.0.0",
"react-native-camera": "^4.2.1",
"react-native-collapsible": "^1.6.0",
"react-native-config": "^1.4.11",
"react-native-dots-pagination": "^0.2.0",
"react-native-flash-message": "^0.2.0",
"react-native-floating-action": "^1.22.0",
"react-native-geolocation-service": "^5.3.0-beta.4",
"react-native-gesture-handler": "^2.0.0",
"react-native-gradient-buttons": "^2.0.2",
"react-native-html-to-pdf": "^0.12.0",
"react-native-hyperlink": "^0.0.19",
"react-native-image-pan-zoom": "^2.1.12",
"react-native-linear-gradient": "^2.5.6",
"react-native-marquee": "^0.3.2",
"react-native-material-menu": "^2.0.0",
"react-native-modal": "^13.0.1",
"react-native-open-maps": "^0.4.0",
"react-native-pager-view": "^5.4.9",
"react-native-permissions": "^3.2.0",
"react-native-phone-number-input": "^2.1.0",
"react-native-qrcode-scanner": "^1.5.4",
"react-native-qrcode-svg": "^6.1.2",
"react-native-reanimated": "^2.2.4",
"react-native-render-html": "^6.3.1",
"react-native-safe-area-context": "^3.3.2",
"react-native-screens": "^3.14.0",
"react-native-share": "^7.3.5",
"react-native-splash-screen": "^3.3.0",
"react-native-sqlite-storage": "^6.0.1",
"react-native-svg": "^12.1.1",
"react-native-unimodules": "^0.14.10",
"react-native-uuid": "^2.0.1",
"react-native-viewpager": "^0.2.13",
"react-native-wallet": "^1.0.8",
"react-native-webview": "^11.15.0",
"rn-fetch-blob": "^0.12.0"
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#babel/runtime": "^7.12.5",
"#react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "7.14.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.66.2",
"react-test-renderer": "17.0.2"
},
"jest": {
"preset": "react-native"
}
versions...
PS D:\ememberProject\eMembership-React-Native> npm version
"
eMembershipCard: '0.0.4',
npm: '9.1.3',
node: '19.1.0',
v8: '10.7.193.20-node.19',
uv: '1.44.2',
zlib: '1.2.11',
brotli: '1.0.9',
ares: '1.18.1',
modules: '111',
nghttp2: '1.47.0',
napi: '8',
llhttp: '8.1.0',
openssl: '3.0.7+quic',
cldr: '42.0',
icu: '72.1',
tz: '2022e',
unicode: '15.0',
ngtcp2: '0.8.1',
nghttp3: '0.7.0' "
Looks like it is your case https://github.com/software-mansion/react-native-screens/issues/1449
Check versions of your RN and Screens libs react-native-screens#3.14.0 and react-native#0.69.1

React Native app not running without doing anything in the previous working code

I am currently woking in a react native projects
It have these packages as dependencies
"dependencies": {
"#react-native-async-storage/async-storage": "^1.15.5",
"#react-native-community/checkbox": "^0.5.8",
"#react-native-community/cli": "^7.0.3",
"#react-native-community/clipboard": "^1.5.1",
"#react-native-community/datetimepicker": "^3.5.2",
"#react-native-community/masked-view": "^0.1.11",
"#react-native-picker/picker": "^1.16.3",
"#react-navigation/drawer": "^5.12.5",
"#react-navigation/material-top-tabs": "^5.3.15",
"#react-navigation/native": "^5.9.4",
"#react-navigation/stack": "^5.14.5",
"#twotalltotems/react-native-otp-input": "^1.3.11",
"axios": "^0.21.1",
"axios-oauth-client": "^1.4.2",
"axios-token-interceptor": "^0.2.0",
"moment": "^2.29.1",
"prop-types": "^15.8.1",
"react": "17.0.1",
"react-native": "0.64.1",
"react-native-animatable": "^1.3.3",
"react-native-app-intro-slider": "^4.0.4",
"react-native-calendars": "^1.1264.0",
"react-native-cardview": "^2.0.5",
"react-native-date-picker": "^4.2.1",
"react-native-device-info": "^8.1.3",
"react-native-eject": "^0.1.2",
"react-native-geolocation-service": "^5.3.0",
"react-native-gesture-handler": "^1.10.3",
"react-native-get-random-values": "^1.8.0",
"react-native-image-picker": "^4.0.3",
"react-native-material-dropdown": "^0.11.1",
"react-native-modal-datetime-picker": "^10.2.0",
"react-native-modal-picker": "^0.0.16",
"react-native-pager-view": "^5.4.23",
"react-native-phone-number-input": "^2.1.0",
"react-native-picker-select": "^8.0.4",
"react-native-reanimated": "^2.2.0",
"react-native-safe-area-context": "^3.2.0",
"react-native-screens": "^3.3.0",
"react-native-searchable-dropdown": "^1.1.3",
"react-native-signature-canvas": "^4.3.0",
"react-native-simple-toast": "^1.1.4",
"react-native-slider": "^0.11.0",
"react-native-step-indicator": "^1.0.3",
"react-native-tab-view": "^2.16.0",
"react-native-text-input-mask": "^3.1.4",
"react-native-vector-icons": "^9.1.0",
"react-native-webview": "^11.13.0",
"react-redux": "^7.2.4",
"uuid": "^8.3.2"
},
It is not running now without doing anything with the previous working code, not even updating anything in the system also.
Here is that error
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Failed to transform react-native-0.71.0-rc.0-debug.aar (com.facebook.react:react-native:0.71.0-rc.0) to match attributes {artifactType=android-aar-metadata, com.android.build.api.attributes.BuildTypeAttr=debug, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for JetifyTransform: /Users/username/.gradle/caches/modules-2/files-2.1/com.facebook.react/react-native/0.71.0-rc.0/7a7f5a0af6ebd8eb94f7e5f7495e9d9684b4f543/react-native-0.71.0-rc.0-debug.aar.
> Java heap space
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 4s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Failed to transform react-native-0.71.0-rc.0-debug.aar (com.facebook.react:react-native:0.71.0-rc.0) to match attributes {artifactType=android-aar-metadata, com.android.build.api.attributes.BuildTypeAttr=debug, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for JetifyTransform: /Users/username/.gradle/caches/modules-2/files-2.1/com.facebook.react/react-native/0.71.0-rc.0/7a7f5a0af6ebd8eb94f7e5f7495e9d9684b4f543/react-native-0.71.0-rc.0-debug.aar.
> Java heap space
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 4s
at makeError (/Users/username/Desktop/Gitlab/projectname/node_modules/execa/index.js:174:9)
at /Users/username/Desktop/Gitlab/projectname/node_modules/execa/index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (/Users/username/Desktop/Gitlab/projectname/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5)
at async Command.handleAction (/Users/username/Desktop/Gitlab/projectname/node_modules/#react-native-community/cli/build/index.js:192:9)
There is some issues in the react-native itself.
solution to this issue - https://github.com/facebook/react-native/issues/35210
For react-native ( >= 0.63)
In android/build.gradle add this exclusiveContent inside the allprojects.repositories
allprojects {
repositories {
exclusiveContent {
// We get React Native's Android binaries exclusively through npm,
// from a local Maven repo inside node_modules/react-native/.
// (The use of exclusiveContent prevents looking elsewhere like Maven Central
// and potentially getting a wrong version.)
filter {
includeGroup "com.facebook.react"
}
forRepository {
maven {
url "$rootDir/../node_modules/react-native/android"
}
}
}
// ...
}
}
For older react-native (< 0.63)
Add this in the allprojects area of your android/buld.gradle file.
def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())
allprojects {
configurations.all {
resolutionStrategy {
// Remove this override in 0.65+, as a proper fix is included in react-native itself.
force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
}
}
I am also facing this issue, the last time I built the app, everything worked fine, but just yesterday, the build started failing with this same error. No changes or updates were made.

Android12 build error: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE

I got this error after testing on my Android 12. I already tried this 2 changes:
1- adding android:exported="true"
<activity android:exported="true"...>...</activity>
2- Adding workruntime on android/app/build.gradle
def work_version = "2.7.0"
// (Java only)
implementation "androidx.work:work-runtime:$work_version"
My package.json configuration is:
"dependencies": {
"react": "16.9.0",
"react-native": "0.61.3",
"react-native-firebase": "^5.5.6",
"react-native-fs": "^2.14.1",
"react-native-push-notification": "^8.1.1",
},
The image error:
What should I do?

React Native run-android doesn't work - package com.facebook.react.module.annotations does not exist

I get the following error when i try to run react-native run-android:
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
D:\Work\CS\CSMobile\node_modules\#react-native-community\datetimepicker\android\src\main\java\com\reactcommunity\rndatetimepicker\RNDatePickerDialogModule.java:20: error: package com.facebook.react.module.annotations does not exist
import com.facebook.react.module.annotations.ReactModule;
^
D:\Work\CS\CSMobile\node_modules\#react-native-community\datetimepicker\android\src\main\java\com\reactcommunity\rndatetimepicker\RNDatePickerDialogModule.java:29: error: cannot find symbol
#ReactModule(name = RNDatePickerDialogModule.FRAGMENT_TAG)
^
symbol: class ReactModule
D:\Work\CS\CSMobile\node_modules\#react-native-community\datetimepicker\android\src\main\java\com\reactcommunity\rndatetimepicker\RNTimePickerDialogModule.java:21: error: package com.facebook.react.module.annotations does not exist
import com.facebook.react.module.annotations.ReactModule;
^
D:\Work\CS\CSMobile\node_modules\#react-native-community\datetimepicker\android\src\main\java\com\reactcommunity\rndatetimepicker\RNTimePickerDialogModule.java:29: error: cannot find symbol
#ReactModule(name = RNTimePickerDialogModule.FRAGMENT_TAG)
^
symbol: class ReactModule
D:\Work\CS\CSMobile\node_modules\#react-native-community\datetimepicker\android\src\main\java\com\reactcommunity\rndatetimepicker\RNDateTimePickerPackage.java:12: error: RNDateTimePickerPackage is not abstract and does not override abstract method createJSModules() in ReactPackage
public class RNDateTimePickerPackage implements ReactPackage {
^
Note: D:\Work\CS\CSMobile\node_modules\#react-native-community\datetimepicker\android\src\main\java\com\reactcommunity\rndatetimepicker\RNDatePickerDialogFragment.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
5 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-community_datetimepicker:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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 3s
at checkExecSyncError (child_process.js:621:11)
at execFileSync (child_process.js:639:15)
at runOnAllDevices (D:\Work\CS\CSMobile\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at buildAndRun (D:\Work\CS\CSMobile\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:179:41)
at D:\Work\CS\CSMobile\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:133:12
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Command.handleAction (D:\Work\CS\CSMobile\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:182:9)
PS D:\Work\CS\CSMobile>
My dependencies:
"dependencies": {
"#eva-design/eva": "^1.2.0",
"#react-native-community/datetimepicker": "2.1.0",
"#types/html-entities": "^1.2.16",
"#types/object-hash": "^1.3.1",
"#types/react-native-material-textfield": "^0.16.3",
"#types/uuid": "^3.4.7",
"axios": "^0.19.2",
"date-fns": "^2.10.0",
"html-entities": "^1.2.1",
"object-hash": "^2.0.2",
"react": "16.9.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-36.0.1.tar.gz",
"react-native-elements": "^1.2.7",
"react-native-flash-message": "^0.1.15",
"react-native-gesture-handler": "~1.5.0",
"react-native-keyboard-aware-scroll-view": "^0.8.0",
"react-native-modal-datetime-picker": "^8.5.1",
"react-native-reanimated": "~1.4.0",
"react-native-router-flux": "^4.2.0",
"react-native-screens": "2.0.0-alpha.12",
"react-native-svg": "9.13.3",
"react-navigation": "^4.0.10",
"react-navigation-stack": "^1.9.4",
"react-navigation-tabs": "^2.5.6",
"react-redux": "^7.1.3",
"recompose": "^0.30.0",
"redux": "^4.0.5",
"redux-logger": "^3.0.6",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.3.0",
"uuid": "^3.4.0"
},
I tried to remove package-lock.json and node-modules then reinstall, but still receiving same errors.
I was working on this exact same project on expo, everything works perfectly. However, when i try to clone the project to a pure react-native project, then this error occurs.
Anyone knows how to solve this? Many thanks!
Install #react-native-community/datetimepicker latest version
npm install #react-native-community/datetimepicker --save
then clean gradlew
cd android && gradlew clean
then run the app again
cd.. && react-native run-android

How to run existing react-native project with java-11

I have create project using react-native init ProjectName. This project was created with java-8 version, but now I have changed my system and because of no more support for java-8 installed java-11 in system, So I have to use java-11 with my existing project.
When I run the code after starting npm using the command npm-start & react-native run-android, what issue I am getting is -
FAILURE: Build failed with an exception.
What went wrong:
Could not determine java version from '11.0.2'.
I have tried to change android configuration like gradle version and other but still no luck.
I also searched online but couldn't get satisfied answer, most of the answer is saying that uninstall java-11 and install java-8.
I also gone through the official website of react native still no luck.
https://github.com/facebook/react-native/issues/22487
OS - Ubuntu 18.0.4
Java vrsion install -11.0.2
react-native-cli: 2.0.1
react-native: 0.56.0
node - v10.15.3
npm - 6.4.1
"dependencies": {
"lodash": "^4.17.11",
"react": "16.4.1",
"react-native": "0.56.0",
"react-native-elements": "^0.19.1",
"react-native-iphone-x-helper": "^1.2.0",
"react-native-navigation": "^2.3.0",
"react-native-segmented-control-tab": "^3.3.1",
"react-native-tabbar-bottom": "^1.0.4",
"react-native-vector-icons": "^6.1.0",
"react-redux": "^6.0.0",
"prop-types": "^15.6.2",
"redux": "^4.0.1"
},
classpath 'com.android.tools.build:gradle:3.3.1'
ext {
buildToolsVersion = "28"
minSdkVersion = 19
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
}
distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip
I just want to run my project in java 11 which is already working fine in java-8, because now unable to install Java -8 in my ubuntu system.