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

Upgrade needed for Expo SDK 50 #4

Closed
mgscreativa opened this issue Jan 19, 2024 · 11 comments
Closed

Upgrade needed for Expo SDK 50 #4

mgscreativa opened this issue Jan 19, 2024 · 11 comments

Comments

@mgscreativa
Copy link
Contributor

Hi! I have tried to test the plugin against Expo SDV 50 and I failed! Please check my updated repo https://github.com/mgscreativa/react-native-code-push-plugin

Using this code I get


[PREBUILD] Error: [android.appBuildGradle]: withAndroidAppBuildGradleBaseMod: Cannot find a suitable place to insert the CodePush buildscript dependency.
[PREBUILD] Error: [android.appBuildGradle]: withAndroidAppBuildGradleBaseMod: Cannot find a suitable place to insert the CodePush buildscript dependency.
[PREBUILD]     at applyImplementation (/tmp/martinb/eas-build-local-nodejs/7781311d-ca71-42db-86ef-b16da0352a20/build/plugins/react-native-code-push-plugin/android/buildscriptDependency.js:27:11)
[PREBUILD]     at /tmp/martinb/eas-build-local-nodejs/7781311d-ca71-42db-86ef-b16da0352a20/build/plugins/react-native-code-push-plugin/android/buildscriptDependency.js:36:48
[PREBUILD]     at action (/tmp/martinb/eas-build-local-nodejs/7781311d-ca71-42db-86ef-b16da0352a20/build/node_modules/@expo/config-plugins/build/plugins/withMod.js:201:29)
[PREBUILD]     at interceptingMod (/tmp/martinb/eas-build-local-nodejs/7781311d-ca71-42db-86ef-b16da0352a20/build/node_modules/@expo/config-plugins/build/plugins/withMod.js:105:27)
[PREBUILD]     at action (/tmp/martinb/eas-build-local-nodejs/7781311d-ca71-42db-86ef-b16da0352a20/build/node_modules/@expo/config-plugins/build/plugins/withMod.js:206:14)
[PREBUILD]     at async interceptingMod (/tmp/martinb/eas-build-local-nodejs/7781311d-ca71-42db-86ef-b16da0352a20/build/node_modules/@expo/config-plugins/build/plugins/withMod.js:105:21)
[PREBUILD] 
Error: npx expo prebuild --no-install --platform android exited with non-zero code: 1
    at ChildProcess.completionListener (/home/martinb/.npm/_npx/994d822063d9f19d/node_modules/@expo/spawn-async/build/spawnAsync.js:42:23)
    at Object.onceWrapper (node:events:632:26)
    at ChildProcess.emit (node:events:517:28)
    at maybeClose (node:internal/child_process:1098:16)
    at ChildProcess._handle.onexit (node:internal/child_process:303:5)
    ...
    at spawnAsync (/home/martinb/.npm/_npx/994d822063d9f19d/node_modules/@expo/spawn-async/build/spawnAsync.js:7:23)
    at spawn (/home/martinb/.npm/_npx/994d822063d9f19d/node_modules/@expo/turtle-spawn/dist/index.js:16:47)
    at runExpoCliCommand (/home/martinb/.npm/_npx/994d822063d9f19d/node_modules/@expo/build-tools/dist/utils/project.js:28:47)
    at prebuildAsync (/home/martinb/.npm/_npx/994d822063d9f19d/node_modules/@expo/build-tools/dist/common/prebuild.js:25:43)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /home/martinb/.npm/_npx/994d822063d9f19d/node_modules/@expo/build-tools/dist/builders/android.js:51:9
    at async BuildContext.runBuildPhase (/home/martinb/.npm/_npx/994d822063d9f19d/node_modules/@expo/build-tools/dist/context.js:98:28)
    at async buildAsync (/home/martinb/.npm/_npx/994d822063d9f19d/node_modules/@expo/build-tools/dist/builders/android.js:45:5)
    at async runBuilderWithHooksAsync (/home/martinb/.npm/_npx/994d822063d9f19d/node_modules/@expo/build-tools/dist/builders/common.js:12:13)
    at async Object.androidBuilder (/home/martinb/.npm/_npx/994d822063d9f19d/node_modules/@expo/build-tools/dist/builders/android.js:24:16)

Build failed
Unknown error. See logs of the Prebuild build phase for more information.
npx exited with non-zero code: 1
    Error: build command failed.

@GSTJ
Copy link
Owner

GSTJ commented Jan 19, 2024

I haven’t yet been able to test it against v50.

I’ll do some tests on the weekend, hope to have this support soon.

Thanks for reporting.

@mgscreativa
Copy link
Contributor Author

mgscreativa commented Jan 20, 2024

@GSTJ Thanks a lot! I tried to bump to expo SDK 50 and rebuilt the plugin (I still don't know how I managed to do that! jajaja) but this issue arise.

I think it might be related to changes on Android switching from java to kotlin in RN 0.73 https://expo.dev/changelog/2024/01-18-sdk-50#%E2%9E%A1%EF%B8%8F-upgrading-your-app and maybe some changes in codepush RN package too microsoft/react-native-code-push@357cbea but as I don't know where exactly to touch anything, I was unable to fix it

imagen

@GSTJ
Copy link
Owner

GSTJ commented Jan 20, 2024

I've been working on setting up CodePush with the latest version of Expo. My progress can be seen in this pull request: #5.

So far, I've managed to integrate CodePush in a way that seems logical for my plugin, and happily, the Expo prebuilds no longer fail and reflect the changes I've implemented. However, I'm encountering an issue: the Android build is failing.

This is a problem originating from CodePush itself and suggests a lack of compatibility with Kotlin. You can see the specific error details in the screenshot attached from my build process.

Captura de Tela 2024-01-20 às 12 42 08

I have yet to find any particular updates on the code push repo on how to integrate with Kotlin; let me know if you have any ideas. I accept contributions, too. We might need to wait. (and everyone else using React Native)

You can try my changes out with npm i react-native-code-push-plugin@beta

@GSTJ
Copy link
Owner

GSTJ commented Jan 20, 2024

@GSTJ
Copy link
Owner

GSTJ commented Jan 20, 2024

Let me know if you're able to test with the above patch + my beta release. If it looks alright, I can merge and push to latest.

@mgscreativa mgscreativa changed the title Upgrade needed fo rExpo SDK 50 Upgrade needed for Expo SDK 50 Jan 22, 2024
@mgscreativa
Copy link
Contributor Author

mgscreativa commented Jan 22, 2024

Thanks! testing it right away.

You need to update package deps, maybe somehow tell that at least needs SDK 49 or above

imagen

imagen

@mgscreativa
Copy link
Contributor Author

Just sent PR for that requirements thing

@mgscreativa
Copy link
Contributor Author

mgscreativa commented Jan 22, 2024

Not needed anymore

@mgscreativa
Copy link
Contributor Author

Hi! I can confirm that your changes and the ones suggested in microsoft/react-native-code-push#2649 on local react-native-code-push solved the issue with Expo SDK 50.

After applying those changes and adjusting some minor code upgrades/deprecations in my app (not related to codepush nor your plugin) the build succeeds and the codepush update is working after pushing an update to the app

@GSTJ
Copy link
Owner

GSTJ commented Jan 22, 2024

Thanks for the help testing! Merged both PRs and made a final public release at 1.0.6.

@GSTJ GSTJ closed this as completed Jan 22, 2024
@mgscreativa
Copy link
Contributor Author

Great! Thanks a lot!

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

No branches or pull requests

2 participants