callstack / callstack/react-native-builder-bob

Android Nitro Module wrong package path created

オープン
#852 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る
bug
主要言語
JavaScript
スター
3.2k
フォーク
228
平均マージ
7日 12時間
マージ済み PR(30日)
3

説明

### Description

I just created a new library with Nitro modules, after running Nitrogen, I start Android project, and it's throwing:

```
/Users/james/Code/Personal/react-native/react-native-app-nitro/example/android/app/build/generated/autolinking/src/main/java/com/facebook/react/PackageList.java:14: error: cannot find symbol
import com.margelo.nitro.appnitro.AppNitroPackage;
^
symbol: class AppNitroPackage
location: package com.margelo.nitro.appnitro
/Users/james/Code/Personal/react-native/react-native-app-nitro/example/android/app/build/generated/autolinking/src/main/java/com/facebook/react/PackageList.java:62: error: cannot find symbol
new AppNitroPackage(),
```

I found that it tries to `import com.margelo.nitro.appnitro.AppNitroPackage;`, but the generated project, the AppNitroPackage is in wrong folder:

![Image](https://github.com/user-attachments/assets/0711c1ea-f9d2-4e91-9367-7b582a1789e7)

I manually move the file to the expected folder and able to run Android

### Packages

- [x] create-react-native-library
- [ ] react-native-builder-bob

### Selected options

Nitro Module

### Link to repro

NA

### Environment

Macbook M1

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start by tracing the Nitro Module generation entry point used by Nitrogen and compare the generated AppNitroPackage location with the import in the generated Android PackageList.java. Reproduce the Android build from the reported create-react-native-library setup if possible; done means the generated package path and import match so the project builds without manually moving the file.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, react-native
領域
build-system, mobile
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。