添加2个或更多.jar文件时出错。在模块(Android)中找到重复的类。有没有办法合并或排除重复的类?

问题描述 投票:0回答:1

我正在做一个Android应用程序,我试图使用几个扩展名通过jar文件添加它们。但是,当我编译并运行时,出现以下错误:

Duplicate class com.google.gson.DefaultDateTypeAdapter found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.ExclusionStrategy found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.FieldAttributes found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.FieldNamingPolicy found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.FieldNamingPolicy$1 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.FieldNamingPolicy$2 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.FieldNamingPolicy$3 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.FieldNamingPolicy$4 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.FieldNamingPolicy$5 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.FieldNamingStrategy found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.Gson found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.Gson$1 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.Gson$2 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.Gson$3 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.Gson$4 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.Gson$5 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.Gson$FutureTypeAdapter found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.GsonBuilder found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.InstanceCreator found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.JsonArray found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.JsonDeserializationContext found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.JsonDeserializer found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.JsonElement found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.JsonIOException found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.JsonNull found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.JsonObject found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.JsonParseException found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.JsonParser found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.JsonPrimitive found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.JsonSerializationContext found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.JsonSerializer found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.JsonStreamParser found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.JsonSyntaxException found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.LongSerializationPolicy found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.LongSerializationPolicy$1 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.LongSerializationPolicy$2 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.TypeAdapter found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.TypeAdapter$1 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.TypeAdapterFactory found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.annotations.Expose found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.annotations.SerializedName found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.annotations.Since found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.annotations.Until found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.$Gson$Preconditions found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.$Gson$Types found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.$Gson$Types$GenericArrayTypeImpl found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.$Gson$Types$ParameterizedTypeImpl found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.$Gson$Types$WildcardTypeImpl found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.ConstructorConstructor found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.ConstructorConstructor$1 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.ConstructorConstructor$10 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.ConstructorConstructor$11 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.ConstructorConstructor$12 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.ConstructorConstructor$2 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.ConstructorConstructor$3 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.ConstructorConstructor$4 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.ConstructorConstructor$5 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.ConstructorConstructor$6 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.ConstructorConstructor$7 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.ConstructorConstructor$8 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.ConstructorConstructor$9 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.Excluder found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.Excluder$1 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.JsonReaderInternalAccess found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.LazilyParsedNumber found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.LinkedTreeMap found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.LinkedTreeMap$1 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.LinkedTreeMap$EntrySet found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.LinkedTreeMap$EntrySet$1 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.LinkedTreeMap$KeySet found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.LinkedTreeMap$KeySet$1 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.LinkedTreeMap$LinkedTreeMapIterator found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.LinkedTreeMap$Node found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.ObjectConstructor found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.Primitives found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.Streams found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.Streams$AppendableWriter found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.Streams$AppendableWriter$CurrentWrite found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.UnsafeAllocator found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.UnsafeAllocator$1 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.UnsafeAllocator$2 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.UnsafeAllocator$3 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.UnsafeAllocator$4 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.bind.ArrayTypeAdapter found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.bind.ArrayTypeAdapter$1 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.bind.CollectionTypeAdapterFactory found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.bind.DateTypeAdapter found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.bind.DateTypeAdapter$1 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.bind.JsonTreeReader found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.bind.JsonTreeReader$1 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.bind.JsonTreeWriter found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.bind.JsonTreeWriter$1 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.bind.MapTypeAdapterFactory found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.bind.ObjectTypeAdapter found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.bind.ObjectTypeAdapter$1 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.bind.ObjectTypeAdapter$2 found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)
Duplicate class com.google.gson.internal.bind.ReflectiveTypeAdapterFactory found in modules jetified-siddhi-gpl-execution-geo-4.0.18.jar (siddhi-gpl-execution-geo-4.0.18.jar) and jetified-siddhi-map-json-4.1.2.jar (org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2)

Go to the documentation to learn how to Fix dependency resolution errors.

这是我的build.gradle(应用程序):

apply plugin: 'com.android.application'
apply plugin: 'me.champeau.gradle.antlr4'
android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "uca.es.geoprueba"
        minSdkVersion 19
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    configurations{
        all{
            exclude group: "org.wso2.extension.siddhi.map.json", module: "siddhi-map-json"
            resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1'
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    packagingOptions{
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/DEPENDENCIES'
        merge 'META-INF/annotations/org.wso2.siddhi.annotation.Extension'
        merge 'META-INF/annotations/io.siddhi.annotation.Extension'
        pickFirst 'META-INF/DEPENDENCIES'

    }
}

antlr4 {
    extraArgs = ['-package', 'org.wso2.siddhi.query.compiler']
    output = project.file("src/main/java/org/wso2/siddhi/query/compiler")
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.13'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation('org.wso2.siddhi:siddhi-core:4.5.11') {
        transitive = false
    }
    implementation('org.wso2.siddhi:siddhi-query-api:4.5.11') {
        transitive = false
    }
    implementation('org.wso2.siddhi:siddhi-query-compiler:4.5.11') {
        transitive = false
    }
    implementation('org.wso2.siddhi:siddhi-annotations:4.5.11') {
        transitive = false
    }
    annotationProcessor('org.wso2.siddhi:siddhi-annotations:4.5.11') {
        transitive = false
    }

    implementation ('org.wso2.extension.siddhi.map.json:siddhi-map-json:4.1.2'){
        transitive = false
    }

    implementation 'com.google.guava:guava:24.1-jre'
    implementation('org.apache.log4j.wso2:log4j:1.2.17.wso2v1') {
        transitive = false
    }
    implementation 'org.osgi:org.osgi.core:6.0.0'
    implementation 'org.wso2.orbit.com.lmax:disruptor:3.4.2.wso2v1'
    implementation 'org.antlr:antlr4-runtime:4.8'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.android.support:design:29.0.2'
    implementation 'io.dropwizard.metrics:metrics-core:4.1.2'
    implementation files('libs/siddhi-gpl-execution-geo-4.0.18.jar')

}

我已经尝试过此解决方案:Why I'm Getting Duplicate Class When Running My Android Project

尽管没有出现相同的错误,但执行时会给出错误。好像您只考虑了其中一个jar文件。这是错误:

2020-03-13 11:52:33.879 12164-12164/uca.es.geoprueba E/AndroidRuntime: FATAL EXCEPTION: main
    Process: uca.es.geoprueba, PID: 12164
    java.lang.RuntimeException: Unable to start activity ComponentInfo{uca.es.geoprueba/uca.es.geoprueba.MainActivity}: org.wso2.siddhi.core.exception.SiddhiAppCreationException: Error on 'geofencingSiddhi' @ Line: 1. Position: 232, near '@source(type='inMemory', @map(type='json', enclosing.element='STRING', fail.on.missing.attribute='false')) define stream inStream(id string, latitud double, longitud double, geoJSONGeometryFence string)'. No extension exist for sourceMapper:json

是否可以合并重复的类或排除其中的一些?

java android wso2 dependencies siddhi
1个回答
0
投票

我终于找到了解决方法。

我已遵循此解决方案:

Duplicates class found in modules

© www.soinside.com 2019 - 2024. All rights reserved.