更新时间:2022-03-28 21:48:11
我刚刚遇到了同样的问题.
I just experienced the same problem.
这可能是关于如何安装(或升级)Android Studio 和所有 SDK 工具的说明中的一个障碍,你和我都错过了,或者可能是由新版本的 Studio 创建的错误,它不遵循相同的文件约定为旧版本.我倾向于后者,因为许多 SO 帖子 在这个话题上似乎指向一个 ANDROID_PATH,其中有一个名为 android-sdk 的文件夹,它没有出现在最新的 (2.3.0.8) 版本中.
It may be an occlusion in the instructions regarding how to install (or upgrade) Android Studio with all the SDK Tools which both you and I missed or possibly a bug created by a new release of Studio which does not follow the same file conventions as the older versions. I lean towards the latter since many of the SO posts on this topic seems to point to an ANDROID_PATH with a folder called android-sdk which does not appear in the latest (2.3.0.8) version.
似乎有一种解决方法,我刚开始在我的机器上工作.这是我所做的:
There appears to be a workaround though, which I just got to work on my machine. Here's what I did:
从 Android 下载.
在桌面上提取的 zip
Extracted zip on desktop
用提取的替换 C:UsersusernameAppDataLocalAndroidsdk ools子文件夹工具/
Replaced C:UsersusernameAppDataLocalAndroidsdk ools with extracted sub-folder tools/
在项目文件夹中:
$cordova 平台移除 android
$cordova 平台添加 android
$ cordova platforms remove android
$ cordova platforms add android
您可能还需要强制删除 android 中的 node_modules.希望这会有所帮助.
You may also need to force remove the node_modules in android. Hopefully this helps.