Skip to content

Build error in example project: native_modules.gradle does not exist #100

@YOEL311

Description

@YOEL311

Description

In the example project (example/android/settings.gradle), the following line causes a build failure in React Native 0.79+:

apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)

Error

A problem occurred evaluating settings 'fastopencv.example'.
> Could not read script '../example/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' as it does not exist.

Context

  • In React Native 0.79+, this file is not present in new projects, and the build fails if this line is included.
  • Removing this line resolves the build error and matches the React Native 0.79+ default template.

Suggested Fix

Remove the above line from example/android/settings.gradle so the example project builds successfully with React Native 0.79 and newer.

Reference

For React Native 0.79+, see the official template settings.gradle:
https://raw.githubusercontent.com/react-native-community/rn-diff-purge/release/0.79.6/RnDiffApp/android/settings.gradle

This file does not include the problematic line (apply from: ...native_modules.gradle) and builds successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions