React native: Lỗi khi release APK. unknown error, open 'C:\Users\...\.babel.json

Bác nào đã gặp lỗi này khi release app react native chưa giúp em với. Em gặp lỗi từ sáng đến giờ mà k thể fix được. Đọc issue trên repo làm theo cũng không được. Trong khi build và chạy trên simulator thì vẫn chạy bình thường. Đây là lỗi ạ

Loading dependency graph, done.
warning: the transform cache was reset.
bundle: start
bundle: finish
bundle: Writing bundle output to: D:\Workplace\react-native\albums\android\app\build\intermediates\a
ssets\release\index.android.bundle
bundle: Done writing bundle output
fs.js:584
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: UNKNOWN: unknown error, open 'C:\Users\tranv\.babel.json'
    at Object.fs.openSync (fs.js:584:18)
    at Object.fs.writeFileSync (fs.js:1316:33)
    at process.save (D:\Workplace\react-native\albums\node_modules\babel-register\lib\cache.js:48:16
)
    at emitOne (events.js:96:13)
    at process.emit (events.js:191:7)
:app:bundleReleaseJsAndAssets FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command 'cmd'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more l
og output.

BUILD FAILED

C:\Users\tranv.babel.json
Day la duong dan tren may tinh ma ban, ban hardcode cai path ah?

À. cái path này react native nó tự gen ra đấy chứ. Loay hoay kiểu gì mà mình mặc kệ nó code tiếp. xong quay lại chạy ./gradlew assembleRelease thì nó lại được rồi @@ Chắc nó require phải chạy react-native start hoặc react-native run-android

Mod close topic hộ em nhé :slight_smile:

1 Like
1 Like
83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?