您输入的命令:ionic cordova build androird 是错误的。
我想您的意思是:ionic cordova build android
另外,您也可以尝试使用:ionic cordova build --release android
我曾经遇到过相同的错误,在经过两天的调试后,我找到了解决方案:
在目录 platforms/android/cordova 中的文件 Api.js 中,我更新了 locations 对象,因为路径不正确。
目前我的 Api.js 文件中的 locations 对象如下所示:
this.locations = {
root: self.root,
www: path.join(self.root, 'assets/www'),
res: path.join(self.root, 'res'),
platformWww: path.join(self.root, 'platform_www'),
configXml: path.join(self.root, 'app/src/main/res/xml/config.xml'),
defaultConfigXml: path.join(self.root, 'cordova/defaults.xml'),
strings: path.join(self.root, 'app/src/main/res/values/strings.xml'),
manifest: path.join(self.root, 'app/src/main/AndroidManifest.xml'),
build: path.join(self.root, 'build'),
javaSrc: path.join(self.root, 'app/src/main/java/'),
// NOTE: Due to platformApi spec we need to return relative paths here
cordovaJs: 'bin/templates/project/assets/www/cordova.js',
cordovaJsSrc: 'cordova-js-src'
};
在进行这些更改后,我能够构建我的应用程序。
我还遇到了像cordova-sqlite-storage这样的插件错误,所以我将其删除并构建了应用程序。
希望这可以帮助您