Skip to content

[Android] Duplicate java spec files created with new architecture enabled #12

@Balthazar33

Description

@Balthazar33

Hi,
Thanks for maintaining revopush and ensuring its compatibility with the new RN versions.

On enabling the new architecture, the android build fails to generate due to duplicate native spec files getting created.

I have a custom native module in my android/app/src/newarch/java/com folder named ShortcutsModule.kt, with the corresponding specifications file in src/specs/NativeShortcutsModule.ts at the root of my project.

On trying to build the app with:

cd android && gradlew generateCodegenArtifactsFromSchema && gradlew clean && cd .. && npx react-native run-android

the NativeShortcutsModuleSpec.java file is created in the android/app/build/generated/source/codegen/java/com/appname folder of my project as well as the android folder of @revopush/react-native-code-push, which causes the build to fail.


Here's my react-native-config.js file:

module.exports = {
  project: {
    ios: {},
    android: {},
  },
  assets: ['./src/assets/fonts/'],
};

Also, I've added this line at the end of my android/app/build.gradle file:

apply from: "../../node_modules/@revopush/react-native-code-push/android/codepush.gradle"

Setup details:

React Native: 0.79.2
@revopush/react-native-code-push: 1.2.0
New architecture: enabled
buildToolsVersion = "35.0.0"
minSdkVersion = 24
compileSdkVersion = 35
targetSdkVersion = 35
ndkVersion = "27.1.12297006"
kotlinVersion = "2.1.20"

Can we prevent the native spec files from being generated under revopush?

Thanks.

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