Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Nitro module library crash on android example build

Offen
#896 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
42/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
android, javascript, react-native
Bereich
build-system, mobile

Rechercherichtung

Beginne mit dem generierten Repro und example/package.json und führe dann yarn example android aus, um den Fehler wegen doppelter DEX-Klassen zu reproduzieren. Vergleiche die Nitro- und Turbo-Modul-Builds und konzentriere dich dabei auf die Registrierung von react-native-safe-area-context. Als erledigt gilt die Aufgabe, wenn das von Nitro generierte Beispiel erfolgreich ohne doppelte Klassen gebaut wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

bug
Description

After generating new library using npx create-react-native-library@latest awesome-librar and selecting "Nitro module" option, installing packages with yarn, and running yarn example android, I encountered an error.
It looks like unused react-native-safe-area-context dependency from example app is getting registered multiple times.

Execution failed for task ':app:mergeLibDexDebug'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.DexMergingTaskDelegate
   > There was a failure while executing work items
      > A failure occurred while executing com.android.build.gradle.internal.tasks.DexMergingWorkAction
         > com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
           Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
           Type com.facebook.react.viewmanagers.RNCSafeAreaProviderManagerDelegate is defined multiple times: /Users/john/Desktop/awesome-library/android/build/.transforms/9286b72b4f9552335ae00fc4394f0219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/RNCSafeAreaProviderManagerDelegate.dex, /Users/john/Desktop/awesome-library/example/node_modules/react-native-safe-area-context/android/build/.transforms/def7637fb683de95fb0b5f690e7a6ad7/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/RNCSafeAreaProviderManagerDelegate.dex

I tried to find the duplicate, but the only place where it's declared is in example/package.json:

yarn why react-native-safe-area-context
└─ awesome-library-example@workspace:
└─ react-native-safe-area-context@npm:5.6.1 [fb98e] (via npm:^5.5.2 [fb98e])

Creating library with Turbo module does not result in the same error, even though react-native-safe-area-context is also present there.

Packages
  • create-react-native-library
  • react-native-builder-bob
Selected options
Image
Link to repro

https://github.com/jaworek/awesome-library

Environment

System:
OS: macOS 26.0
CPU: (11) arm64 Apple M3 Pro
Memory: 393.58 MB / 36.00 GB
Shell:
version: 5.3.3
path: /nix/store/j26b6rcrvvpvqqcq5gmzxxipjb8ycy09-bash-interactive-5.3p3/bin/bash
Binaries:
Node:
version: 20.19.4
path: /opt/homebrew/bin/node
Yarn:
version: 3.6.1
path: /nix/store/38vyy0sbiqaq3r5liws3yfhxlhgcwsyz-yarn-berry-3.8.7/bin/yarn
npm:
version: 10.8.2
path: /opt/homebrew/bin/npm
Watchman:
version: 2025.09.15.00
path: /etc/profiles/per-user/john/bin/watchman
Managers:
CocoaPods:
version: 1.16.2
path: /etc/profiles/per-user/john/bin/pod
SDKs:
iOS SDK: Not Found
Android SDK:
API Levels:
- "33"
- "35"
- "36"
Build Tools:
- 33.0.1
- 34.0.0
- 35.0.0
- 36.0.0
System Images:
- android-33 | Android TV ARM 64 v8a
- android-35 | Google Play ARM 64 v8a
- android-36 | Google Play ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2025.1 AI-251.26094.121.2513.14007798
Xcode:
version: /undefined
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.12
path: /etc/profiles/per-user/john/bin/javac
Ruby:
version: 2.6.10
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli":
installed: 20.0.0
wanted: 20.0.0
react:
installed: 19.1.0
wanted: 19.1.0
react-native:
installed: 0.81.1
wanted: 0.81.1
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: Not found
newArchEnabled: false

Vorherrschende Sprache
JavaScript
Sterne
3.2k
Forks
229
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus callstack/react-native-builder-bob

Alle Issues in callstack/react-native-builder-bob

Ähnliche Issues

Weitere Issues zu JavaScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.