React native error install failed already exists - react-native

I just started working with react native. I created a new project using
react-native init ChatSample.
Then i run this command
react-native run-android --deviceId MYDEVICEID
Now after finishing 100% it shows this error
adb: failed to install app/build/outputs/apk/app-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install com.chatsample without first uninstalling.]
I moved to this folder and found that app-debug.apk exists there so i deleted it, but again when i run this command it shows same error.
Then i deleted the complete build folder and run this command but still got the same error. More precisely when it is around 50% it starts creating build folder and app-debug.apk and as soon as it reaches 100% app-debug.apk file is created in that folder. But why is the error coming, like this is a fresh project and all i did is just run two command first for creating project and other for running app.

You can open the project in Android Studio from the ProjectFile/android. Then build and run on your Phone

Is in your device the APK installed? Try uninstalling the APK from the device and then run the command again.

Related

How can I solve the error with "Run Gradlew" in Expo 46?

Hello to the whole community.
I am having a problem building my apk using the eas build -p android command, by the way, I'm using Expo SDK 46.
When the Run Gradlew process is executed, it gives me an error that does not allow the process to terminate correctly.
Attached screenshot of the process.
Run Gradlew Error
The error always appears in the expo-web-browser module.
I hope someone can help me, I already have two days with this error.
I have tried to modify the build.gradle file in node_modules/expo-react-native-adapter/android/build.gradle but it still doesn't work.

React-Native INSTALL_FAILED_UPDATE_INCOMPATIBLE:Package com.schoolproject signatures do not match previously installed version; ignoring

Execution failed for task ':app:installDebug'.
java.util.concurrent.ExecutionException: com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException:
INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.schoolproject signatures do not match previously installed version; ignoring!
Solution of that type error
U will get that type error if you are run on your mobile using npx react-native run-android
please uninstall app-release.apk app if you already installed it on your device.
1.1 why required to uninstall- because the same name two application unable to install
one application is release mode and one is on debug mode same name app.
then after run command npx react-native run-android
You might just have a same application in your device already, uninstall it and then run the app again.
Such error comes when your signature of the old version and new version does not match.
Read more here:
https://developer.android.com/studio/publish/app-signing
If you want to have multiple apps based on different types, then add productFlavours in your application.
Read more on that here.

Unable to load script from assets 'index.android.bundle'.Make sur your Bundle is packaged correctly

When i run react-native run-android the apps launch in my devices but gives he following error
I've tried the solve the problem using the folling links:
Unable to load script from assets 'index.android.bundle'.
Unable to load script from assets index.android.bundle on windows
But,i the problem is not solved.Before i tried to use as described in the official doc from : Running On Device
Nothings works for me,even after rebooting the pc which is running Windows 10
Try to exit from Node Packager CMD and stop all running CMD. Open new CMD in run as admin. Uninstall app from device. Again go to your project folder and do 'react-native run-android'.

React Native FCM not working

I am using this package https://github.com/evollu/react-native-fcm
I complete the installation process. The project is working. But every time I turn it on project. I am working ./gradlew clean on console. Other than that, I get the following error when I run
You can delete build folder, and recompile project again.

Unable to run react-native release build

I am trying to deploy my react-native app to android. I follow the steps on this page
https://facebook.github.io/react-native/docs/signed-apk-android.html.
When I try to run it, it tells me
not such file or directory '.../assets/index.android.bundle'
or I get
Task 'installReleaseDebug' not found in root project 'awezaEduApp'
Using Windows 10 and react-native 0.39.2
OUTCOME
I ended up having to reformat my laptop for other reasons and when i repeated the signing process it worked. On account of my previous efforts, prior to reformatting, I would presume that Eldelshell's answer would have solved it.
Note: I think that running gradle tasks in Android Studio's terminal would also work.
You need to execute react-native run-android at least once. Don't worry if it fails because you don't have the emulator running.
or I get Task 'installReleaseDebug' not found in root project 'awezaEduApp'
You have to execute gradle inside the android folder.
Task 'installReleaseDebug' not found in root project 'awezaEduApp'
For RN 0.39.x, you have to run the following for release build:
react-native run-android --configuration=release