我有一个Ionic v1项目,在构建ios时遇到问题。几乎所有的cordova插件都没有添加到文件夹插件下左栏的Xcode项目中。 Cordova版本:6.2.0 Xcode版本:8.3.3
我做了:
cordova platforms rm ios
cordova platforms add ios
cordova build ios
它编译得很好但插件文件没有添加到我的Xcode项目中(当我运行应用程序时,我有很多XXXPlugin类CDVXXXX(pluginName:XXX)不存在)。
<plugin name="cordova-plugin-geolocation" spec="~2.4.3" />
)<feature name="Geolocation"><param name="ios-package" value="CDVLocation" /></feature>
)我可以手动添加它们,但这需要时间,每次我删除并重新添加平台时,我都必须再次执行此操作。
我不知道该怎么办,对我做错了什么想法?为什么XCode会在第一个之后停止导入插件文件(那么BranchSDK似乎是按字母顺序排列的第一个)?
我的package.json:
{
"name": "myapp",
"version": "1.1.1",
"description": "myapp: An Ionic project",
"dependencies": {
"grunt-contrib-compress": "^1.3.0",
"grunt-contrib-uglify": "^2.0.0",
"gulp": "^3.5.6",
"gulp-concat": "^2.2.0",
"gulp-minify-css": "^0.3.0",
"gulp-rename": "^1.2.0",
"gulp-sass": "^2.0.4",
"ionic-native-transitions": "^1.0.2",
"moment": "^2.14.1",
"ng2-translate": "^2.2.2",
"plist": "^2.0.1"
},
"devDependencies": {
"angular-translate": "^2.15.2",
"bower": "^1.3.3",
"coffee-script": "^1.10.0",
"grunt-contrib-compress": "^1.3.0",
"grunt-contrib-uglify": "^2.0.0",
"gulp-angular-templatecache": "^2.0.0",
"gulp-ng-annotate": "^2.0.0",
"gulp-useref": "^3.1.2",
"gulp-util": "^2.2.14",
"mv": "^2.1.1",
"shelljs": "^0.3.0"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-console",
"cordova-plugin-device",
"cordova-plugin-splashscreen",
"ionic-plugin-keyboard",
"cordova-plugin-network-information",
"cordova-plugin-geolocation",
"cordova-plugin-badge"
],
"cordovaPlatforms": [
"android",
{
"platform": "ios",
"version": "4.1.1",
"locator": "ios@4.1.1"
}
]
}
由于
答案 0 :(得分:0)
删除plugins文件夹,node_module文件夹和platform / ios文件夹。然后在项目根目录中运行“npm install。添加ios平台
”