日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Weex Project (npm run android)-Error: Error: Command failed

發布時間:2023/12/31 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Weex Project (npm run android)-Error: Error: Command failed 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

問題描述:

weex項目在運行npm run android跑安卓端時出現以下錯誤,嘗試了網上的很多方法,包括Stack Overflow上的大神的建議依然沒有解決,問題如下:

Error: Error: Command failed: ./gradlew? assembleDebug

isLibProject: false, isAppProject: true

weex_plugin: []? FAILURE: Build failed with an exception.

* What went wrong: A problem occurred configuring project ':app'.

> You have not accepted the license agreements of the following SDK components:

? [Android SDK Platform 26, Android SDK Build-Tools 26].

? 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.

? Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html

問題背景:

①:操作系統Mac

②:已經安裝Android Studio并在Android Studio下載模擬器(詳情請百度)

③:已經配置jdk并設置路徑(詳情請百度)

④:已經運行yes | sudo ~/Library/Android/sdk/tools/bin/sdkmanager --licenses 同意licenses

解決方法:

網上找的答案都是因為缺少了以上的某一步,對本人沒什么作用,以下方法適用于以上配置都正確的前提下仍然報錯。

仔細看看: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的SDK管理器,點擊SDK Tools,點擊Show Package Details如圖,會發現報錯的Android SDK build-tools 26.0.0并沒有安裝,點擊安裝后apply ->ok,隨后重新npm run android即可:

結果:

成功后結果如右圖模擬器,左邊為npm run ios成功后的效果,至此,weex項目web、iOS、Android三端配置均已完成。

(web端的圖沒截,不用什么配置,關鍵在于配置iOS及安卓端)

Tips:npm run android 并沒有像npm run ios那樣會自動打開模擬器,而是會報找不到模擬器錯誤,打開Android Studio,啟動安卓模擬器,重新npm run andriod即可。

總結

以上是生活随笔為你收集整理的Weex Project (npm run android)-Error: Error: Command failed的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。