當weex項目使用到了第三發插件時,需要執行weex plugin add ***
添加插件,如果你遇到下面當報錯,跟著以下步驟執行或許可以解決你的問題
error: could not find gradle wrapper within android sdk. might need to update your android sdk
log中提示,Looked here:/Users/.../tools/templates/gradle/wrapper
CD過去提示cd: no such file or directory:...wrapper
依然是環境安裝的問題
解決
如果你的SDK是同Android Studio一起安裝的,那去找到安裝目錄下的
.../plugins/android/lib/templates
#我的是 /Applications/Android Studio.app/Contents/plugins/android/lib/templates
將該目錄(templates)復制到你的SDK目錄下的tools目錄下
.../Android/sdk/tools
#我的 ~/Library/Android/sdk/tools
或者直接實用命令
cp -r /Applications/Android Studio.app/Contents/plugins/android/lib/templates ~/Library/Android/sdk/tools
第二個問題 Error: spawn EACCES
重新執行weex plugin add ***
后如果你又遇到了這個問題
說明沒有權限,執行以下命令,添加下權限就可以了
chmod a+x ~/Library/Android/sdk/tools/templates/gradle/wrapper/gradlew