Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Android: generated ReactNativeHostManager loads React Native twice and crashes (Feature flags cannot be overridden more than once)

Đang mở Phù hợp với người mới
#492 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 4 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
android, kotlin, react-native
Lĩnh vực
mobile

Hướng nghiên cứu

Bắt đầu với template được sinh ra ReactNativeHostManager.vanilla.kt trong thư mục template của expo-config-plugin, rồi so sánh với ReactNativeBrownfield.kt, nơi initialize gọi loadNativeLibs (SoLoader.init và DefaultNewArchitectureEntryPoint.load). Tái hiện lỗi bằng cách tạo một dự án và khởi chạy ứng dụng. Hoàn thành khi template không còn gọi loadReactNative(application) và ứng dụng khởi chạy mà không có lỗi feature flag.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

The ReactNativeHostManager that the scaffold generates for a React Native CLI project crashes on start:

Feature flags cannot be overridden more than once

It calls loadReactNative(application) and then ReactNativeBrownfield.initialize(...) (ReactNativeHostManager.vanilla.kt). initialize already runs loadNativeLibs, which calls SoLoader.init and DefaultNewArchitectureEntryPoint.load() (ReactNativeBrownfield.kt), so React Native's feature flags are set twice.

Repro: npm create @callstack/react-native-brownfield@latest, package the AAR, and start React Native from a native app with the generated ReactNativeHostManager.initialize.

Fix: remove the loadReactNative(application) call from the template; initialize loads the native libraries itself. Removing it in the generated file makes the app start.

Tested with: @callstack/create-react-native-brownfield 5.3.0, React Native 0.85.2.

Ngôn ngữ chính
TypeScript
Star
552
Fork
53
Merge trung bình
4 ngày 13 giờ
Pull request đã merge (30 ngày)
15

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của callstack/react-native-brownfield

Tất cả issue của callstack/react-native-brownfield

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.