Litho: Error building Litho with React Native: Bad service configuration file, or exception thrown while constructing Processor object:...

Created on 9 May 2018  路  20Comments  路  Source: facebook/litho

Version

compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.facebook.react:react-native:+"  // From node_modules

// Litho
compile 'com.facebook.litho:litho-core:0.14.0'
compile 'com.facebook.litho:litho-widget:0.14.0'
provided 'com.facebook.litho:litho-annotations:0.14.0'

annotationProcessor 'com.facebook.litho:litho-processor:0.14.0'

// SoLoader
compile 'com.facebook.soloader:soloader:0.2.0'

// For integration with Fresco
compile 'com.facebook.litho:litho-fresco:0.14.0'

// For testing
testCompile 'com.facebook.litho:litho-testing:0.14.0'

// Sections
compile 'com.facebook.litho:litho-sections-core:0.14.0'
compile 'com.facebook.litho:litho-sections-widget:0.14.0'
provided 'com.facebook.litho:litho-sections-annotations:0.14.0'

annotationProcessor 'com.facebook.litho:litho-sections-processor:0.14.0'

Issues and Steps to Reproduce

Attempting to integrate Litho with React Native. I have followed "Getting Started" and FAQs Using Litho with React Native. Gradle is syncing successfully, but when I build the project it comes back with this error:

error: Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: Provider com.facebook.litho.specmodels.processor.ComponentsProcessor could not be instantiated: java.lang.NoClassDefFoundError: com/facebook/litho/annotations/FromPrepare

FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:compileDebugJavaWithJavac'.
    > Compilation failed; see the compiler error output for details.

Expected Behavior

Project can build without errors. Project is extremely bare bones, haven't added any additional code to my MainActivity or MainApplication file, everything fresh from react-native init with a react-native run-android

Link to Code

My App build.gradle file

 apply plugin: "com.android.application"
 import com.android.build.OutputFile
 project.ext.react = [
     entryFile: "index.js"
 ]
 apply from: "../../node_modules/react-native/react.gradle"
 def enableSeparateBuildPerCPUArchitecture = false
 def enableProguardInReleaseBuilds = false
 android {
   compileSdkVersion 27
   buildToolsVersion "27.0.1"

  defaultConfig {
      applicationId "com.lithodiscovery"
      minSdkVersion 18
      targetSdkVersion 27
      versionCode 1
      versionName "1.0"
      ndk {
          abiFilters "armeabi-v7a", "x86"
      }
  }
  splits {
      abi {
          reset()
          enable enableSeparateBuildPerCPUArchitecture
          universalApk false  // If true, also generate a universal APK
          include "armeabi-v7a", "x86"
      }
  }
  buildTypes {
      release {
          minifyEnabled enableProguardInReleaseBuilds
          proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
      }
  }
  // applicationVariants are e.g. debug, release
  applicationVariants.all { variant ->
      variant.outputs.each { output ->
          // For each separate APK per architecture, set a unique version code as described here:
          // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
          def versionCodes = ["armeabi-v7a":1, "x86":2]
          def abi = output.getFilter(OutputFile.ABI)
          if (abi != null) {  // null for the universal-debug, universal-release variants
              output.versionCodeOverride =
                      versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
          }
      }
   }
}

