2017-05-11 158 views
0

我得到這個錯誤,當我做build for android不知道該怎麼辦。我嘗試刪除平臺並再次添加它。但仍然有同樣的錯誤。我是否需要刪除我的android sdk並在我的mac中再次安裝它?錯誤,而`離子Cordova構建android`來自離子3

我的錯誤:

✖ Running command - failed! 

[ERROR] Cordova encountered an error. 
     You may get more insight by running the Cordova command above directly. 

[ERROR] An error occurred while running cordova build android (exit code 1): 

     ANDROID_HOME=/Users/apple/Library/Android/sdk 
     JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home 

     FAILURE: Build failed with an exception. 

     * What went wrong: 
     Failed to load native library 'libnative-platform.dylib' for Mac OS X x86_64. 

     * Try: 
     Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. 
     Error: /Applications/Android Studio.app/Contents/gradle/gradle-2.14.1/bin/gradle: Command failed with exit code 1 
+0

沒有你有什麼解決這個錯誤@hybrid開發 –

+0

@Mohan Gopi我嘗試過的東西:1.我創建了新項目並複製了www文件夾,然後我做了「sudo ionic cordova build android」。這次它的工作正常 –

+0

@MohanGopi如果你再次得到這個錯誤:'npm install -g ionic @ latest' '$ npm install --save-dev --save-exact @ ionic/cli-plugin-ionic1 @ latest @離子/ cli-plugin-cordova @ latest'然後做「suod離子cordova構建機器人'# –

回答

0

,我也面臨着同樣的問題..但它很好地工作我,當make命令

$ ionic cordova build android --stacktrace 
+1

什麼是代碼意味着:'離子cordova構建android --stacktrace'' stacktrace'是什麼來衡量我們構建 –