You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
--mode vs (deprecated) --variant flag - clarity required #2288
In the #2026 PR, the deprecated variant flag was swapped out for mode. Looking at the code in the pr, it looks like they effectively do the same thing on Android and pass the buildVariant into Gradle to get the relevant Gradle task.
However the docs/help seem to imply they don't work the same.
--variant Specify your app's build variant.
Whereas:
--mode Mode to build the app. Either 'debug' (default) or 'release'.
Seems to imply it can only be debug or release, and not a buildVariant string.
I used the original value of the variant parameter to pass into mode, and I found that the error message indicates a dependency content could not be found.
Like:
android/app/src/debug/java/cn/demo/app/ReactNativeFlipper.java:10: error: package com.facebook.flipper.android does not exist
import com.facebook.flipper.android.AndroidFlipperClient;
hey @zfben, your error is not related to this issue. If the problem still occurs please create new issue with the related description and reproduction steps.
Hello, after the upgrade from 0.72.8 to 0.74.1 I noticed that --variant is deprecated. I changed it to --mode but I noticed that the build was not on debug mode(not connected to metro). I tried to add this on build.gradle debuggableVariants = ["stagingdebug", "productiondebug"] but android won't connect to metro, I get error "could not load server". Is this related somehow?
Reacted by Khayyam Karimov, Fernando Severino Almeida, Marq Roldan and Abdelrahman A Boker
Activity
szymonrybczak commentedon Feb 8, 2024
hey @aljidy, I think we can update docs to also cover in
--mode's description that it can acceptbuildVariant. Do you mind sending PR updating this? 🙏cortinico commentedon Feb 8, 2024
I feel we should be able to remove --variant entirely at this point?
szymonrybczak commentedon Feb 8, 2024
@cortinico it's removed already.
cortinico commentedon Feb 8, 2024
Oh from the docs as well?
szymonrybczak commentedon Feb 9, 2024
Yup.
aljidy commentedon Feb 12, 2024
Thanks folks, will get a PR up later this week and ping you both
zfben commentedon Feb 22, 2024
I used the original value of the variant parameter to pass into mode, and I found that the error message indicates a dependency content could not be found.
Like:
Did I use it in wrong way?
szymonrybczak commentedon Feb 28, 2024
hey @zfben, your error is not related to this issue. If the problem still occurs please create new issue with the related description and reproduction steps.
Splanis commentedon May 23, 2024
Hello, after the upgrade from 0.72.8 to 0.74.1 I noticed that
--variantis deprecated. I changed it to--modebut I noticed that the build was not on debug mode(not connected to metro). I tried to add this on build.gradledebuggableVariants = ["stagingdebug", "productiondebug"]but android won't connect to metro, I get error "could not load server". Is this related somehow?