configurations.all {
    exclude group: 'com.facebook.yoga', module: 'yoga'
    exclude group: 'com.facebook.litho', module: 'litho-annotations'
    resolutionStrategy {
        force 'com.google.code.findbugs:jsr305:1.3.9'
        force 'com.android.support:appcompat-v7:26.+'
        force 'com.android.support:support-compat:26.+'
        force 'com.android.support:support-core-ui:26.+'
        force 'com.android.support:support-annotations:26.+'
        force 'com.android.support:recyclerview-v7:26.+'
   }
}

  dependencies {
  compile fileTree(dir: "libs", include: ["*.jar"])
  compile "com.facebook.react:react-native:+"  // From node_modules

  // Litho
  compile 'com.facebook.litho:litho-core:0.14.0'
  compile 'com.facebook.litho:litho-widget:0.14.0'
  provided 'com.facebook.litho:litho-annotations:0.14.0'

  annotationProcessor 'com.facebook.litho:litho-processor:0.14.0'

  // SoLoader
  compile 'com.facebook.soloader:soloader:0.2.0'

  // For integration with Fresco
  compile 'com.facebook.litho:litho-fresco:0.14.0'

  // For testing
  testCompile 'com.facebook.litho:litho-testing:0.14.0'

  // Sections
  compile 'com.facebook.litho:litho-sections-core:0.14.0'
  compile 'com.facebook.litho:litho-sections-widget:0.14.0'
  provided 'com.facebook.litho:litho-sections-annotations:0.14.0'

  annotationProcessor 'com.facebook.litho:litho-sections-processor:0.14.0'
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

My Project build.gradle file

 buildscript {
     repositories {
         jcenter()
     }
     dependencies {
          classpath 'com.android.tools.build:gradle:2.3.1'

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

allprojects {
    repositories {
       mavenLocal()
       jcenter()
       maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
       }
       maven { url 'https://maven.google.com' }
    }
}

All 20 comments

@passy, any ideas? Does the gradle file look correct to you?

There was some code preventing that, which was removed in this commit https://github.com/facebook/litho/commit/23ed5ee03a21729b6942d731d809eb94caf747c0#diff-c197962302397baf3a4cc36463dce5ea Not sure if be fault or in purpose!

Although I guess ErrorProne can be turned back on, since Android Studio also provides a classic Gradle Console view by pressing the following button (below the green hammer):

screen shot 2018-05-03 at 16 42 17

@passy thoughts?

I've never tried combining the too, so I'm not sure if the React Native setup does some sort of magic that could cause issues here.

There's one bug in Gradle that still doesn't seem to be fixed, affecting annotation processing in forked builds. That can manifest in all sorts of ways, usually with files not being found. You can try disabling this with:

allprojects {
  tasks.withType(JavaCompile) { options.fork = false }
}

Can you try that?

If that still doesn't work, would it be possible to create a bare-bones repository so I can reproduce this locally? Thanks!

Thank you all for getting back to me, much appreciated!

Hi @passy, unfortunately adding that line did not fix the issue.

Heres a link to the bare bones repository I'm working with: Litho-Discovery

Just some additional information, I have tried on multiple versions of android studio (2.3.1 & 3.1.2) with their respective gradle versions and experienced the same error on both.

Thanks again for everyones help!

I'm not sure this is a right place to ask. I'm using both Litho and React Native in the project. Currently, I'm having an build issue

Program type already present: com.facebook.infer.annotation.PrivacySink
        at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:126)
        at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:111)
        at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:101)
        at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:36)
        at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
        ... 4 more
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
        at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:71)
        at com.android.tools.r8.utils.ExceptionUtils.withD8CompilationHandler(ExceptionUtils.java:41)
        at com.android.tools.r8.D8.run(D8.java:89)
        at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:109)
        ... 7 more
Caused by: com.android.tools.r8.utils.AbortException
        at com.android.tools.r8.utils.Reporter.failIfPendingErrors(Reporter.java:78)
        at com.android.tools.r8.utils.Reporter.fatalError(Reporter.java:59)
        at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:62)
        ... 10 more

@DropKode21 Thanks for the sample project. I can repro this on my machine, too. Still not quite sure what's going on, but I'll try out some things.

Oh wait, just stumbled upon this line:

screenshot from 2018-05-14 10-24-45

That would definitely explain why this happens. I guess this was to avoid a clash with infer annotations. Is that right?

Updated the dependencies here and this one seems to work:

https://github.com/DropKode21/Litho-Discovery/pull/1/files

Thanks @passy!!!! I merged in your PR and it was able to build without crashing. I apologize I cannot comment on the clash with infer-annotations, but seemed to do the trick.

