react-native-create-library icon indicating copy to clipboard operation
react-native-create-library copied to clipboard

Update android.js

Open SaeedZhiany opened this issue 6 years ago • 1 comments

This wraps the Android Gradle plugin dependency in the buildscripts section of android/build.gradle in a conditional:

if (project == rootProject) {
    // ... (dependency here)
}

The Android Gradle plugin is only required when opening the project stand-alone, not when it is included as a dependency. By doing this, the project opens correctly in Android Studio, and it can also be consumed as a native module dependency from an application project without affecting the app project (avoiding unnecessary downloads/conflicts/etc).

for more info, you can refer to this thread and especially this comment.

SaeedZhiany avatar Feb 13 '19 06:02 SaeedZhiany

This change is now part of create-react-native-module, which also adds very basic view component support, as an option.

brody4hire avatar Feb 28 '19 21:02 brody4hire