【发布时间】:2016-05-31 06:16:56
【问题描述】:
我在 ubuntu 中工作 ionic(1.7.15)。
在我尝试实现 calendar 插件之前,我的项目运行良好。将此插件安装到我的项目后,我尝试使用ionic build android 命令进行构建,但出现以下错误。
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
我希望由于我的项目中的多个插件而出现上述错误有什么解决办法。我发现这个错误与here中的multidex有关。
我尝试过的:
我已经尝试升级我的 android SDK。
使用这个堆栈溢出问题Could not resolve all dependencies for configuration ':_armv7DebugCompile' 我已经完成了所有操作,之后我得到了上述错误。
这是我的 package.json 文件
{
"name": "app",
"version": "1.1.1",
"description": "app: An Ionic project",
"dependencies": {
"gulp": "^3.5.6",
"gulp-sass": "^2.0.4",
"gulp-concat": "^2.2.0",
"gulp-minify-css": "^0.3.0",
"gulp-rename": "^1.2.0"
},
"devDependencies": {
"bower": "^1.3.3",
"gulp-util": "^2.2.14",
"shelljs": "^0.3.0"
},
"cordovaPlugins": [
"cordova-plugin-device",
"cordova-plugin-console",
"cordova-plugin-whitelist",
"cordova-plugin-splashscreen",
"cordova-plugin-statusbar",
"ionic-plugin-keyboard",
{
"locator": "https://github.com/rossmartin/PushPlugin.git",
"id": "com.phonegap.plugins.PushPlugin"
}
],
"cordovaPlatforms": [
"android"
]
}
这是我的 fetch.json 文件
{
"cordova-plugin-device": {
"source": {
"type": "registry",
"id": "cordova-plugin-device@~1.1.1"
},
"is_top_level": true,
"variables": {}
},
"cordova-plugin-console": {
"source": {
"type": "registry",
"id": "cordova-plugin-console@~1.0.2"
},
"is_top_level": true,
"variables": {}
},
"cordova-plugin-whitelist": {
"source": {
"type": "registry",
"id": "cordova-plugin-whitelist"
},
"is_top_level": true,
"variables": {}
},
"cordova-plugin-splashscreen": {
"source": {
"type": "registry",
"id": "cordova-plugin-splashscreen"
},
"is_top_level": true,
"variables": {}
},
"cordova-plugin-statusbar": {
"source": {
"type": "registry",
"id": "cordova-plugin-statusbar@~2.1.0"
},
"is_top_level": true,
"variables": {}
},
"ionic-plugin-keyboard": {
"source": {
"type": "registry",
"id": "ionic-plugin-keyboard"
},
"is_top_level": true,
"variables": {}
},
"cordova-plugin-camera": {
"source": {
"type": "registry",
"id": "cordova-plugin-camera"
},
"is_top_level": true,
"variables": {}
},
"phonegap-plugin-push": {
"source": {
"type": "registry",
"id": "phonegap-plugin-push"
},
"is_top_level": true,
"variables": {}
},
"com.phonegap.plugins.PushPlugin": {
"source": {
"type": "git",
"url": "https://github.com/phonegap-build/PushPlugin.git",
"subdir": "."
},
"is_top_level": true,
"variables": {}
},
"cordova-plugin-datepicker": {
"source": {
"type": "git",
"url": "https://github.com/VitaliiBlagodir/cordova-plugin-datepicker.git",
"subdir": "."
},
"is_top_level": true,
"variables": {}
},
"cordova-plugin-calendar": {
"source": {
"type": "registry",
"id": "cordova-plugin-calendar"
},
"is_top_level": true,
"variables": {}
},
"cordova-plugin-crosswalk-webview": {
"source": {
"type": "registry",
"id": "cordova-plugin-crosswalk-webview"
},
"is_top_level": true,
"variables": {}
}
}
我不知道出了什么问题,请任何人帮助我。
【问题讨论】:
-
我认为@EmptyCup 是正确的:您可能有一个插件,包括作为JAR 的Android 支持库,然后是这个日历插件includes it as a Gradle dependency。如果您发布您正在使用的所有插件的列表,或者发布您的
config.xml,这将有所帮助 -
@DaveAlden 我已经用 config.xml 更新了我的问题
-
抱歉,忘记使用 Ionic:如果您使用的是
ionic plugin add,请发帖package.json或发帖plugins/fetch.json -
@DaveAlden 检查我更新的问题
标签: angularjs ionic-framework ngcordova android-multiple-users