ui icon indicating copy to clipboard operation
ui copied to clipboard

dependency error: react-native-linear-gradient

Open dviluk opened this issue 9 years ago • 15 comments

"react": "16.0.0-alpha.12", "react-native": "0.47.2",

Fix: https://github.com/react-native-community/react-native-linear-gradient/issues/202

dviluk avatar Aug 25 '17 06:08 dviluk

What exactly is the error? What's not working properly?

Definitely-Not-Vlad avatar Aug 25 '17 14:08 Definitely-Not-Vlad

node_modules/react-native-linear-gradient/android/src/main/java/com/BV/LinearGradient/LinearGradientPackage.java:20: error: method does not override or implement a method from a supertype
    @Override
    ^
1 error
:react-native-linear-gradient:compileReleaseJavaWithJavac FAILED

Android build fails.

princenaman avatar Aug 25 '17 18:08 princenaman

Setting the @shoutem/ui/package.json react-native-linear-gradient to ^2.0.0 instead of ~2.0.0 will resolve this. We're still working on full compatibility with React Native 0.47.2.

Alternatively you can also drop your React Native version down to one that's compatible with 2.0.x react-native-linear-gradient.

Definitely-Not-Vlad avatar Aug 28 '17 17:08 Definitely-Not-Vlad

Hi Vladimir,

I changed "react-native-linear-gradient": "^2.0.0", but still get the error. What else should I do after making this change?

And if I downgrade React Native, which version should I go to?

Thanks Gary

PrimeObjects avatar Sep 02 '17 22:09 PrimeObjects

Most likely you still need to do react-native link and/or react-native upgrade.

If choose you downgrade, the most stable version of the UI toolkit that we've tested most extensively is 0.43.4.

Definitely-Not-Vlad avatar Sep 02 '17 23:09 Definitely-Not-Vlad

Thank you for the quick response Vladimir, I had done react-native link, it did not help. By the way, I cloned your whole ui and when I tried to run RestaurantsApp restaurantsapp , it failed as well.

below is my package.json { "name": "app", "version": "0.0.1", "private": true, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "test": "jest" }, "dependencies": { "@shoutem/ui": "^0.21.3", "mobx": "^3.2.2", "mobx-react": "^4.2.2", "react": "16.0.0-alpha.12", "react-native": "0.48.0", "react-native-linear-gradient": "^2.3.0", "react-native-router-flux": "^4.0.0-beta.21" }, "devDependencies": { "babel-jest": "20.0.3", "babel-plugin-transform-class-properties": "^6.24.1", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-preset-react-native": "3.0.2", "jest": "20.0.4", "react-test-renderer": "16.0.0-alpha.12" }, "jest": { "preset": "react-native" } }

PrimeObjects avatar Sep 02 '17 23:09 PrimeObjects

+1

davebro avatar Sep 04 '17 21:09 davebro

Here's a workaround for react-native-linear-gradient if you want to use it with higher versions of React Native.

  1. Install @shoutem/ui - npm install @shoutem/ui --save
  2. Open MyApp/node_modules/@shoutem/ui/package.json
  3. Edit line 63 from: "react-native-linear-gradient": "~2.0.0" to: "react-native-linear-gradient": "^2.0.0"
  4. Remove the current installation of react-native-linear-gradient by deleting: MyApp/node_modules/react-native-linear-gradient directory.
  5. Run npm install from root project directory to install the new version of react-native-linear-gradient

Using these steps with React Native 0.48.1 resolved react-native-linear-gradient issues when building for Android.

We will look for a solution in the UI toolkit, we're working on making it out-of-the-box compatible with higher versions of React Native, for now the most stable version is 0.43.4, any higher than that and we can't guarantee out-of-the-box compliance.

Definitely-Not-Vlad avatar Sep 05 '17 08:09 Definitely-Not-Vlad

@Vladimir-Vdovic any hope for a better fix ?

el-lsan avatar Sep 11 '17 15:09 el-lsan

We will address this in a future version of the UI toolkit along with other improvements, fixes and features.

Definitely-Not-Vlad avatar Sep 11 '17 15:09 Definitely-Not-Vlad

Instead of making modifications to @shoutem package.json one can simply yarn add react-native-linear-gradient --save from the project folder.

musen avatar Oct 05 '17 11:10 musen

run react-native link and react-native upgrade inside you project then run react-native run-android/ios

Awadhesh31 avatar Nov 05 '17 17:11 Awadhesh31

@Awadhesh31 run react-native link and react-native upgrade inside you project then run react-native run-android/ios :+1: 1
it worked!!!!!!1

adnanali-indpro avatar Nov 09 '17 05:11 adnanali-indpro

But still have some issues with ShoutEm

adnanali-indpro avatar Nov 09 '17 06:11 adnanali-indpro

In my case (react native) was a problem with node_modules. I just remove it and made yarn install. Probably, they were installed with sudo so xcode hasn't permissions.

javurekv avatar Jul 03 '19 10:07 javurekv