Though I unfortunately hate to inform you that after I continued by adding the first two steps in the tutorial page, I have experienced another crash keeping the project from building. The Fatal Exception I experienced is
```05-14 11:48:12.023 11077-11077/com.lithodiscovery E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.lithodiscovery, PID: 11077
java.lang.NoSuchMethodError: No virtual method getOwner()Lcom/facebook/yoga/YogaNode; in class Lcom/facebook/yoga/YogaNode; or its super classes (declaration of 'com.facebook.yoga.YogaNode' appears in /data/app/com.lithodiscovery-2/split_lib_dependencies_apk.apk)
at com.facebook.litho.InternalNode.release(InternalNode.java:1569)
at com.facebook.litho.LayoutState.releaseNodeTree(LayoutState.java:1070)
at com.facebook.litho.LayoutState.releaseNodeTree(LayoutState.java:1063)
at com.facebook.litho.LayoutState.calculate(LayoutState.java:1270)
at com.facebook.litho.ComponentTree.calculateLayoutState(ComponentTree.java:1745)
at com.facebook.litho.ComponentTree.measure(ComponentTree.java:800)
at com.facebook.litho.LithoView.onMeasure(LithoView.java:279)
at android.view.View.measure(View.java:19857)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at android.view.View.measure(View.java:19857)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:758)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:640)
at android.view.View.measure(View.java:19857)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at com.android.internal.policy.DecorView.onMeasure(DecorView.java:689)
at android.view.View.measure(View.java:19857)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2275)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1366)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1619)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1254)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6337)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874)
at android.view.Choreographer.doCallbacks(Choreographer.java:686)
at android.view.Choreographer.doFrame(Choreographer.java:621)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

The full Logcat is as follows: 
```05-14 12:06:24.599 15040-15040/? I/art: Not late-enabling -Xcheck:jni (already on)
05-14 12:06:24.599 15040-15040/? W/art: Unexpected CPU variant for X86 using defaults: x86
05-14 12:06:24.837 15040-15040/com.lithodiscovery I/InstantRun: starting instant run server: is main process
05-14 12:06:24.842 15040-15040/com.lithodiscovery D/SoLoader: init start
05-14 12:06:24.847 15040-15040/com.lithodiscovery D/SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /system/lib flags = 2]
    Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /system/vendor/lib flags = 2]
    Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /data/app/com.lithodiscovery-2/lib/x86 flags = 0]
    Preparing SO source: com.facebook.soloader.ApkSoSource[root = /data/data/com.lithodiscovery/lib-main flags = 1]
05-14 12:06:24.849 15040-15040/com.lithodiscovery V/fb-UnpackingSoSource: locked dso store /data/user/0/com.lithodiscovery/lib-main
05-14 12:06:24.850 15040-15040/com.lithodiscovery I/fb-UnpackingSoSource: dso store is up-to-date: /data/user/0/com.lithodiscovery/lib-main
05-14 12:06:24.850 15040-15040/com.lithodiscovery V/fb-UnpackingSoSource: releasing dso store lock for /data/user/0/com.lithodiscovery/lib-main
05-14 12:06:24.850 15040-15040/com.lithodiscovery D/SoLoader: init finish: 4 SO sources prepared
05-14 12:06:24.872 15040-15040/com.lithodiscovery D/ReactNative: ReactInstanceManager.ctor()
05-14 12:06:24.898 15040-15040/com.lithodiscovery D/NetworkSecurityConfig: No Network Security Config specified, using platform default
05-14 12:06:24.921 15040-15040/com.lithodiscovery D/ReactNative: ReactInstanceManager.createReactContextInBackground()
    ReactInstanceManager.recreateReactContextInBackgroundInner()
    ReactInstanceManager.onJSBundleLoadedFromServer()
05-14 12:06:24.923 15040-15040/com.lithodiscovery D/ReactNative: ReactInstanceManager.recreateReactContextInBackground()
05-14 12:06:24.924 15040-15040/com.lithodiscovery D/ReactNative: ReactInstanceManager.runCreateReactContextOnNewThread()
05-14 12:06:24.937 15040-15059/com.lithodiscovery D/SoLoader: About to load: libreactnativejni.so
05-14 12:06:24.938 15040-15059/com.lithodiscovery D/SoLoader: libreactnativejni.so not found on /data/data/com.lithodiscovery/lib-main
    Result 0 for libreactnativejni.so in source com.facebook.soloader.ApkSoSource[root = /data/data/com.lithodiscovery/lib-main flags = 1]
    Extraction logs: null
