Skip to content

Build failing: Fix for Buck and JAVA_HOME and emulator  #191

@jpotts18

Description

@jpotts18

This issue is being left as a travelogue for future people who may pass this way.

Here is the commit I needed to make to get it working again. Right now I don't have any intention to create a PR, but I'd be happy to or someone else can contribute them.

Bumped NodeJS to version 18

  • Update version to 18
  • I am a bit curious why node@18 is not set as the default yet in this repo since it is the current LTS 🤔

JAVA_HOME variable not correctly set, so I symlinked it using this command ✅

# Reset JAVA_HOME var
RUN ln -s $(dirname -- $(dirname -- $(readlink -f /usr/bin/java))) /usr/lib/jvm/default-java
ENV JAVA_HOME=/usr/lib/jvm/default-java

Emulator not found as by sdkmanager Warning: Failed to find package 'emulator'.

Fix: Made an image that completed just after the android install and interactively ran sdkmanager --list on a container. This is where I saw that and emulator was no longer available to sdkmanager.

Note: I personally don't need the emulator in my CI/CD pipeline yet so this might be future oversight but seems like since the emulator has been dropped from sdkmanager it should probably be installed differently now. Anyways that was now fixed for my use case ✅

Ran into issue with sdkmanager "ndk;21.4.7075529" not being found

This was the same problem but it looks like buck was introduced as a build tool. I think this should have probably been left as an optional configuration like some kind of ARG USE_BUCK=TRUE but maybe the maintainers disagree and I don't really know everything about react-native. I didn't need buck in my system so removed its installation and moved back to using the normal version of the NDK.

  • Don't install buck
  • Didn't need to do any symlinking to point clang to a different version
  • Cleaned up a lot of NDK_VERSION_BUCK and NDK_VERSION_GRADLE to just be back to NDK_VERSION

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions