如何解决已经存在的程序类型:ionic 4中的com.google.zxing.BarcodeFormat

dipgirl

我正在使用ionic4。当我的项目有facebook插件和BarcodeScanner插件并键入ionic cordova运行android时,它将出现此错误:

Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
D8: Program type already present: com.google.zxing.BarcodeFormat

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
  Program type already present: com.google.zxing.BarcodeFormat
  Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

我使用以下命令下载了两个插件:

ionic cordova plugin add phonegap-plugin-barcodescanner
npm install @ionic-native/barcode-scanner

ionic cordova plugin add cordova-plugin-facebook4 --variable APP_ID="app_id" --variable APP_NAME="app_name"
npm install --save @ionic-native/facebook
唐尼

经过数周的搜索,以下步骤可帮助我轻松解决问题:

1.删​​除Android平台

2.安装cordova-plugin-facebook4

3.在/ plugins / cordova-plugin-facebook4 /中创建build.gradle

4.复制

dependencies { compile("com.facebook.android:facebook-android-sdk:4.37.0") { exclude group: 'com.google.zxing' } }

到../plugins/cordova-plugin-facebook4/build.gradle

5.编辑../plugins/cordova-plugin-facebook4/plugins.xml更改

<framework src="com.facebook.android:facebook-android-sdk:$FACEBOOK_ANDROID_SDK_VERSION"/>

<framework src="build.gradle" custom="true" type="gradleReference"/>

6,添加Android平台并构建

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Android:程序类型已存在:com.google.zxing.BarcodeFormat

离子应用程序运行错误:多个dex文件定义了Lcom / google / zxing / BarcodeFormat

如何解决由番石榴引起的错误:程序类型已存在:com.google.common.util.concurrent.internal.InternalFutures

如何解决“计划已经存在键入:com.google.common.util.concurrent.ListenableFuture”?

为什么我在运行mvn -DskipTests -Dgpg.skip = true安装时无法找到com.google.zxing:core:jar:2.2-SNAPSHOT错误,如何解决?

程序类型已经存在com.google.gson.FieldAttributes

iReport中的google.zxing条码生成器

如何在ZXing中设置位图的大小?

如何使用Heroku在python中获得Zxing?

在片段中,如何停止ZXing Scanner的相机?

在模块 jetified-com.google.zxing.client.android.captureactivity.jar 和 jetified-core-3.3.3.jar 中发现重复类 com.google.zxing.Binarizer

从活动中呼叫zxing

旧库 zxing 未在我的应用程序中运行

无法找到或加载主类com.google.zxing.client.j2se.CommandLineRunner

错误:程序类型已经存在:com.google.android.gms.internal.measurement.zzdz

程序类型已经存在:com.google.android.gms.common.api.internal.zzbs

程序类型已经存在:com.google.android.gms.internal.measurement.zzdz

程序类型已经存在:com.google.devtools.build.android.desugar.runtime.ThrowableExtension

Firestore:错误:程序类型已经存在:com.google.android.gms.internal.measurement.zzeb

程序类型已经存在:com.google.android.gms.internal.zzfq

错误:程序类型已经存在:com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder

程序类型已经存在:com.google.android.gms.common.util.VisibleForTesting

程序类型已经存在:com.google.common.util.concurrent.ListenableFuture

程序类型已经存在:com.google.android.gms.common.api.zzf

程序类型已经存在:com.google.android.gms.common.util.VisibleForTesting-':app:transformDexArchiveWithExternalLibsDexMergerForDebug'

程序类型已经存在:com.google.common.util.concurrent.internal.InternalFutureFailureAccess

程序类型已经存在:com.google.gdata.util.common.base.Preconditions

错误:程序类型已经存在:com.google.gson.annotations.Expose

程序类型已经存在:com.google.common.util.concurrent.ListenableFuture重复类