05-14 12:06:24.987 15040-15060/com.lithodiscovery W/unknown:InspectorPackagerConnection: Couldn't connect to packager, will silently retry
05-14 12:06:24.997 15040-15059/com.lithodiscovery D/SoLoader: Loaded: libreactnativejni.so
05-14 12:06:24.999 15040-15059/com.lithodiscovery D/SoLoader: About to load: libfb.so
    libfb.so not found on /data/data/com.lithodiscovery/lib-main
    Result 0 for libfb.so in source com.facebook.soloader.ApkSoSource[root = /data/data/com.lithodiscovery/lib-main flags = 1]
    Extraction logs: null
05-14 12:06:25.005 15040-15059/com.lithodiscovery D/SoLoader: About to load: libfb.so
    libfb.so not found on /data/data/com.lithodiscovery/lib-main
    Result 0 for libfb.so in source com.facebook.soloader.ApkSoSource[root = /data/data/com.lithodiscovery/lib-main flags = 1]
    Extraction logs: null
05-14 12:06:25.005 15040-15059/com.lithodiscovery I/art: Thread[15,tid=15059,Native,Thread*=0x9c0d5800,peer=0x12d4ea60,"Thread-4"] recursive attempt to load library "/data/app/com.lithodiscovery-2/lib/x86/libfb.so"
05-14 12:06:25.005 15040-15059/com.lithodiscovery D/SoLoader: Loaded: libfb.so
    Loaded: libfb.so
05-14 12:06:25.013 15040-15059/com.lithodiscovery D/ReactNative: ReactInstanceManager.createReactContext()
05-14 12:06:25.055 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTGroupViewManager
05-14 12:06:25.057 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTGroupShadowNode
05-14 12:06:25.073 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTShapeViewManager
    Could not find generated setter for class com.facebook.react.views.art.ARTShapeShadowNode
05-14 12:06:25.081 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTTextViewManager
05-14 12:06:25.084 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTTextShadowNode
05-14 12:06:25.091 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.checkbox.ReactCheckBoxManager
05-14 12:06:25.096 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.uimanager.LayoutShadowNode
05-14 12:06:25.100 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDialogPickerManager
05-14 12:06:25.103 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.drawer.ReactDrawerLayoutManager
05-14 12:06:25.107 15040-15059/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/uimanager/ViewGroupManager; annotation class 5102
05-14 12:06:25.111 15040-15059/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/uimanager/ViewGroupManager; annotation class 5102
05-14 12:06:25.112 15040-15059/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/views/drawer/ReactDrawerLayoutManager; annotation class 5102
05-14 12:06:25.115 15040-15059/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/views/drawer/ReactDrawerLayoutManager; annotation class 5102
05-14 12:06:25.117 15040-15059/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/views/drawer/ReactDrawerLayoutManager; annotation class 5102
    Unable to resolve Lcom/facebook/react/views/drawer/ReactDrawerLayoutManager; annotation class 5102
05-14 12:06:25.118 15040-15059/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/views/drawer/ReactDrawerLayoutManager; annotation class 5102
05-14 12:06:25.119 15040-15059/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/views/drawer/ReactDrawerLayoutManager; annotation class 5102
05-14 12:06:25.119 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDropdownPickerManager
    Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollViewManager
05-14 12:06:25.121 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollContainerViewManager
    Could not find generated setter for class com.facebook.react.views.progressbar.ReactProgressBarViewManager
    Could not find generated setter for class com.facebook.react.views.progressbar.ProgressBarShadowNode
05-14 12:06:25.122 15040-15059/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/views/progressbar/ProgressBarShadowNode; annotation class 5102
    Unable to resolve Lcom/facebook/react/views/progressbar/ProgressBarShadowNode; annotation class 5102
05-14 12:06:25.122 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactScrollViewManager
05-14 12:06:25.122 15040-15059/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/views/scroll/ReactScrollViewManager; annotation class 5102
05-14 12:06:25.123 15040-15059/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/views/scroll/ReactScrollViewManager; annotation class 5102
    Unable to resolve Lcom/facebook/react/views/scroll/ReactScrollViewManager; annotation class 5102
    Unable to resolve Lcom/facebook/react/views/scroll/ReactScrollViewManager; annotation class 5102
05-14 12:06:25.123 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager
05-14 12:06:25.124 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager$ReactSliderShadowNode
    Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager
    Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager$ReactSwitchShadowNode
