The android device show "App isn't installed" after upgrade React Native 0.70.5 - react-native

I upgraded my react-native project from 0.69.6 to 0.70.5
I run "npx react-native run-android" on my android device. It show "App isn't installed" when I click the app. If I go to device settings -> my app -> click "OPEN" button, then the app can run successfully. I can see the loading in bundle.
I have added applicationIdSuffix on android/app/build.grade. This setup always used.
buildTypes {
debug: {
applicationIdSuffix ".dev"
}
}
My AndroidManifest package is "com.companyname.xxxx.android"
May I know how to solve this issue? Thank you everyone.

Related

iOS Dir Not Found (but it exists) and React Native Config shows settings as null

I wanted to test my react native project on iOS (my app works correctly for Android). I do have an iOS folder in my project directory, but I never did anything for iOS in the past. While I was on 0.59, I have since upgraded successfully to React 0.69 and it runs in Android again. Now I would like to try iOS and I typed
react-native run-ios
and the output was:
error iOS project folder not found. Are you sure this is a React Native project?.
The thing is, there is an iOS folder, and lots of files in there as well. After some investigation, I believe my configuration is not setup right. I typed the following command:
react-native config
And here is a snippet of that output.
"healthChecks": [],
"platforms": {
"ios": {},
"android": {}
},
"project": {
"ios": null,
"android": {
"sourceDir": "<my path is here and valid>",
"appName": "app",
"packageName": "com.sensebot"
}
}
I would imagine the fact ios is null is the problem! Why is this null, and how do I configure it? I read you can override this configuration with a react native config file. I don't have one in my directory. Do I need that? If not, where do I configure this, and how is it that it was configured correctly for Android, but not iOS?
Thank you in advance for any help!

Execution Failed for task :app:compileDebugJavaWithJavac in React Native

i install react navigation version 6 and i want to use drawer navigation in project
for that install all packages of drawer navigation and make changes in
babel.congile file = plugins: ["react-native-reanimated/plugin"],
Second change in MainActivity.java file
"import android.os.Bundle;"
"import com.facebook.react.bridge.JSIModulePackage"
"import com.swmansion.reanimated.ReanimatedJSIModulePackage"
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(null);
}
#Override
protected JSIModulePackage getJSIModulePackage() {
return new ReanimatedJSIModulePackage();
}
}
also i changes the andrion app buid.gradlew
project.ext.react = [
enableHermes: true, // clean and rebuild if changing
]
when remove all these changes then Project buid succeeded and run
when i use the JS Module Packages then i face the above error
so My React native version 0.67
so any body can helper
hi #waqas i think you are using the latest version of react native reanimated.
please try to downgrade react native reanimated version to
"react-native-reanimated": "^1.13.2",
may be helps this;
Please refer to this GitHub thread https://github.com/facebook/react-native/issues/35210. It worked for me!
The steps I followed:
Deleted node_modules
Changed "react-native" package version (in the package.json file) from "0.70.1" to the latest patch I found in the thread (that was "0.70.5" for me)
Ran npm install to generate again the node_modules folder (you may want to use yarn install if your project is based on yarn packages)
Then cd android && ./gradlew clean
Finally cd .. (back to root folder) and npm run android to build the app.
Note that I followed the instructions for React Native >= 0.63 (version)
Hope this works for somebody else too!

React native custom buildType not using metro

I need to build the same app to different applicationIds so that I can publish it on the Play Store / App Store as private applications for some of the customers of my company.
I decided to use react-native-config, as it should allow me to change applicationId and some env variables easily.
I have created some .env.${variant} files, that is, in the following examples, .env.customer1.
I have set the needed buildTypes as follows:
...
buildTypes {
debug {
...
}
customer1 {
initWith debug
applicationIdSuffix "customer1"
}
}
I forced react.gradle not to bundle when building with these variants
project.ext.react [
bundleInCustomer1: false,
devDisabledInCustomer1: false
]
Then I use this command line to run on my physical device
copy .env.customer .env && react-native run-android --variant=customer1 --appIdSuffix 'customer1'
The result is that the app is built and launched on my device, but what I see is an old version of the app (probably the last one that I have built using assembleRelease, some weeks ago), metro getting launched but telling me this when I try to force a reload, otherwise telling me nothing
warn No apps connected. Sending "reload" ...
I tried without any success
gradlew clean
npm start --cache-reload
npm cache clean --forced
npm i
Building the app without any variant (thus using default debug) correctly works.
Thanks to this answer, I've succeeded in solving my issue.
Instead of using buildTypes now I'm using flavors.
So,
android {
...
flavorDimensions "standard"
defaultConfig {
applicationId "com.stackoverflow"
...
productFlavors {
customer1 {
applicationId "com.stackoverflow.customer1"
dimension "standard"
}
}
}
and launching via
react-native run-android --variant=customer1Debug --appIdSuffix 'customer1'

Flipper: Flipper Hermes debugger does not show

Flipper Hermes debugger does not show
I would like to ask how to make him display normally?
react-native:0.62.2 (Update from 0.61 to 0.62.2)
https://fbflipper.com/
https://reactnative.dev/docs/hermes
error message:
Metro is connected but no Hermes apps were found.
Open a React Native screen with Hermes enabled to connect. Note: you may need to reload the app in order to reconnect the device to Metro.
Following this in android/app/build.gradle file
project.ext.react = [
entryFile: "index.js",
enableHermes: true
]
And this in proguard-rules.pro file
-keep class com.facebook.hermes.unicode.** { *; }
-keep class com.facebook.jni.** { *; }
And
$ cd android && ./gradlew clean
Worked for me
In my case it was showing screen mentioned at https://github.com/facebook/flipper/issues/1520
I found out that it was happening due to company VPN. I disconnected the VPN whenever I had to debug and it worked normally.
Changing the below config in android/app/gradle.properties worked for me.
expo.jsEngine=hermes
And then cd android && ./gradlew clean
You can also verify if hermes is enabled by adding below snippet to App.js or any other .js file in react native.
const isHermes = () => !!global.HermesInternal;
console.log("Is Hermes enabled " + isHermes())

react-native-camera crashed my application

When I add dependencies for QrCode Scanner(react-native-camera) and running project, my app is crashing and is not working.
Add permissions to your app android/app/src/main/AndroidManifest.xml file:
<uses-permission android:name="android.permission.CAMERA" />
Insert the following lines in android/app/build.gradle:
android {
...
defaultConfig {
...
missingDimensionStrategy 'react-native-camera', 'general'
}
}
for reference check this
[1]: https://github.com/react-native-community/react-native-camera/blob/master/docs/installation.md#requirements
I face the same situation when I ejected my app from expo and tries to use react-native-camera.
If you are using both expo-camera and react-native-camera, then the app will crash when the camera is open, just use one of the libraries will be fine, for me, I just uninstall both cameras, then re-install react-native-camera, and the camera works!