Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with reactnative build from source #10

Closed
fabOnReact opened this issue Feb 23, 2022 · 10 comments
Closed

Issues with reactnative build from source #10

fabOnReact opened this issue Feb 23, 2022 · 10 comments

Comments

@fabOnReact
Copy link
Owner

fabOnReact commented Feb 23, 2022

Build with no issue on fabOnReact/react-native@43c38cd

Commit fabOnReact/react-native@2162bce triggers error

output from ./gradlew :packages:rn-tester:android:app:installJscDebug

  [armeabi-v7a] Compile++ thumb: rntester_appmodules <= OnLoad.cpp
  [armeabi-v7a] Compile++ thumb: rntester_appmodules <= RNTesterTurboModuleManagerDelegate.cpp
  [armeabi-v7a] Compile++ thumb: rntester_appmodules <= RNTesterComponentsRegistry.cpp
  [armeabi-v7a] Compile++ thumb: rntester_appmodules <= RNTesterAppModuleProvider.cpp
  [armeabi-v7a] Compile++ thumb: rntester_appmodules <= rntester-generated.cpp
  [armeabi-v7a] Prebuilt       : libglog.so <= /home/fabrizio/.gradle/build/react-native-fork/app/react-ndk/exported/armeabi-v7a/
  [armeabi-v7a] Prebuilt       : libfolly_json.so <= /home/fabrizio/.gradle/build/react-native-fork/app/react-ndk/exported/armeabi-v7a/
  [armeabi-v7a] Prebuilt       : libfolly_futures.so <= /home/fabrizio/.gradle/build/react-native-fork/app/react-ndk/exported/armeabi-v7a/
  [armeabi-v7a] Prebuilt       : libyoga.so <= /home/fabrizio/.gradle/build/react-native-fork/app/react-ndk/exported/armeabi-v7a/
  [armeabi-v7a] Prebuilt       : libturbomodulejsijni.so <= /home/fabrizio/.gradle/build/react-native-fork/app/react-ndk/exported/armeabi-v7a/
  [armeabi-v7a] Prebuilt       : librrc_view.so <= /home/fabrizio/.gradle/build/react-native-fork/app/react-ndk/exported/armeabi-v7a/
  [armeabi-v7a] Prebuilt       : libreact_render_core.so <= /home/fabrizio/.gradle/build/react-native-fork/app/react-ndk/exported/armeabi-v7a/
  [armeabi-v7a] Prebuilt       : libreact_render_graphics.so <= /home/fabrizio/.gradle/build/react-native-fork/app/react-ndk/exported/armeabi-v7a/
  [armeabi-v7a] Prebuilt       : libreact_codegen_rncore.so <= /home/fabrizio/.gradle/build/react-native-fork/app/react-ndk/exported/armeabi-v7a/
  [armeabi-v7a] Prebuilt       : libfabricjni.so <= /home/fabrizio/.gradle/build/react-native-fork/app/react-ndk/exported/armeabi-v7a/
  [armeabi-v7a] Prebuilt       : libreact_render_componentregistry.so <= /home/fabrizio/.gradle/build/react-native-fork/app/react-ndk/exported/armeabi-v7a/
  [armeabi-v7a] Prebuilt       : libreact_debug.so <= /home/fabrizio/.gradle/build/react-native-fork/app/react-ndk/exported/armeabi-v7a/
  [armeabi-v7a] Prebuilt       : libreact_render_debug.so <= /home/fabrizio/.gradle/build/react-native-fork/app/react-ndk/exported/armeabi-v7a/
  [armeabi-v7a] Compile++ thumb: react_codegen_rntester <= rntester-generated.cpp
  
  In file included from /home/fabrizio/.gradle/build/react-native-fork/app/generated/source/codegen/jni/rntester-generated.cpp:11:
  In file included from /home/fabrizio/.gradle/build/react-native-fork/app/generated/source/codegen/jni/rntester.h:13:
  /home/fabrizio/Documents/sourcecode/opensource/react-native-fork/ReactAndroid/../ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.h:17:10: fatal error: 'fbjni/fbjni.h' file not found
  #include <fbjni/fbjni.h>
           ^~~~~~~~~~~~~~~
  1 error generated.
  make: *** [/home/fabrizio/Android/Sdk/ndk/21.4.7075529/build/core/build-binary.mk:478: /home/fabrizio/.gradle/build/react-native-fork/app/intermediates/ndkBuild/jscDebug/obj/local/armeabi-v7a/objs-debug/react_codegen_rntester//home/fabrizio/.gradle/build/react-native-fork/app/generated/source/codegen/jni/rntester-generated.o] Error 1

Java Version

Checking out the main branch triggers this commit.

Log

@fabOnReact

This comment was marked as off-topic.

@fabOnReact fabOnReact pinned this issue Feb 23, 2022
@fabOnReact

This comment was marked as off-topic.

@fabOnReact
Copy link
Owner Author

solved with facebook/react-native#33167

@fabOnReact
Copy link
Owner Author

fabOnReact commented Feb 24, 2022

facebook/react-native#33160 and fabOnReact/react-native@8bc324f.
Latest commit I used for building from source fabOnReact/react-native@16feabf

@fabOnReact
Copy link
Owner Author

I think kotlin needs to be added to template https://github.com/fabriziobertoglio1987/react-native/blob/3b9a034ce9a7ac0b6f52ed80b282c3e8fc67ca35/template/android/build.gradle#L19

buildscript {
    ext {
        buildToolsVersion = "31.0.0"
        kotlin_version="1.6.10"
        minSdkVersion = 21
        compileSdkVersion = 31
        targetSdkVersion = 31
        ndkVersion = "21.4.7075529"
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:7.0.4")
        classpath("com.facebook.react:react")
        classpath("de.undercouch:gradle-download-task:4.1.2")
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'de.undercouch:gradle-download-task:4.0.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

@fabOnReact
Copy link
Owner Author

fabOnReact commented Feb 25, 2022

FAILURE: Build failed with an exception.

* Where:
Build file '/home/fabrizio/Documents/sourcecode/reactnative/AwesomeProject/node_modules/react-native/ReactAndroid/build.gradle' line: 424

* What went wrong:
A problem occurred configuring project ':ReactAndroid'.
> Task with name 'configureNdkBuildDebug[armeabi-v7a]' not found in project ':ReactAndroid'.

fabOnReact/react-native@d6ed1ff fabOnReact/react-native@0f39a10

@fabOnReact fabOnReact changed the title ReactCommon/../ViewShadowNode.o in function shared_lock undefined reference to folly::SharedMuexImpl Issues with reactnative build from source Feb 25, 2022
@fabOnReact
Copy link
Owner Author

I solved this issue with the following steps:

git clone https://github.com/facebook/react-native.git
cd react-native
./gradlew :packages:rn-tester:android:app:installJscDebug
./scripts/packager.sh

current head is facebook/react-native@8d50bf1

@fabOnReact fabOnReact unpinned this issue Feb 25, 2022
@fabOnReact
Copy link
Owner Author

fabOnReact commented Feb 25, 2022

./gradlew :packages:rn-tester:android:app:installHermesDebug

output

02-25 15:17:17.721  8987  9036 D SoLoader: Not resolving dependencies for libreactnativejni.so
02-25 15:17:17.865  1112  2566 I FontLog : Received query Noto Color Emoji Compat, URI content://com.google.android.gms.fonts [CONTEXT service_id=132 ]
02-25 15:17:17.866  1112  2566 I FontLog : Query [emojicompat-emoji-font] resolved to {Noto Color Emoji Compat, wdth 100.0, wght 400, ital 0.0, bestEffort false} [CONTEXT service_id=132 ]
02-25 15:17:17.870  1112  2566 I FontLog : Fetch {Noto Color Emoji Compat, wdth 100.0, wght 400, ital 0.0, bestEffort false} end status Status{statusCode=SUCCESS, resolution=null} [CONTEXT service_id=132 ]
02-25 15:17:17.877  1112  2566 I FontLog : Pulling font file for id = 15, cache size = 5 [CONTEXT service_id=132 ]
02-25 15:17:18.756  8987  9037 F libc    : Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xbeaea5f1 in tid 9037 (mqt_js), pid 8987 (ook.react.uiapp)
02-25 15:17:17.885  1112  2566 I FontLog : Pulling font file for id = 15, cache size = 5 [CONTEXT service_id=132 ]
02-25 15:17:18.827  9044  9044 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone
02-25 15:17:18.828   282   282 I tombstoned: received crash request for pid 9037
02-25 15:17:18.829  9044  9044 I crash_dump32: performing dump of process 8987 (target tid = 9037)
02-25 15:17:18.839  9044  9044 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-25 15:17:18.839  9044  9044 F DEBUG   : Build fingerprint: 'google/sdk_gphone_x86/generic_x86_arm:11/RSR1.201013.001/6903271:user/release-keys'
02-25 15:17:18.839  9044  9044 F DEBUG   : Revision: '0'
02-25 15:17:18.839  9044  9044 F DEBUG   : ABI: 'x86'
02-25 15:17:18.839  9044  9044 F DEBUG   : Timestamp: 2022-02-25 15:17:18+0800
02-25 15:17:18.839  9044  9044 F DEBUG   : pid: 8987, tid: 9037, name: mqt_js  >>> com.facebook.react.uiapp <<<
02-25 15:17:18.840  9044  9044 F DEBUG   : uid: 10160
02-25 15:17:18.840  9044  9044 F DEBUG   : signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xbeaea5f1
02-25 15:17:18.840  9044  9044 F DEBUG   :     eax bceebc28  ebx c02fbb58  ecx bceebbf8  edx 7e71d805
02-25 15:17:18.840  9044  9044 F DEBUG   :     edi beaea5ed  esi c0644ad0
02-25 15:17:18.840  9044  9044 F DEBUG   :     ebp bceebbc8  esp bceebac0  eip bff95803
02-25 15:17:18.910  9044  9044 F DEBUG   : backtrace:
02-25 15:17:18.911  9044  9044 F DEBUG   :       #00 pc 00015803  /data/app/~~DM6xPNG74PPC_T-jvqw3bQ==/com.facebook.react.uiapp-oUJwsFrG3TspB2ilclqZIQ==/lib/x86/libhermes.so (BuildId: 0e224ae89f8fe1939609942a687e26eb015a376b)
02-25 15:17:18.911  9044  9044 F DEBUG   :       #01 pc 00335bf2  /data/app/~~DM6xPNG74PPC_T-jvqw3bQ==/com.facebook.react.uiapp-oUJwsFrG3TspB2ilclqZIQ==/lib/x86/libhermes-executor-debug.so (

related facebook/react-native#33065

@cortinico
Copy link
Contributor

02-25 15:17:18.840 9044 9044 F DEBUG : signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xbeaea5f1

Just a heads up that we're aware of a ABI incompatibility between the current main of RN and Hermes 0.11.0. We're working on it. That sounds like the cause of this crash.

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

No branches or pull requests

2 participants