05-14 12:06:25.125 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.toolbar.ReactToolbarManager
05-14 12:06:25.125 15040-15059/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/views/toolbar/ReactToolbarManager; annotation class 5102
    Unable to resolve Lcom/facebook/react/views/toolbar/ReactToolbarManager; annotation class 5102
05-14 12:06:25.126 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.webview.ReactWebViewManager
05-14 12:06:25.126 15040-15059/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/views/webview/ReactWebViewManager; annotation class 5102
    Unable to resolve Lcom/facebook/react/views/webview/ReactWebViewManager; annotation class 5102
05-14 12:06:25.129 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.swiperefresh.SwipeRefreshLayoutManager
05-14 12:06:25.129 15040-15040/com.lithodiscovery W/unknown:ReactNative: Packager connection already open, nooping.
05-14 12:06:25.130 15040-15059/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/views/swiperefresh/SwipeRefreshLayoutManager; annotation class 5102
    Unable to resolve Lcom/facebook/react/views/swiperefresh/SwipeRefreshLayoutManager; annotation class 5102
05-14 12:06:25.131 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTSurfaceViewManager
    Could not find generated setter for class com.facebook.react.views.art.ARTSurfaceViewShadowNode
05-14 12:06:25.132 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageViewManager
    Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageShadowNode
05-14 12:06:25.133 15040-15059/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageShadowNode; annotation class 5102
    Unable to resolve Lcom/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageShadowNode; annotation class 5102
    Unable to resolve Lcom/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageShadowNode; annotation class 5102
    Unable to resolve Lcom/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageShadowNode; annotation class 5102
05-14 12:06:25.134 15040-15059/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageShadowNode; annotation class 5102
05-14 12:06:25.135 15040-15059/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageShadowNode; annotation class 5102
05-14 12:06:25.136 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.image.ReactImageManager
05-14 12:06:25.136 15040-15059/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/views/image/ReactImageManager; annotation class 5102
    Unable to resolve Lcom/facebook/react/views/image/ReactImageManager; annotation class 5102
05-14 12:06:25.137 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ReactModalHostManager
05-14 12:06:25.138 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ModalHostShadowNode
    Could not find generated setter for class com.facebook.react.views.text.ReactRawTextManager
    Could not find generated setter for class com.facebook.react.views.text.ReactRawTextShadowNode
05-14 12:06:25.138 15040-15059/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/views/text/ReactRawTextShadowNode; annotation class 5102
05-14 12:06:25.139 15040-15059/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/views/text/ReactRawTextShadowNode; annotation class 5102
05-14 12:06:25.139 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputManager
05-14 12:06:25.140 15040-15059/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/views/textinput/ReactTextInputManager; annotation class 5102
    Unable to resolve Lcom/facebook/react/views/textinput/ReactTextInputManager; annotation class 5102
05-14 12:06:25.141 15040-15059/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/views/textinput/ReactTextInputManager; annotation class 5102
05-14 12:06:25.142 15040-15059/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/views/textinput/ReactTextInputManager; annotation class 5102
    Unable to resolve Lcom/facebook/react/views/textinput/ReactTextInputManager; annotation class 5102
05-14 12:06:25.143 15040-15059/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/views/textinput/ReactTextInputManager; annotation class 5102
    Unable to resolve Lcom/facebook/react/views/textinput/ReactTextInputManager; annotation class 5102
    Unable to resolve Lcom/facebook/react/views/textinput/ReactTextInputManager; annotation class 5102
05-14 12:06:25.148 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputShadowNode
05-14 12:06:25.150 15040-15059/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/views/textinput/ReactTextInputShadowNode; annotation class 5102
    Unable to resolve Lcom/facebook/react/views/textinput/ReactTextInputShadowNode; annotation class 5102
05-14 12:06:25.151 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextViewManager
05-14 12:06:25.152 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextShadowNode
    Could not find generated setter for class com.facebook.react.views.view.ReactViewManager
05-14 12:06:25.156 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.viewpager.ReactViewPagerManager
05-14 12:06:25.157 15040-15059/com.lithodiscovery W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextViewManager
    Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextShadowNode
05-14 12:06:25.172 15040-15040/com.lithodiscovery D/SoLoader: About to load: libyoga.so
    libyoga.so not found on /data/data/com.lithodiscovery/lib-main
