Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CodePush is not work Expo 46.0.16 react-native 0.69.6 #2366

Closed
augustovogt opened this issue Nov 3, 2022 · 30 comments
Closed

CodePush is not work Expo 46.0.16 react-native 0.69.6 #2366

augustovogt opened this issue Nov 3, 2022 · 30 comments
Labels

Comments

@augustovogt
Copy link

Hi All,
I am new in Code Push, I have following error in Android with Simulator or Devices:
I am followin guide: https://github.com/microsoft/react-native-code-push/blob/HEAD/docs/setup-android.md seccion: 'Plugin Installation and Configuration for React Native 0.60 version and above (Android)'
and also https://learn.microsoft.com/en-us/appcenter/sdk/getting-started/react-native for

Error:
The CodePush module doesn't appear to be properly installed. Please double-check that everything is setup correctly.

TypeError: undefined is not an object (evaluating 'CodePush.CheckFrequency')
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:95:17 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:141:19 in handleException
at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:39 in handleError
at node_modules/expo/build/errors/ExpoErrorManager.js:25:19 in errorHandler
at node_modules/expo/build/errors/ExpoErrorManager.js:30:24 in
at node_modules/@react-native/polyfills/error-guard.js:49:36 in ErrorUtils.reportFatalError
at node_modules/metro-runtime/src/polyfills/require.js:203:40 in guardedLoadModule
at http://192.168.1.48:19000/index.bundle?platform=android&dev=true&hot=false&strict=false&minify=false:null in global code

Invariant Violation: "main" has not been registered. This can happen if:

  • Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
  • A module failed to load due to an error and AppRegistry.registerComponent wasn't called.
    at node_modules/react-native/Libraries/Core/ExceptionsManager.js:95:17 in reportException
    at node_modules/react-native/Libraries/Core/ExceptionsManager.js:141:19 in handleException
    at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:39 in handleError
    at node_modules/expo/build/errors/ExpoErrorManager.js:25:19 in errorHandler
    at node_modules/expo/build/errors/ExpoErrorManager.js:30:24 in
    at node_modules/@react-native/polyfills/error-guard.js:49:36 in ErrorUtils.reportFatalError

Extract My App,js

import CodePush from "react-native-code-push"

codePushOptions = { checkFrequency: CodePush.CheckFrequency.MANUAL };

App = CodePush(codePushOptions)(App);

export default App;

My package.json:

"dependencies": {
"appcenter": "4.4.5",
"appcenter-analytics": "4.4.5",
"appcenter-crashes": "4.4.5",
"expo": "~46.0.16",
"expo-splash-screen": "~0.16.2",
"expo-status-bar": "~1.4.0",
"react": "18.0.0",
"react-dom": "18.0.0",
"react-native": "0.69.6",
"react-native-code-push": "^7.0.5",
"react-native-web": "~0.18.7"
},
"devDependencies": {
"@babel/core": "^7.12.9"
},
"private": true

I have tried different options and nothing

Can I use code push with expo?

Could someone please give me some guidance?

Thanks.

@ammarkdn
Copy link

up

@pnthach95
Copy link

CodePush can't work with Expo app, but I think bare workflow app can. Expo has expo-updates same as CodePush. Why don't you use it?

@hugohow
Copy link

hugohow commented Jan 4, 2023

Maybe because codepush is free and expo-updates is really expensive

@deggertsen
Copy link

I've submitted a pull request for review, but until it's actually approved and usable you can go here to get the plugin to manually add it to your Expo project. Keep in mind that react-native-code-push will not work with a managed expo app. Using this plugin will require you to use the bare workflow, but it will do all of the codepush configuration for you so that you shouldn't need to touch the native build files.

https://github.com/deggertsen/react-native-code-push-expo-plugin

@jakobsuckow
Copy link

@deggertsen With the forthcoming PR, do I still need to switch my expo managed workflow to the bare workflow ?

@deggertsen
Copy link

@deggertsen With the forthcoming PR, do I still need to switch my expo managed workflow to the bare workflow ?

I'm using the bare workflow. It might be possible to do it with managed, but I'm not sure.

@jakobsuckow
Copy link

@deggertsen With the forthcoming PR, do I still need to switch my expo managed workflow to the bare workflow ?

I'm using the bare workflow. It might be possible to do it with managed, but I'm not sure.

Thanks for the reply

@microsoft-github-policy-service
Copy link
Contributor

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.

@deggertsen
Copy link

I believe this is still an active issue so long as the PR is still open.

