Skip to content

Commit

Permalink
Fix OSS Android build (#24764)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #24764

The `test_android` CI build was failing:

```
./scripts/circleci/buck_fetch.sh
+ buck fetch ReactAndroid/src/test/java/com/facebook/react/modules
Not using buckd because watchman isn't installed.
Picked up _JAVA_OPTIONS: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap
PARSING BUCK FILES: FINISHED IN 1.1s
No build file at ReactAndroid/src/main/libraries/fbjni/BUCK when resolving target //ReactAndroid/src/main/libraries/fbjni:java.

This error happened while trying to get dependency '//ReactAndroid/src/main/libraries/fbjni:java' of target '//ReactAndroid/src/main/java/com/facebook/react/turbomodule/core:jscallinvokerholder'
Exited with code 1
```

The problem was that I was using `react_native_dep("libraries/fbjni:java")` to access JNI classes like `HybridData`. In open source this target translates to the path `//ReactAndroid/src/main/libraries/fbjni`, which doesn't exist. Instead, the actual classes are available at the path `//ReactAndroid/src/main/java/com/facebook/jni`. Therefore, I changed the target to `react_native_dep("java/com/facebook/jni:jni")`. This is exactly how the bridge (i.e: `//ReactAndroid/src/main/java/com/facebook/react/bridge:bridge`) accesses JNI clases.

Reviewed By: hramos

Differential Revision: D15261218

fbshipit-source-id: 659a5627389bbca3603db7de347618cd400d4ffc
  • Loading branch information
RSNara authored and facebook-github-bot committed May 8, 2019
1 parent 0ee5f68 commit f2618fd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ rn_android_library(
deps = [
react_native_dep("libraries/soloader/java/com/facebook/soloader:soloader"),
react_native_target("java/com/facebook/react/turbomodule/core/interfaces:interfaces"),
react_native_dep("libraries/fbjni:java"),
react_native_dep("java/com/facebook/jni:jni"),
],
)

1 comment on commit f2618fd

@dulmandakh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you

Please sign in to comment.