React-native-slider: Yoga not found when run

Created on 4 Jul 2019  路  1Comment  路  Source: callstack/react-native-slider

Environment

  React Native Environment Info:
    System:
      OS: macOS 10.14.5
      CPU: (8) x64 Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz
      Memory: 567.39 MB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 8.4.0 - ~/.nvm/versions/node/v8.4.0/bin/node
      npm: 6.3.0 - ~/.nvm/versions/node/v8.4.0/bin/npm
      Watchman: 4.7.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
      Android SDK:
        API Levels: 19, 23, 25, 26, 27, 28
        Build Tools: 23.0.1, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.1, 27.0.3, 28.0.3
        System Images: android-19 | Intel x86 Atom, android-22 | Google APIs Intel x86 Atom, android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom_64, android-26 | Google APIs Intel x86 Atom, android-26 | Google Play Intel x86 Atom, android-27 | Google APIs Intel x86 Atom
    IDEs:
      Android Studio: 3.3 AI-182.5107.16.33.5264788
      Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.6.3 => 16.6.3
      react-native: ^0.59.3 => 0.59.3
    npmGlobalPackages:
      create-react-native-app: 2.0.2
      react-native-cli: 2.0.1
      react-native-git-upgrade: 0.2.7

Description

I've installed react-native-slider and on iOS works without problem, in Android I've got this error:

```> Task :@react-native-community_slider:compileDebugJavaWithJavac FAILED
/Users/Mattia/Documents/Projects/Line/RideMe/Mobile/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSliderManager.java:19: error: cannot find symbol
import com.facebook.react.uimanager.ReactShadowNodeImpl;
^
symbol: class ReactShadowNodeImpl
location: package com.facebook.react.uimanager
/Users/Mattia/Documents/Projects/Line/RideMe/Mobile/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSliderManager.java:26: error: package com.facebook.yoga does not exist
import com.facebook.yoga.YogaMeasureFunction;
^
/Users/Mattia/Documents/Projects/Line/RideMe/Mobile/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSliderManager.java:27: error: package com.facebook.yoga does not exist
import com.facebook.yoga.YogaMeasureMode;
^
/Users/Mattia/Documents/Projects/Line/RideMe/Mobile/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSliderManager.java:28: error: package com.facebook.yoga does not exist
import com.facebook.yoga.YogaMeasureOutput;
^
/Users/Mattia/Documents/Projects/Line/RideMe/Mobile/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSliderManager.java:29: error: package com.facebook.yoga does not exist
import com.facebook.yoga.YogaNode;
^
/Users/Mattia/Documents/Projects/Line/RideMe/Mobile/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSliderManager.java:44: error: cannot find symbol
YogaMeasureFunction {
^
symbol: class YogaMeasureFunction
location: class ReactSliderManager
/Users/Mattia/Documents/Projects/Line/RideMe/Mobile/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSliderManager.java:60: error: cannot find symbol
YogaNode node,
^
symbol: class YogaNode
location: class ReactSliderShadowNode
/Users/Mattia/Documents/Projects/Line/RideMe/Mobile/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSliderManager.java:62: error: cannot find symbol
YogaMeasureMode widthMode,
^
symbol: class YogaMeasureMode
location: class ReactSliderShadowNode
/Users/Mattia/Documents/Projects/Line/RideMe/Mobile/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSliderManager.java:64: error: cannot find symbol
YogaMeasureMode heightMode) {
^
symbol: class YogaMeasureMode
location: class ReactSliderShadowNode
/Users/Mattia/Documents/Projects/Line/RideMe/Mobile/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSliderManager.java:55: error: incompatible types: ReactSliderShadowNode cannot be converted to MeasureFunction
setMeasureFunction(this);
^
/Users/Mattia/Documents/Projects/Line/RideMe/Mobile/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSliderManager.java:58: error: method does not override or implement a method from a supertype
@Override
^
/Users/Mattia/Documents/Projects/Line/RideMe/Mobile/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSliderManager.java:76: error: cannot find symbol
return YogaMeasureOutput.make(mWidth, mHeight);
^
symbol: variable YogaMeasureOutput
location: class ReactSliderShadowNode
/Users/Mattia/Documents/Projects/Line/RideMe/Mobile/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSliderEvent.java:26: error: no suitable constructor found for Event(int)
super(viewId);
^
constructor Event.Event() is not applicable
(actual and formal argument lists differ in length)
constructor Event.Event(int,long) is not applicable
(actual and formal argument lists differ in length)
/Users/Mattia/Documents/Projects/Line/RideMe/Mobile/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSlidingCompleteEvent.java:25: error: no suitable constructor found for Event(int)
super(viewId);
^
constructor Event.Event() is not applicable
(actual and formal argument lists differ in length)
constructor Event.Event(int,long) is not applicable
(actual and formal argument lists differ in length)
/Users/Mattia/Documents/Projects/Line/RideMe/Mobile/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSlidingStartEvent.java:25: error: no suitable constructor found for Event(int)
super(viewId);
^
constructor Event.Event() is not applicable
(actual and formal argument lists differ in length)
constructor Event.Event(int,long) is not applicable
(actual and formal argument lists differ in length)
Note: /Users/Mattia/Documents/Projects/Line/RideMe/Mobile/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSliderManager.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
15 errors

FAILURE: Build failed with an exception.

## Reproducible Demo

This is my gradle

buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 23
compileSdkVersion = 27
targetSdkVersion = 8
supportLibVersion = "27.0.1"
googlePlayServicesVersion = "16.+"
playServicesVersion = "17.+"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects {
repositories {
mavenLocal()
google()
jcenter()
}
}

wrapper {
gradleVersion = '4.4'
distributionUrl = distributionUrl.replace("bin", "all")
}
```

bug report

>All comments

I guess you need to list RN in repositories (from node_modules)

allprojects {
    repositories {
       ...
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
    }
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

a-koka picture a-koka  路  3Comments

Vednus picture Vednus  路  9Comments

ralph-dev picture ralph-dev  路  10Comments

javadi69 picture javadi69  路  4Comments

vinithreddy3 picture vinithreddy3  路  5Comments