Skip to content

Load Android Gradle Plugin conditionally#24

Open
SaeedZhiany wants to merge 1 commit intowscodelabs:masterfrom
SaeedZhiany:patch-1
Open

Load Android Gradle Plugin conditionally#24
SaeedZhiany wants to merge 1 commit intowscodelabs:masterfrom
SaeedZhiany:patch-1

Conversation

@SaeedZhiany
Copy link

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 SaeedZhiany requested a review from aathapa February 5, 2020 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant