Reactnative error, unable to install the application - javascript

So I was trying to create a splash screen in react native.
I followed the following article and after completing all the steps, I cleaned my gradle as well.
https://medium.com/handlebar-labs/how-to-add-a-splash-screen-to-a-react-native-app-ios-and-android-30a3cec835ae
But when I was trying to create the app again after doing the relevant changes. This was the error that was being displayed.
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
Since I didn't know where I was making the mistake, hence I have linked my Git Repo as well.
https://github.com/SMAmmar14/reactnative

Related

Unable to run React-Native

After running npx react-native run-android here is the message from terminal:
FAILURE: Build failed with an exception.
Where:
Build file '/Users/vivek/Documents/Code-Here/React-Native/instaClone/android/app/build.gradle' line: 1
What went wrong:
A problem occurred evaluating project ':app'.
Failed to apply plugin 'com.android.internal.application'.
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changing org.gradle.java.home in gradle.properties.
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 7s
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.
Where:
Build file '/Users/vivek/Documents/Code-Here/React-Native/instaClone/android/app/build.gradle' line: 1
What went wrong:
A problem occurred evaluating project ':app'.
Failed to apply plugin 'com.android.internal.application'.
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changing org.gradle.java.home in gradle.properties.
Be sure to always read the error message carefully, because it will likely tell you what is wrong and how you can fix it!
In this case, the error is telling you that you don't have the correct version of Java installed on your system. Gradle, which React Native uses to create a native Android build, requires Java 11 to be installed on your system, whereas you only have version 1.8.
This means you need to install an up-to-date JDK, which you can do by following the React Native Environment Setup instructions for Android for your specific operation system.

failed to build a react timeline project

https://github.com/daybrush/scenejs-timeline
I'm want to run or build this react project on my PC but come across a bunch of errors. I thought it should have been since I am novice in reactjs. On the other hand, the author of the project has not replied to my issue yet. I am just wondering if there is someone to check it out and either it runs tells me my probable mistake or just tell me this project has some problems on its own.
I downloaded this project through this command:
git clone git#github.com:daybrush/scenejs-timeline.git
Successfully
I want to run the react-scenejs-timeline project under this folder : “scenejs-timeline\packages\react-scenejs-timeline”
by running these commands
npm install
npm start
but when run npm start
The following address opens in the browser
http://localhost:3000/daybrush/scenejs-timelin
And the below errors are shown in the browser console
Uncaught SyntaxError: Unexpected token '<' => bundle.js:1
Manifest: Line: 1, column: 1, Syntax error. => scenejs-timelin/manifest.json:1
What’s the problem?

React Native: Could not determine the dependencies of task ':app:installDebug'

I`ve been trying to run the default React Native App in my Android Emulator from Android Studio.
Yesterday I got the message that the Android sdk cant be found so i created the local.properties file in my android folder with (sdk.dir = C:\Users"MyUserName"\AppData\Local\Android\Sdk).
That worked but now i get another problem:
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:installDebug'.
> java.io.IOException: Die Syntax fuer den Dateinamen, Verzeichnisnamen oder die
Datentraegerbezeichnung ist falsch
* 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
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
I tried cd android -> gradlew clean but got the same Problem.
I also tried
npm install --save-dev jetifier->
npx jetify ->
npx react-native run-android but got the same Problem.
I googled for about 4 hours but cant find anything the solves my problem.
Im pretty new to react and react native but thanks in advance for your help.
Use \\ instead of \ in your pathvariable in local.properties
So this:
"sdk.dir = C:\Users"MyUserName"\AppData\Local\Android\Sdk"
becomes this:
"sdk.dir = C:\\Users"MyUserName"\\AppData\\Local\\Android\\Sdk"

"Maximum update depth exceeded" only on remote server

When I build and deploy my project on our NGINX server and then call the app I get the following error:
react-dom.production.min.js:198 Error: Minified React error #185; visit https://reactjs.org/docs/error-decoder.html?invariant=185 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at react-dom.production.min.js:13
at c (react-dom.production.min.js:14)
at nc (react-dom.production.min.js:243)
at Object.enqueueSetState (react-dom.production.min.js:130)
at e.y.setState (react.production.min.js:13)
at react-router.js:63
at t (history.js:155)
at history.js:173
at Array.forEach (<anonymous>)
at Object.notifyListeners (history.js:172)
The link in the error shows me the following explanation:
We highly recommend using the development build locally when debugging
your app since it tracks additional debug info and provides helpful
warnings about potential problems in your apps, but if you encounter
an exception while using the production build, this page will
reassemble the original text of the error.
And the error...
Maximum update depth exceeded. This can happen when a component
repeatedly calls setState inside componentWillUpdate or
componentDidUpdate. React limits the number of nested updates to
prevent infinite loops.
When I develop locally, I call the npm run-script dev which does the following:
webpack-dev-server --open --mode development
In my Jenkins job, I do this to build and deploy the application:
npm install --verbose
npm run-script build
Build is doing this: webpack --config ./webpack.config.js --mode production
Now to my problem:
The mentioned error leads to a white page and is not repeatable in my local environment. The error just occurs on the deployed app on the NGINX server.
I really don't know how to solve this issue that only occurs on the server and does not show any hints what the cause of this problem might be, but only tells me to fix this issue locally where the problem is not even present.
Does anyone have an idea what I can do to find out the cause of this, or even know the reason for the bug itself?

I'm using react-native-photo-upload library to upload profile pic but it's throwing build failed error

The libary I'm using is yarn add react-native-photo-upload from https://www.npmjs.com/package/react-native-photo-upload
and it's throwing the following error:
**/home/haseeb/Desktop/RN/myProject/node_modules/react-native-image-picker/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:15:21-54: AAPT: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
/home/haseeb/Desktop/RN/myProject/node_modules/react-native-image-picker/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:15: error: Error: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
:react-native-image-picker:processReleaseResources FAILED
**FAILURE**: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-image-picker:processReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 5.653 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html**
i tried android.enableAapt2=false in gradle.properties of react-native-image-picker but no gain...same error
plz help to resolve it!
Be sure to follow the instructions of the library, after running yarn add react-native-photo-upload
, you need to make sure to link the package and build the project again:
react-native link react-native-image-picker
react-native link react-native-image-resizer
react-native link react-native-fs
After that, you can go to yourProject/android/settings.gradle and verify if all modules have been added. It may look like:
include ':module-name'
project(':module-name').projectDir = new File(rootProject.projectDir,
'../node_modules/module-name/android')
You may also go to yourProject/android/app/build.gradle to check if the modules are present on the dependencies:
dependencies {
compile project(':module-name')
}

Categories

Resources