chrisfisher / react-native-directed-scrollview

UNMAINTAINED- see below. A natively implemented scrollview component which lets you specify different scroll directions for child content.
MIT License
149 stars 67 forks source link

Build error - Could not find method implementation() #45

Open Noitidart opened 6 years ago

Noitidart commented 6 years ago

Hi there, In latest package I am getting the error pasted below when doing react-native run-android.

I suspect it's because of using implementation in your android/build.gradle, which I think is gradle 3+ only. And default react-native ships with gradle 2.

dependencies {
    implementation 'com.facebook.react:react-native:+'
}
JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
Incremental java compilation is an incubating feature.

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\Mercurius\Documents\GitHub\trustedplatform_android\node_modules\react-native-directed-scrollview\android\build.gradle' line: 22

* What went wrong:
A problem occurred evaluating project ':react-native-directed-scrollview'.
> Could not find method implementation() for arguments [com.facebook.react:react-native:+] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Noitidart commented 6 years ago

I think it is this PR - https://github.com/chrisfisher/react-native-directed-scrollview/pull/35 - which breaks it for everyone except the PR submitter.

Noitidart commented 6 years ago

Yes I modified this line from "implementation" to "compile" and it fixed it.