Skip to content
This repository has been archived by the owner on Sep 17, 2021. It is now read-only.

Running Example app fails - updated versions of react-native and react-native-svg needed #55

Closed
thynan opened this issue Jan 23, 2017 · 4 comments
Labels

Comments

@thynan
Copy link

thynan commented Jan 23, 2017

Hi!

I have tried to run the example as described in the readme. I tried it on 2 different computers. On the second one I did a completely fresh install of react-native / android-studio, just to be sure.

Both computers run on Ubuntu 16.10. When i am building with "react-native run-android" I always get the following errors:

`../react-native-pathjs-charts/example/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/SvgViewManager.java:14: error: package com.facebook.yoga does not exist
import com.facebook.yoga.YogaMeasureMode;
^
../react-native-pathjs-charts/example/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/SvgViewManager.java:15: error: package com.facebook.yoga does not exist
import com.facebook.yoga.YogaMeasureFunction;
^
../react-native-pathjs-charts/example/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/SvgViewManager.java:16: error: package com.facebook.yoga does not exist
import com.facebook.yoga.YogaNodeAPI;
^
../react-native-pathjs-charts/example/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/SvgViewManager.java:35: error: cannot find symbol
private static final YogaMeasureFunction MEASURE_FUNCTION = new YogaMeasureFunction() {
^
symbol: class YogaMeasureFunction
location: class SvgViewManager
../react-native-pathjs-charts/example/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/SvgViewManager.java:35: error: cannot find symbol
private static final YogaMeasureFunction MEASURE_FUNCTION = new YogaMeasureFunction() {
^
symbol: class YogaMeasureFunction
location: class SvgViewManager
5 errors
:react-native-svg:compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':react-native-svg:compileReleaseJavaWithJavac'.

Compilation failed; see the compiler error output for details.
`

Anyone else getting this error?

@marzolfb
Copy link
Contributor

Yes and the problem isn't unique to running on Ubuntu. The problem right now is we haven't constrained the version of the react-native-svg dependency for this library (in the root package.json) to what the current version of the library is expecting (4.4.1) and so when you do a fresh clone of the repo and do a npm install you are getting the latest version of react-native-svg (4.6.1). Unfortunately, this version of that library has it own dependency on a newer version of react-native (0.40.0) and that is problematic because this library is expecting an older version of react-native (0.38.0).

We need to get this library updated and working with newer versions of react-native and react-native-svg (hoping to get time to clean that up in the next day or two).

Until then, you should be able to do

npm install [email protected]

from the example directory.

After doing that and trying to do react-native run-android, you may see this error:

:app:dexDebug
Unknown source file : UNEXPECTED TOP-LEVEL EXCEPTION:
Unknown source file : com.android.dex.DexException: Multiple dex files define Landroid/support/v7/appcompat/R$anim;
Unknown source file : 	at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
...

If so, do this:

(cd android && ./gradlew clean)
react-native run-android

@marzolfb marzolfb added the bug label Jan 24, 2017
@marzolfb marzolfb changed the title Running Example fails on Ubuntu 16.10 Running Example fails Jan 24, 2017
@marzolfb marzolfb changed the title Running Example fails Running Example app fails Jan 24, 2017
@marzolfb marzolfb changed the title Running Example app fails Running Example app fails - updated versions of react-native and react-native-svg needed Jan 24, 2017
@thynan
Copy link
Author

thynan commented Jan 24, 2017

Thanks for the fast answer! Following you instructions, and the info from this commit:
96b0f7b

... I finally got a beautiful barchart in my react-native ignite app running. Thanks for the help, and for the great work with this library!

@marzolfb
Copy link
Contributor

See my comments on #58. To summarize, I tried going to newer versions of react-native-svg but saw some unexpected behavior changes. Decided it was best to fix package.json to pin to working versions of react-native and react-native-svg. Closing this as #58 addresses this.

@afilp
Copy link

afilp commented Jan 27, 2017

@marzolfb Thank you for your great work, I hope the rotation issue is fixed on the other module so that we can get the latest versions for all soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants