Git Product home page Git Product logo

Comments (3)

szymonrybczak avatar szymonrybczak commented on May 24, 2024 1

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.

jpetersen23 avatar jpetersen23 commented on May 24, 2024 1

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.

jpetersen23 avatar jpetersen23 commented on May 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.