ionic2 打包android包时报'C:\Users\Administrator\AppData\Local\Android\sdk' does not exist.

写在前面

为了能及时的将自己踩到的前端坑(包括ionic,angular,ReactNative,小程序,APICloud)分享给大家,以后会逐渐将文章转移到微信公众号:前端e家(front_e_family)。可直接扫码关注,公众号会不定期更新新文章,分享踩坑笔记!期待您的关注!
ionic2 打包android包时报'C:\Users\Administrator\AppData\Local\Android\sdk' does not exist._第1张图片


错误日志:

  • What went wrong:
    A problem occurred configuring root project ‘android’.

The SDK directory ‘C:\Users\Administrator\AppData\Local\Android\sdk’ does not exist.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project ‘android’.

The SDK directory ‘C:\Users\Administrator\AppData\Local\Android\sdk’ does not exist.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

解决方案:

ionic2 打包android包时报'C:\Users\Administrator\AppData\Local\Android\sdk' does not exist._第2张图片

找到如图中的local.prooerties文件,将下图的sdk换成你的本地SDK的位置即可。
注意:如果没有这个文件编译时会报另一种错误,大概就是说没有可用的SDK,这时要去找个local.prooerties文件拷贝到图中目录下(自己新建一个这样的文件也行),然后再将你本地的SDK地址添加进来,还要注意,路径中的使用的是反斜杠 \ ,我有次就掉进了这个坑里!!!

你可能感兴趣的:(ionic2)