05-14 12:06:25.173 15040-15040/com.lithodiscovery D/SoLoader: Result 0 for libyoga.so in source com.facebook.soloader.ApkSoSource[root = /data/data/com.lithodiscovery/lib-main flags = 1]
    Extraction logs: null
05-14 12:06:25.177 15040-15040/com.lithodiscovery D/SoLoader: Loaded: libyoga.so
05-14 12:06:25.201 15040-15040/com.lithodiscovery D/AndroidRuntime: Shutting down VM
05-14 12:06:25.201 15040-15040/com.lithodiscovery E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.lithodiscovery, PID: 15040
    java.lang.NoSuchMethodError: No virtual method getOwner()Lcom/facebook/yoga/YogaNode; in class Lcom/facebook/yoga/YogaNode; or its super classes (declaration of 'com.facebook.yoga.YogaNode' appears in /data/app/com.lithodiscovery-2/split_lib_dependencies_apk.apk)
        at com.facebook.litho.InternalNode.release(InternalNode.java:1569)
        at com.facebook.litho.LayoutState.releaseNodeTree(LayoutState.java:1070)
        at com.facebook.litho.LayoutState.releaseNodeTree(LayoutState.java:1063)
        at com.facebook.litho.LayoutState.calculate(LayoutState.java:1270)
        at com.facebook.litho.ComponentTree.calculateLayoutState(ComponentTree.java:1745)
        at com.facebook.litho.ComponentTree.measure(ComponentTree.java:800)
        at com.facebook.litho.LithoView.onMeasure(LithoView.java:279)
        at android.view.View.measure(View.java:19857)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at android.view.View.measure(View.java:19857)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
        at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
        at android.widget.LinearLayout.measureVertical(LinearLayout.java:758)
        at android.widget.LinearLayout.onMeasure(LinearLayout.java:640)
        at android.view.View.measure(View.java:19857)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at com.android.internal.policy.DecorView.onMeasure(DecorView.java:689)
        at android.view.View.measure(View.java:19857)
        at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2275)
        at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1366)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1619)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1254)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6337)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874)
        at android.view.Choreographer.doCallbacks(Choreographer.java:686)
        at android.view.Choreographer.doFrame(Choreographer.java:621)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860)
        at android.os.Handler.handleCallback(Handler.java:751)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:154)
        at android.app.ActivityThread.main(ActivityThread.java:6119)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
05-14 12:06:25.214 15040-15059/com.lithodiscovery D/ReactNative: Initializing React Xplat Bridge.
05-14 12:06:25.218 15040-15059/com.lithodiscovery D/ReactNative: Initializing React Xplat Bridge before initializeBridge
05-14 12:06:25.224 15040-15059/com.lithodiscovery D/ReactNative: Initializing React Xplat Bridge after initializeBridge
    CatalystInstanceImpl.runJSBundle()
05-14 12:06:25.225 15040-15071/com.lithodiscovery D/ReactNative: ReactInstanceManager.setupReactContext()
    CatalystInstanceImpl.initialize()
05-14 12:06:25.229 15040-15071/com.lithodiscovery D/ReactNative: ReactInstanceManager.attachRootViewToInstance()
05-14 12:06:25.325 15040-15070/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/modules/systeminfo/AndroidInfoModule; annotation class 5102
05-14 12:06:25.350 15040-15070/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/modules/debug/SourceCodeModule; annotation class 5102
05-14 12:06:25.354 15040-15070/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/modules/network/NetworkingModule; annotation class 5102
05-14 12:06:25.355 15040-15070/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/modules/network/NetworkingModule; annotation class 5102
05-14 12:06:25.362 15040-15071/com.lithodiscovery W/System: ClassLoader referenced unknown path: /system/app/Chrome/lib/x86
05-14 12:06:25.370 15040-15071/com.lithodiscovery D/ApplicationLoaders: ignored Vulkan layer search path /system/app/Chrome/lib/x86:/system/app/Chrome/Chrome.apk!/lib/x86:/system/lib:/vendor/lib for namespace 0xabaae090
05-14 12:06:25.373 15040-15071/com.lithodiscovery I/WebViewFactory: Loading com.android.chrome version 55.0.2883.91 (code 288309112)
05-14 12:06:25.401 15040-15070/com.lithodiscovery W/art: Unable to resolve Lcom/facebook/react/modules/deviceinfo/DeviceInfoModule; annotation class 5102
05-14 12:06:25.422 15040-15071/com.lithodiscovery I/cr_LibraryLoader: Time to load native libraries: 4 ms (timestamps 290-294)
05-14 12:06:25.423 15040-15071/com.lithodiscovery I/cr_LibraryLoader: Expected native library version number "55.0.2883.91", actual native library version number "55.0.2883.91"
05-14 12:06:25.473 15040-15070/com.lithodiscovery I/ReactNativeJS: Running application "LithoDiscovery" with appParams: {"rootTag":1}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF

