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
[Android] Upgrade of CLI from 3.x to 4.x (with RN 0.62) breaks --appIdSuffix #1085
This has worked thus far with the CLI v3.x, but as we upgraded our project to React Native 0.62.0, the CLI was upgraded to v4.4.
Now we're getting the following error when the app builds, running the same command:
$ react-native run-android --appIdSuffix debug
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1976 file(s) to forward-jetify. Using 16 workers...
info JS server already running.
info Installing the app...
<snip>
FAILURE: Build failed with an exception.
* What went wrong:
Task 'installDebugDebug' not found in project ':app'.
Note: I've just generated a 0.62 project with npx react-native init, and added an extra commit on top of that with applicationIdSuffix: cbrevik/suffixExample@d6129ec
Thanks for the repro, we'll try to prioritize this. I suspect these might be commits that introduced this regression: #1029, #1053. Any help with debugging this and contributing a fix is greatly appreciated 😊
Even though that works, it seems like the options should work in a different way.
As far as I understand, a build variant in Android is the full name of the build type with the flavor. So for example the build type could be debug, while the flavor could be demo, which makes the build variant demoDebug. I'm not an expert at gradle though, so 🤷♂
In this case, the appIdSuffix should only be used when launching the app, not when building it. I think the appIdSuffix doesn't have to be the same as the build type, so concatenating the suffix + variant probably isn't a good idea?
So maybe it's better if people specify the "full" variant name to build with --variant while --appIdSuffix only helps the CLI launch the correct package.
Activity
thymikee commentedon Mar 31, 2020
Thanks for the repro, we'll try to prioritize this. I suspect these might be commits that introduced this regression: #1029, #1053. Any help with debugging this and contributing a fix is greatly appreciated 😊
Temp. workaround for CLI bug
cbrevik commentedon Mar 31, 2020
Sure! This seems like the bug: 19ac71f#diff-b668aefc66b33ed6e984d3467db0abc1R54 (concat
appIdSuffixtovariantin order to generate the task name).The workaround for me was to just overwrite the task name, with:
Even though that works, it seems like the options should work in a different way.
As far as I understand, a build variant in Android is the full name of the build type with the flavor. So for example the build type could be
debug, while the flavor could bedemo, which makes the build variantdemoDebug. I'm not an expert at gradle though, so 🤷♂In this case, the
appIdSuffixshould only be used when launching the app, not when building it. I think theappIdSuffixdoesn't have to be the same as the build type, so concatenating the suffix + variant probably isn't a good idea?So maybe it's better if people specify the "full" variant name to build with
--variantwhile--appIdSuffixonly helps the CLI launch the correct package.I've commited a fix here; AtB-AS@bd297f4
I'd love to open a PR in this case, if it seems like the right solution.
thymikee commentedon Mar 31, 2020
@krizzu what do you think? ^
krizzu commentedon Mar 31, 2020
I agree that CLI params naming are bit misleading here, so I'm up for the change.
Upgrade React Native to 0.62.0 (#122)
Esemesek commentedon Apr 5, 2020
Fixed in #1087