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)
- 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
- Something is trying to use the devDependency 'metro-config' when building a production release build HOT 4
- Fail to download yarn if there is expired GITHUB_TOKEN HOT 4
- Android SDK: Not Found HOT 1
- Project initialization hangs HOT 5
- Failure of pod install for the React Native project using Yarn Berry - Yarn 3.x or 4.x. HOT 3
- Getting Error While initialization react native app in ubuntu HOT 12
- Undeclared identifer in OnLoad.cpp.o HOT 11
- Able to build ios app but unable to get build settings to deplou HOT 2
- Handle prompts in `init` command HOT 1
- React Native Build Failed After update build.gradle compileSdkVersion=34
- Read main activity from manifest not correctly handling activities with "missing" intent nodes
- How to fix CompileC normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'Pods-urbex' from project 'Pods') failure in react-native ios HOT 1
- Experimental debugger support for custom hostnames HOT 1
- AndroidManifest.xml intent-filter error
- please Help me I can't fix this error HOT 2
- Build Failed HOT 5
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.