I pushed up those additional changes including the first two steps from the Litho tutorial page to the repo. Thank you again so much for taking the time to look into these issues, it is very much appreciated. Please let me know if there's anything I can do to help or provided more information.

@DropKode21 That's definitely a version mismatch. Litho is depending on a newer version of Yoga than what's currently bundled in. Can you try switching to a Yoga snapshot release?

Hi @passy, thanks for getting back to me. I apologize again but I'm not completely sure how to make the switch or even know which version is currently bundled in, could you provide me with a few steps I could follow to investigate this further. Being a React Native project, yoga has been abstracted away and not sure where the interaction begins for those two. Also in the configurations.all I'm excluding exclude group: 'com.facebook.yoga', module: 'yoga', which is the only visibility of it I'm aware of. I did on the other hand try to increase all the Litho dependencies to 15, which resulted in a series of Failed to resolve: com.facebook.litho:litho-core:0.15.0 etc. I also tried with the 0.15.1-SNAPSHOT versioning as well, but ultimately did not work and produced the same yoga error as well as a few others. I'm sure like you mentioned that it is a yoga specific issue, but just wanted to share my findings with using the newer Litho versions. Thanks again @passy for your time on this issue. 馃檹

Hey @DropKode21! You're ahead of your time. :) 0.15.0 hasn't even been released yet. It's possible that ReactNative bundles a version of Yoga directly without a way for you to opt out of that ... that could indeed prove difficult to combine with Litho. We had one unfortunate backwards-incompatible change in Yoga recently which won't let the two releases work alongside. Until then you can either use an older version of Litho or repackage RN to include a newer version of Yoga, but it's likely that it's going to break then in turn.

Apologies that this is rather annoying right now. :(

@passy awesome! sounds good so essentially the idea is to just keep rolling back my Litho dependencies until I get a successful build yea? So try implementation 'com.facebook.litho:litho-core:0.13.0' or then 12, etc. I'll report back when I found the successful version, thank you again.

And to your point with the Litho 0.15.0 I had noticed that 0.15.0 is now on the "Getting Started" section of Litho Docs so wasn't sure if thats what you had meant by going to a new yoga snapshot release.

screen shot 2018-05-17 at 4 14 58 pm

screen shot 2018-05-17 at 4 16 10 pm

Sorry for the confusion. As part of our release process, the docs and what's available publicly may sometimes be out of sync. That gap was now closed. :)

All good, thanks again @passy for all your help. Got it up and going with 13. Now for the fun part of bridging it to react native. Wish me luck.

Also if anyone has any leads they don't mind sharing on the subject, any advice is appreciated. Thank you in advance.

@DropKode21 Would you be okay with us closing the issue for now? If there are any other problems you encounter while bridging Litho and RN you could definitely open up a new one, of course. :)

Yes all good!, Thanks again @passy

I know this is a closed issue but while going through the comments I found @dbof10 comment and I'm facing the same issue. @dbof10 how did you fix it?

Adding

exclude group: 'com.facebook.infer.annotation', module: 'infer-annotation'

should fix your issue @KarimFikani

@DropKode21, have you managed to display a list of items, like in the tutorial? Using the code in your repo, all I get is blank screen with no errors on my Nexus 5X. Showing just ListItemSpec works otherwise.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Martin-Hogge picture Martin-Hogge  路  4Comments

mmm111mmm picture mmm111mmm  路  6Comments

Drewbi picture Drewbi  路  3Comments

passy picture passy  路  3Comments

MichaelRocks picture MichaelRocks  路  7Comments