1. 程式人生 > >React Native打包時,報錯 java.lang.NullPointerException (no error message)

React Native打包時,報錯 java.lang.NullPointerException (no error message)

FAILURE: Build failed with an exception.

what went wrong?
java.lang.NullPointerException (no error message)

 

This Problem created when the suddenly System restarted, then gradle file corrupted. and that corrupted file cached, so we need to Delete this file from your project

這個問題是因為系統重啟時產生的,gradle檔案發生錯誤,並且這個錯誤的檔案會快取起來,所以我們需要從專案中刪掉這個檔案。

因為我開發時是兩個編輯軟體同時用,切換時導致軟體系統重啟,應該是此原因引起的。

網上說這個檔案位於專案的根目錄中,但是在我專案的根目錄中沒有找到,不過我在專案的android目錄下找到了這個檔案,然後刪除它後,重新打包,是可以打包成功的