Skip to content

Native<PackageName>Spec doesn't exist on AndroidΒ #315

@CJxD

Description

@CJxD

Description

After building a fresh project, the Kotlin native module file tries to extend NativeSpec but it hasn't yet been built.

class TestModule(val reactContext: ReactApplicationContext?) : NativeTestSpec(reactContext) {
                                                               ^^^^^^^^^^^^^^

I expected to see something in android/generated/source/codegen but the directory doesn't exist.

I see that builder-bob has not been set up to build an .aar - is this necessary to make it work?

I tried to reconfigure with .aar files enabled. I had to upgrade the Android Gradle plugin to 7.3.0 to work with the version of Gradle in use (7.4) and change the androidBundleName option from android.aar to android-release.aar. After this, it still refuses the build with the same error - nothing seems to be generating this class even if I comment out the code to make npx bob build run all the way through.

The test example I've given should reproduce, but I have also copied in the repository in which I am struggling to get set up which is a fairly simple API.

Packages

  • create-react-native-library
  • react-native-builder-bob

Selected options

npx create-react-native-library@latest test \
    --slug "react-native-test" \
    --description "Test" \
    --author-name "Test" \
    --author-email "[email protected]" \
    --author-url "https://test.com" \
    --repo-url "https://github.com/test" \
    --languages kotlin-swift \
    --type module-turbo \
    --example native

Link to repro

https://gitlab.com/numbereight/community/react-native-ne-euclid

Environment

create-react-native-library v0.25.0

System:
    OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-1280P
    Memory: 11.40 GB / 31.07 GB
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 19.0.0 - ~/.nvm/versions/node/v19.0.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v19.0.0/bin/yarn
    npm: 8.19.2 - ~/.nvm/versions/node/v19.0.0/bin/npm
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found (lies)
  IDEs:
    Android Studio: Not Found (also lies)
  Languages:
    Java: 11.0.16 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.1.0 => 18.1.0 
    react-native: 0.70.3 => 0.70.3 
  npmGlobalPackages:
    *react-native*: Not Found

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions