1
當我試圖生成我的apk它給了我這個錯誤 我嘗試了許多解決方案和did'nt制定錯誤而產生APK反應母語
我運行命令後:
./gradlew assembleRelease
的錯誤是:
Loading dependency graph, done.
warning: the transform cache was reset.
bundle: start
bundle: finish
bundle: Writing bundle output to: appfolder\android\app\build\intermediates\assets\release\index.andro
id.bundle
Don't know which android drawable suffix to use for asset: {"__packager_asset":true,"fileSystemLocation":"appfolder\\src\\public\\images\\icons","httpServerLocation":"/assets/src/public/images/icons","width":12,"height":10,"scales":
[1,2,3,4,5],"files":["appfolder\\src\\public\\images\\icons\\[email protected]","appfolder\\src\\public\\images\\icons\\[email protected]","appfolder\\src\\public\\images
\\icons\\[email protected]","appfolder\\src\\public\\images\\icons\\[email protected]","appfolder\\src\\public\\images\\icons\\[email protected]"],"hash":"aa736287bfea056b34205edd2839d8cc","name":"twitter","
type":"png"}
: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 log output.
根據[RN](https://facebook.github.io/react-native/docs/images.html),您不能使用@ 4x或@ 5x,這就是它不支持的標籤的原因不映射到Android大小。我假設你正試圖「需要」,這是構建時出現問題的地方。刪除'@ 3x'之上的那些,你應該沒問題。另外,請閱讀[this](https://developer.android.com/guide/practices/screens_support.html),如果您需要提供Android特定尺寸,這應該有所幫助。 – G0dsquad
@ G0dsquad非常感謝你 我做什麼ü告訴我 我設定的資產 @ 1X @ 1.5倍 @ 2倍 @ 3倍 @ 4X 併成功建立 我把APK我的手機,我安裝它後,我試圖打開它 它崩潰了 '不幸的是,應用程序已停止' – Mifayo
和之後,我刪除了文件@ 1.5和@ 4,仍然是相同的問題 和調試安裝工作正常:( – Mifayo