Skip to content

Fix linking error error: undefined symbol: worklets::extractWorkletRuntime on Android #627

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ buildscript {
}
}

task prepareKotlinBuildScriptModel {
// This task is run during Gradle Sync in Android Studio.
}

def reactNativeArchitectures() {
def value = project.getProperties().get("reactNativeArchitectures")
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
Expand Down Expand Up @@ -193,3 +197,12 @@ if (isNewArchitectureEnabled()) {
codegenJavaPackageName = "com.expensify.livemarkdown"
}
}

// This fixes linking errors due to undefined symbols from libworklets.so.
// During Gradle Sync, Android Gradle Plugin runs Prefab and treats worklets
// like a header-only library. During build, config files are not regenerated
// because the cache key does not change and AGP thinks that they are up-to-date.
afterEvaluate {
prepareKotlinBuildScriptModel.dependsOn(":react-native-reanimated:prefabDebugPackage")
prepareKotlinBuildScriptModel.dependsOn(":react-native-reanimated:prefabReleasePackage")
}