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

The resource main.tsx was not found RN 0.70.15-> 0.71.19 - android #299

Open
mgphall opened this issue Nov 12, 2024 · 0 comments
Open

The resource main.tsx was not found RN 0.70.15-> 0.71.19 - android #299

mgphall opened this issue Nov 12, 2024 · 0 comments

Comments

@mgphall
Copy link

mgphall commented Nov 12, 2024

Things I’ve done to figure out my issue
[ X ] I used upgrade-helper to do my upgrade.
Upgrading version
0.70.15

0.70.15 to 0.71.19

We are in the process of upgrading our application/monorepo , which started at version 0.68 and is currently moving from RN 0.70.15 to 0.71.19. We are completing one upgrade per sprint and have been using the react-native-community.github.io/upgrade-helper successfully for this process.

During this upgrade, we encountered the error mentioned above.

./gradlew build
The error:
error The resource C:\projects\core-platform-frontend\src\main.tsx was not found.
Error: The resource C:\projects\core-platform-frontend\src\main.tsx was not found.
at C:\projects\core-platform-frontend\node_modules@react-native-community\cli-plugin-metro\node_modules\metro\src\IncrementalBundler.js:275:24
at gotStat (node:fs:2806:21)
at FSReqCallback.oncomplete (node:fs:202:21)

./gradlew assembleRelease --info

Task :app:createBundleDevReleaseJsAndAssets FAILED
Caching disabled for task ':app:createBundleDevReleaseJsAndAssets' because:
Build cache is disabled
Task ':app:createBundleDevReleaseJsAndAssets' is not up-to-date because:
No history is available.
Starting process 'command 'cmd''. Working directory: C:\projects\core-platform-frontend\apps\colleague-portal-native Command: cmd /c node node_modules\react-native\cli.js bundle --platform android --dev false --reset-cache --entry-file src\main.tsx --bundle-output android\app\build\ASSETS\createBundleDevReleaseJsAndAssets\index.android.bundle --assets-dest android\app\build\generated\res\react\devRelease --sourcemap-output android\app\build\intermediates\sourcemaps\react\devRelease\index.android.bundle.packager.map --minify false --verbose
Successfully started process 'command 'cmd''

The only change i can see it with regards to entry file is in the build gradle file

project.ext.react = [
entryFile: "apps/colleague-portal-native/src/main.tsx",
enableHermes: true, // clean and rebuild if changing
hermesCommand: "../../../../node_modules/react-native/sdks/hermesc/%OS-BIN%/hermesc"
]

to ->

react {
entryFile = file("/../../src/main.tsx")
println("entryFile: ${entryFile.get().asFile.absolutePath}") , <- the correct file path
hermesCommand = "../../../../node_modules/react-native/sdks/hermesc/%OS-BIN%/hermesc"
}

but I suspect its passing this section

info Fetching system and libraries information...
System:
OS: Windows 11 10.0.22631
CPU: (20) x64 12th Gen Intel(R) Core(TM) i9-12900HK
Memory: 5.32 GB / 31.68 GB
Binaries:
Node: 18.20.3 - ~\AppData\Local\nvs\default\node.EXE
Yarn: Not Found
npm: 10.8.3 - ~\AppData\Roaming\npm\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
AllowAllTrustedApps: Enabled
Versions: 10.0.17763.0, 10.0.19041.0
IDEs:
Android Studio: AI-232.10300.40.2321.11567975
Visual Studio: 15.9.35324.217 (Visual Studio Enterprise 2017), 17.11.34929.205 (Visual Studio Enterprise 2022), 17.11.35327.3 (Visual Studio Enterprise 2022)
Languages:
Java: 17.0.2
npmPackages:
@react-native-community/cli: ^10.2.7 => 10.2.7
react: 18.2.0 => 18.2.0
react-native: 0.71.19 => 0.71.19

@mgphall mgphall changed the title The resource main.tsx was not found RN 0.70.15-> 0.71.19 The resource main.tsx was not found RN 0.70.15-> 0.71.19 - android Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant