-
Notifications
You must be signed in to change notification settings - Fork 40
feat(android): correctly load and present RNViews for the respective arch #232
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
Conversation
|
@hurali97 is attempting to deploy a commit to the Callstack team on Vercel, but is not a member of this team. To resolve this issue, you can:
To read more about collaboration on Vercel, click here. |
|
Do not review. I have to conduct testing. |
| res.srcDirs("$appBuildDir/generated/res/createBundleReleaseJsAndAssets") | ||
| java.srcDirs("$moduleBuildDir/$autolinkingJavaSources") | ||
| } | ||
| getByName("release") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some projects use different names for release-type build variants, e.g. „validation”. Would we need to adjust this in such case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change has been moved to callstack/react-native-brownfield#105.
To understand this, we have two areas:
- Android App
- brownfield Aar
The brownfield Aar is basically a wrapper for RN views and APIs. This should not have more than the default buildTypes. If for some team it would make sense, then we will have to make our approach dynamic to account for all of the buildTypes. However, I do not see a purpose of doing it as of yet. For eg, react-android is a variant-aware Aar which has the default build types debug and release.
The Android App module which is basically a native App, it can have more than the default buildTypes. Like, it can have release | debug | validation. In this case, gradle looks for the specific buildType while resolving a dependency. For eg, if user is building the android app using debug build type, gradle will look for debug build type in the dependencies, if there is only one artifact in the dependency, gradle uses it to resolve for debug. BUT if the dependency is variant aware and then gradle looks for debug artifact specifically if it can not find it, gradle will throw an error.
Ideally, in all of the variant aware Aars there are 2 types handled, release and debug. For eg, react-android as explained above.
If an app has a custom buildType say validation, then gradle will fail if it can not find validation build type in dependency. In that case, a fallback should be used in the Android app's build.gradle, since it is a custom setup of the native android app and has nothing to do with the consumed dependency.
f25b722 to
c5e0a0c
Compare
|
We have removed the changes related to It made more sense to encapsulate those changes in the We still have |
|
The PR here needs to be merged first and released to mavenCentral. Then we can update this PR with the latest version of |
It's merged, so let's add the finishing touches and add a changeset (run |
I have re-tested with the latest |
Summary
This refactors the current implementation in
RNViewFactoryandRNHostManagerto allow:Test plan
pnpm package:aarto generate a Aarpnpm:publish-local:aarreanimatedas a dependency, configure it and try to add a Reanimated simple animation. Then run the following commands to generate and publish Aar.cd android && ./gradlew clean && cd .. && pnpm package:aar && pnpm publish-local:aarBelow is the code we have used for presenting a simple Reanimated animation:
The corresponding output from the native App:
Screen.Recording.2025-04-03.at.9.31.23.PM.mov