我正在建立一个离子项目并遇到此错误
1秒内失败 错误:/ Users / lalitkushwah / Desktop / BuildForIOS / platforms / android / gradlew:命令失败,退出代码为1错误输出: 失败:构建失败,并出现异常。
其中: 构建文件'/Users/lalitkushwah/Desktop/BuildForIOS/platforms/android/app/build.gradle'行:262
出了什么问题: 评估项目':app'时发生问题。 对于类型为org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler的对象,无法获取未知属性“ ANDROID_SUPPORT_ANNOTATIONS_VERSION”。
这是package.json文件:
{
"name": "trade-king-front-end",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"start": "ionic-app-scripts serve",
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint"
},
"dependencies": {
"@angular/animations": "5.2.11",
"@angular/common": "5.2.11",
"@angular/compiler": "5.2.11",
"@angular/compiler-cli": "5.2.11",
"@angular/core": "5.2.11",
"@angular/forms": "5.2.11",
"@angular/http": "5.2.11",
"@angular/platform-browser": "5.2.11",
"@angular/platform-browser-dynamic": "5.2.11",
"@ionic-native/core": "~4.11.0",
"@ionic-native/file": "^4.14.0",
"@ionic-native/file-transfer": "^4.12.2",
"@ionic-native/header-color": "^4.12.0",
"@ionic-native/navigation-bar": "^4.12.0",
"@ionic-native/splash-screen": "~4.11.0",
"@ionic-native/status-bar": "^4.11.0",
"@ionic/storage": "^2.1.3",
"cordova-android": "^7.0.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-file": "^6.0.1",
"cordova-plugin-file-transfer": "^1.7.1",
"cordova-plugin-headercolor": "^1.0.0",
"cordova-plugin-ionic-keyboard": "^2.1.3",
"cordova-plugin-ionic-webview": "^2.3.1",
"cordova-plugin-navigationbar": "^1.0.31",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-sqlite-storage": "^2.6.0",
"ionic-angular": "3.9.2",
"ionicons": "3.0.0",
"json2csv": "^4.2.1",
"papaparse": "^4.6.0",
"rxjs": "5.5.11",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.26"
},
"devDependencies": {
"@ionic/app-scripts": "3.2.0",
"typescript": "~2.6.2"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-whitelist": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-sqlite-storage": {},
"cordova-plugin-navigationbar": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-headercolor": {},
"cordova-plugin-file": {},
"cordova-plugin-file-transfer": {}
},
"platforms": [
"android"
]
} }
如果有任何想法解决此问题,请先感谢。
答案 0 :(得分:0)
在Platform / android / project.properties的 project.properties 中更改行,
cordova.system.library.1 = com.android.support:support-annotations:$ ANDROID_SUPPORT_ANNOTATIONS_VERSION
到
cordova.system.library.1 = com.android.support:support-annotations:27。+