When adding cordova camera plugin into my project then i am facing cordova build problem as follows:
Step 1: Adding ionic cordova camera plugins
Step 2: try to build the native app using ionic cordova build android --debug
then the following error is displaying
Task :app:transformClassesWithMultidexlistForDebug FAILED D8: Program type already present: android.support.v4.app.ActionBarDrawerToggle$Delegate
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':app:transformClassesWithMultidexlistForDebug'. com.android.build.api.transform.TransformException: Error while generating the main dex list: Error while merging dex archives: Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes. Program type already present: android.support.v4.app.ActionBarDrawerToggle$Delegate [ERROR] An error occurred while running subprocess cordova.
cordova.cmd build android --debug exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
3条答案
按热度按时间ergxz8rk1#
这个问题可能是来自您的
AndroidManifest.xml
。打开您的AndroidManifest.xml
文件并找到android.support.v4.app.ActionBarDrawerToggle
,您会找到两行。注解其中一行并只保留一个android.support.v4.app.ActionBarDrawerToggle
。然后尝试再次运行。这份遗嘱可能对你有帮助。
6yjfywim2#
我更改cordova相机插件版本从4.3.0到4.1.0,现在它工作良好,这可能是离子v4插件的问题
q43xntqr3#
安装最新的cordova平台[
] 1