React-native-device-info: Implementation issue in v0.24.3

Created on 24 Oct 2018  路  4Comments  路  Source: react-native-device-info/react-native-device-info

Summary

| ----------- | --- |
| Version | 0.24.3 |
| Affected OS | android |
| OS Version | mac v10 |

Current behavior

Building android project quickly fails with:
Error:(29, 1) A problem occurred evaluating project ':react-native-device-info'.

Could not find method implementation() for arguments [com.facebook.react:react-native:+] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Expected behavior

I expected the android project to build.

I saw some of the PRs that went into making sure RN .57 would work with this library, and I thought I upgraded to the right version (0.24.3). Is there anything else I need to do to make it work?

Thanks!

All 4 comments

Which version of the Android Gradle plugin are you using? implementation (instead of compile) is only available in v3.0.0 and later.

You were right, thank you!

my Gradle version is 2.14 锛宎s @sonicdoe said: implementation (instead of compile) is only available in v3.0.0 and later.
so i can not ues this solution .

my solution:

  1. go to file /node_modules/react-native-device-info/android/build.gradle
  2. Replace implementation with compile

before:

2018-11-07 5 53 19
after:

2018-11-07 5 53 32

  1. react-native run-android

it work for me !!!

Or stick to 0.24.2 :)

Was this page helpful?
0 / 5 - 0 ratings