@bryanprimus
Copy link

bryanprimus commented Jun 29, 2023

Maybe because codepush is free and expo-updates is really expensive

I believe you can use your own server @hugohow

@LukePJN
Copy link

LukePJN commented Jul 12, 2023

Would be really cool if it worked on an expo-managed workflow.

@mgscreativa
Copy link

I've submitted a pull request for review, but until it's actually approved and usable you can go here to get the plugin to manually add it to your Expo project. Keep in mind that react-native-code-push will not work with a managed expo app. Using this plugin will require you to use the bare workflow, but it will do all of the codepush configuration for you so that you shouldn't need to touch the native build files.

https://github.com/deggertsen/react-native-code-push-expo-plugin

Hi! did your PR got approved?

@deggertsen
Copy link

Hi! did your PR got approved?

Still awaiting review. The PR could also be improved if anyone wanted to contribute.
#2415

@mgscreativa
Copy link

Hi! how can I contribute to it? I was thinking on build test and try to push forward for approval, but I have little to none experience with this, so if you help me go through it, I can contribute

@mgscreativa
Copy link

mgscreativa commented Aug 8, 2023

Hi! continuing with this issue, I think CodePush shuld explicitly support Expo projects. I tried the plugin by @deggertsen and it works but trying to send a deployment with CodePush fails in an Expo managed workflow project, because it lacks of /android and /ios folders. Any Workaround?

More info here deggertsen/react-native-code-push-expo-plugin#2 (comment)

@Mukhammadali
Copy link

@mgscreativa Did you try it with an expo-managed custom dev client which enables using 3rd party native libraries using expo config plugins without ejecting or migrating to bare workflow?

@mgscreativa
Copy link

mgscreativa commented Aug 9, 2023

Hi! @Mukhammadali thanks for your answer, I have published a test repo here https://github.com/mgscreativa/react-native-code-push-expo-plugin-managed-workflow

It uses Expo dev client and yesterday I was able to push a boundle through CP. Will write my findings later.

@mgscreativa
Copy link

Hi! did your PR got approved?

Still awaiting review. The PR could also be improved if anyone wanted to contribute. #2415

Hi @deggertsen what can I do to contribute and push this PR for approval?

@mgscreativa
Copy link

Hi @Mukhammadali here you have my updated repo with plenty of documentation about the process to get this working. I confirm it does work flawlessly! https://github.com/mgscreativa/react-native-code-push-expo-plugin-managed-workflow

@Mukhammadali
Copy link

Hi @Mukhammadali here you have my updated repo with plenty of documentation about the process to get this working. I confirm it does work flawlessly! https://github.com/mgscreativa/react-native-code-push-expo-plugin-managed-workflow

Thanks man

@deggertsen
Copy link

Hi! did your PR got approved?

Still awaiting review. The PR could also be improved if anyone wanted to contribute. #2415

Hi @deggertsen what can I do to contribute and push this PR for approval?

There were some requests from a reviewer on the PR. I think I solved all of them, but it may be beneficial for a second set of eyes to look over the requests and see if there is anything I missed.

I approved your PR to my plugin repo. I would think that some of those additions may be beneficial to the code-push PR?

@mgscreativa
Copy link

I have look at the PR code and my PR to your plugin repo is based on this PR and tested as in my demo repo for Expo Dev Clients.

So I think that this PR should be approved.

Maybe you can guide me to build instructions for this package to double check everything builds correctly, but apart from this, I think that some package mantainer should point us what else may be done for PR approval.

@mgscreativa
Copy link

mgscreativa commented Aug 10, 2023

Just wonder which requests from a reviewer on the PR are they? can you enumerate them?

@deggertsen
Copy link

The suggestions here are what I referred to. I think I addressed them all already, but might be good to double check. #2415 (review)

@mgscreativa
Copy link

I have double checked the code and seems legit

@deggertsen
Copy link

I guess we're just waiting on approval for the merge then.

@brentvatne
Copy link

reaching out on behalf of the Expo team here -- if the folks working on CodePush run into any issues with supporting Expo apps, just let us know and we can help out! as far as I know, the process should be the same as integrating any other native library that requires a config plugin. it looks like @mgscreativa's PR #2415 handles that well!

@mgscreativa
Copy link

Thanks @brentvatne but all credits go to @deggertsen!

Copy link
Contributor

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.

Copy link
Contributor

This issue will now be closed because it hasn't had any activity for 15 days after stale. Please feel free to open a new issue if you still have a question/issue or suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests