場景:如題,打包編譯時報錯
控制檯的日誌:
Error: Compile failed. The log file path [ C:\Users\Administrator\.CocosCreator\logs\native.log ]
at ChildProcess.handleChildProcess (C:\CocosCreator\resources\app.asar\editor\core\native-utils.js:1:20297)
at ChildProcess.e.on (C:\CocosCreator\resources\app.asar\editor\core\native-utils.js:1:7685)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:194:7)
at maybeClose (internal/child_process.js:899:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
錯誤類似於(C:\Users\Administrator\.CocosCreator\logs\native.log):
A problem occurred configuring project ':app'.
> You have not accepted the license agreements of the following SDK components:
[Android SDK Build-Tools 26.0.2].
Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
解決:安裝 android studio 2.3.3 安裝,安裝完成後下載安裝各種平臺工具,類似如下:
備註:如果在安裝android studio時已經配置了環境變量:
我的做法是,把原來的文件改下名,然後安裝android studio時重新指定回指個目錄
安裝完相關的平臺和工具後再打包就OK正常。