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
Hello,
I am trying to use react-native-version with and ejected expo project. The version in the app.json get incremented but not the one in the Android and in the iOS Project.
It seems that the Expo detection will not check if the project is ejected or not, only if the app.json contains an Expo key.
I believe that checking for the Expo key and for the isDetached could be a way to support Expo detached app and increment the version in the native folders.
Thanks
Reacted by Marian Gaebler, scriptspry, Zach Holmes, Summer Kiflain, Montlouis-Calixte Stéphane and Tim Hooker
It should be pretty easy to test. Maybe some other tweaks will be required to update both the Expo config and the RN app, when ejected - if that's what we want.
@stovmascript I did a bit search and I found out there's not a full-proof way to understand if a RN expo project is ejected (or bare flow) or not.
What I think of creating as PR is to have an additional option in CLI to force updating of native files even if expo has been detected. And leave it up to the user to fix his situation.
Or something like --ignore-expo totally.
Reacted by Agape Apps, Yogesh Agarwal and Manuel Bieh
@killerchip What about removing the expo key from app.json after ejecting? Is it needed for usage with the Expo SDK after ejecting? (Sorry, I don't use Expo.)
@stovmascript I'm using expo but not an expo expert myself.
My tests showed:
Using expo-cli to initiate an expo-bare workflow, it does create the expo key in app.json. Removing it has not issue. The app run fine.
Using the expo-cli to initial an expo-managed workflow, and then eject, cannot compile my app at all. So I could not tested it at atm.
Anyway, the solution I'm proposing is not obtrusive. It's an opt-in and removes the concern of managing edge cases with expo from your package, and gives this flexibility to user.
@stovmascript if the Pullrequest could be accepted it would be awesome!
I'm having the same problems with an ejected expo app, not actually updating the version numbers.
Another option would be to include instructions on how to update the Android and iOS build steps to READ the version information from the "app.json" file.
I'm actually more inclined to do it the other way around and introduce some --expo option for Expo projects. That way, there wouldn't be a need for any "isExpoProject" logic. On the other hand, it would be a breaking change, but I guess it's not that big of a deal for people to add a flag to their setups.
I would absolutely love an --expo option. As of now, I am still using app.json information even though the project is ejected, so simply deleting does not do the trick.
In the meantime I am just bypassing the problem by adding sth. like this in my package.json scripts for example:
As a workaround, you may convert your app.json to a app.config.js file, which prevents react-native-version from detecting it as a managed Expo project.
Reacted by Dipesh Wagle, Jarell Pryor and ponchautf
As a workaround, you may convert your app.json to a app.config.js file, which prevents react-native-version from detecting it as a managed Expo project.
I just tried this workaround and got it to work. Minor correction for future searchers. You'll want to convert your app.json into an app.config.json file.
Activity
stovmascript commentedon May 20, 2019
@jeremybdk Sorry for not replying earlier, I'm pretty busy atm, also in the middle of moving.
Seems like that could work. Would you like to submit a PR? The check whether the app is an Expo app or plain RN is here:
react-native-version/index.js
Lines 69 to 78 in 89fa937
It should be pretty easy to test. Maybe some other tweaks will be required to update both the Expo config and the RN app, when ejected - if that's what we want.
killerchip commentedon Oct 6, 2019
@stovmascript I did a bit search and I found out there's not a full-proof way to understand if a RN expo project is ejected (or bare flow) or not.
What I think of creating as PR is to have an additional option in CLI to force updating of native files even if expo has been detected. And leave it up to the user to fix his situation.
Or something like
--ignore-expototally.stovmascript commentedon Oct 7, 2019
@killerchip What about removing the
expokey from app.json after ejecting? Is it needed for usage with the Expo SDK after ejecting? (Sorry, I don't use Expo.)killerchip commentedon Oct 8, 2019
@stovmascript I'm using expo but not an expo expert myself.
My tests showed:
Using expo-cli to initiate an expo-bare workflow, it does create the expo key in
app.json. Removing it has not issue. The app run fine.Using the expo-cli to initial an expo-managed workflow, and then
eject, cannot compile my app at all. So I could not tested it at atm.Anyway, the solution I'm proposing is not obtrusive. It's an opt-in and removes the concern of managing edge cases with expo from your package, and gives this flexibility to user.
But it's your call in the end :-)
nexorianus commentedon Mar 24, 2020
@stovmascript if the Pullrequest could be accepted it would be awesome!
I'm having the same problems with an ejected expo app, not actually updating the version numbers.
yaeda commentedon Jul 22, 2020
@stovmascript Even if expo is ejected, there are modules that use
expokey in app.json. I think it is a good idea to introduce--ignore-expooption.ex.) expo-updates - npm
cjthompson commentedon Aug 10, 2020
Another option would be to include instructions on how to update the Android and iOS build steps to READ the version information from the "app.json" file.
Here's an easy way to do it in Android:
for iOS I found this suggested solution
stovmascript commentedon Aug 11, 2020
I'm actually more inclined to do it the other way around and introduce some
--expooption for Expo projects. That way, there wouldn't be a need for any "isExpoProject" logic. On the other hand, it would be a breaking change, but I guess it's not that big of a deal for people to add a flag to their setups.crolly commentedon Nov 24, 2020
I would absolutely love an
--expooption. As of now, I am still using app.json information even though the project is ejected, so simply deleting does not do the trick.In the meantime I am just bypassing the problem by adding sth. like this in my
package.jsonscripts for example:"bump:build": "yarn react-native-version -b && mv app.json app--.json && yarn react-native-version -b && mv app--.json app.json"summerkiflain commentedon Mar 8, 2021
@cjthompson I have tried below for iOS but its not working for me, version and buildNumber doesn't change.
and changed my
Bundle React Native code and imagesbuild phase to:can you share how you configured it for iOS?
agape-apps commentedon Aug 7, 2021
Please apply one of these two PR's which would fix the issue:
--ignore-expo cli option by killerchip · Pull Request #150
Adds two CLI options: --is-bare-expo-workflow and --is-self-hosting-bundles by zibs · Pull Request #243
IjzerenHein commentedon Feb 14, 2022
As a workaround, you may convert your
app.jsonto aapp.config.jsfile, which preventsreact-native-versionfrom detecting it as a managed Expo project.jarell4 commentedon Nov 7, 2022
I just tried this workaround and got it to work. Minor correction for future searchers. You'll want to convert your
app.jsoninto anapp.config.jsonfile.