Comments (3)
hey @jpetersen23 if you want to specify --mode
when running Android app from watch mode (while running yarn start
) → you need to provide watchModeCommandParams inside your react-native.config.js
, so you need to compose something like this:
module.exports = {
project: {
android: {
watchModeCommandParams: ['--mode', 'whateverYouWant'],
},
},
}
from cli.
Thanks @szymonrybczak that worked to get me passed the build error!
For future people who may look at my specific patch, the body of my react-native.config.js
also required adding --appId
to launch the right apk (if you use just a suffixId in your gradle which I didnt in my example, you can use --appIdSuffix
):
module.exports = {
project: {
ios: {},
android: {
// https://github.com/react-native-community/cli/issues/2359#issuecomment-2061289989
watchModeCommandParams: [
'--mode',
'developmentrelease',
'--appId',
'com.reactnativeconfigtestapplatest.development',
],
},
},
};
from cli.
Turns out I spoke too soon, I seem to have broken live reloading of tsx changes. Additionally when I hit r in watch mode (yarn start) I see:
warn No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.
info Reloading connected app(s)...
And nothing updates.
I confirmed the same is true if I run the commands directly as
react-native run-android --mode developmentrelease --appId com.reactnativeconfigtestapplatest.development
I also confirmed its not a debug mode thing by trying
react-native run-android --mode developmentdebug --appId com.reactnativeconfigtestapplatest.development
And that also doesnt cause it to live update again (or reload with R in the console or in the app itself).
UPDATE:
I needed to add things to the debuggable variants list.
/* Variants */
// The list of variants to that are debuggable. For those we're going to
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
debuggableVariants = ["developmentdebug", "developmentrelease"]
from cli.
Related Issues (20)
- Health Check Plugin isn't executed when running `react-native doctor` HOT 2
- react-native run-android: Failed to install the app on the device. Error: Could not find the correct install APK file.
- How to build android release but with JS dev flag enabled?
- On Android, app isn't opened automatically if applicationId is changed HOT 1
- API not working in React native android but working in ios. HOT 1
- Can CRNA change name inside project like NPX react-native init? HOT 1
- ✖ Could not create an empty Git repository, see debug logs with --verbose HOT 2
- Execution failed for task ':app:buildCMakeDebug[x86]' HOT 4
- Stuck at info JS server already running on Linux 22.04 HOT 1
- Proposal: @react-native-community/template versioning scheme HOT 5
- Unsupported class file major version 66 error. HOT 5
- Error type 3 Error: Activity class {....} does not exist HOT 2
- cannot start Android emulator version 34.1.20.0 (build_id 11610631) HOT 1
- Cannot find module 'execa' when running npx react-native clean
- Android Studio - Required for building and installing your app on Android HOT 16
- (node:23249) [DEP0040] DeprecationWarning: The punycode module is deprecated HOT 5
- error index.js: Cannot read properties of undefined (reading 'match'). HOT 1
- Error on fresh projects in Lauching app in the emulator, RN -v 0.73 - Starting: intent HOT 3
- sdk version problem HOT 1
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 cli.