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
I upgraded my bare React Native project from Expo SDK 49 to 50 following the great new upgrade helper from Expo. This made to process of upgrading much simpler, but there was one slight problem. The MainApplication.kt file seems to have a broken getPackages() method. When I originally migrated the file from Java to Kotlin, I wrote it as described in the Expo Upgrade Helper
override fun getPackages(): List<ReactPackage> {
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return PackageList(this).packages
}
Uncommenting the packages.add call fails the build.
I looked at the React Native guide for creating a Native Module and found this code block for the getPackages() method.
override fun getPackages(): List<ReactPackage> =
PackageList(this).packages.apply {
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
add(MyAppPackage())
}
I rewrote the code as suggested by that documentation and it builds and works as expected.
bpeltonc
changed the title
[docs] Following SDK 50 Native Upgrade Helper doesn't show how to properly link a custom Android Native Module
[docs] SDK 50 Native Upgrade Helper doesn't show how to properly link a custom Android Native Module
Apr 16, 2024
Thank you for filing this issue!
This comment acknowledges we believe this may be a bug and there’s enough information to investigate it.
However, we can’t promise any sort of timeline for resolution. We prioritize issues based on severity, breadth of impact, and alignment with our roadmap. If you’d like to help move it more quickly, you can continue to investigate it more deeply and/or you can open a pull request that fixes the cause.
Summary
I upgraded my bare React Native project from Expo SDK 49 to 50 following the great new upgrade helper from Expo. This made to process of upgrading much simpler, but there was one slight problem. The
MainApplication.kt
file seems to have a brokengetPackages()
method. When I originally migrated the file from Java to Kotlin, I wrote it as described in the Expo Upgrade HelperUncommenting the
packages.add
call fails the build.I looked at the React Native guide for creating a Native Module and found this code block for the
getPackages()
method.I rewrote the code as suggested by that documentation and it builds and works as expected.
Please update the documentation accordingly.
Link to the related docs page
https://docs.expo.dev/bare/upgrade/?fromSdk=49&toSdk=50#androidappsrcmainjavacomhelloworldmainapplicationkt
Anything else?
No response
The text was updated successfully, but these errors were encountered: