在构建Android应用程序时出现gradle错误(Getting gradle error while building android app)
我在构建Android应用程序时遇到gradle错误。 我收到以下错误:
Error:Execution failed for task ':app:transformClassesWithJarMergingForNVOLVDebug'.
com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com / google / myjson / stream / MalformedJsonException.class
任何形式的帮助将受到高度赞赏。
应用程序/ gradle这个
apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion '23.0.3' useLibrary 'org.apache.http.legacy' packagingOptions { exclude 'META-INF/LICENSE' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/license.txt' exclude 'META-INF/NOTICE' exclude 'META-INF/NOTICE.txt' exclude 'META-INF/notice.txt' exclude 'META-INF/ASL2.0' } defaultConfig { applicationId "com.app.iqvis.nvolv_cleanup" minSdkVersion 16 targetSdkVersion 23 versionCode 2 versionName "2.1" multiDexEnabled true renderscriptTargetApi 19 renderscriptSupportModeEnabled true ndk { abiFilters "armeabi", "armeabi-v7a", "x86", "mips" } } productFlavors { NVOLV { applicationId "com.app.iqvis.nvolv" copy { from 'src/main/' include '*.json' into '.' } versionCode 51 versionName "2.0.2" } ISNA { applicationId "com.app.iqvis.isna" // manifest.srcFile "isna/AndroidMenifest.xml" } ARNOVA { applicationId "com.app.iqvis.arnova" } PERISCOPE { applicationId "com.app.iqvis.periscope" } SAN { applicationId "com.app.iqvis.sanjosejazz" } OHIO { applicationId 'com.app.iqvis.ohioaeyc' copy { from 'src/OHIO/' include '*.json' into '.' } versionCode 32 versionName '1.992' } BeckersHealthCare { applicationId 'com.app.iqvis.beckershealthcare' copy { from 'src/BeckersHealthCare/' include '*.json' into '.' } versionCode 32 versionName '1.91' } NPCenter { applicationId 'com.app.iqvis.npcenter' copy { from 'src/NPCenter/' include '*.json' into '.' } versionCode 32 versionName '1.7' } NVOLVDev { applicationId "com.app.iqvis.nvolvdev" copy { from 'src/NVOLVDev/' include '*.json' into '.' } versionCode 19 versionName "2.39" } WSCPA { applicationId "com.app.iqvis.wscpa" copy { from 'src/WSCPA/' include '*.json' into '.' } versionCode 32 versionName "1.2" } UMAA { applicationId "com.app.iqvis.umaa" copy { from 'src/UMAA/' include '*.json' into '.' } versionCode 32 versionName "1.1" } SFDW { applicationId "com.app.iqvis.sfdw" copy { from 'src/SFDW/' include '*.json' into '.' } versionCode 3 versionName "1.96" } CALCPA { applicationId 'com.app.iqvis.calcpa' copy { from 'src/CALCPA/' include '*.json' into '.' } versionCode 2 versionName '1.1' } } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } dexOptions { javaMaxHeapSize "4g" preDexLibraries = true } compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } } repositories { maven { url 'http://repo1.maven.org/maven2' } mavenCentral() } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') testCompile 'junit:junit:4.12' compile files('libs/zbar.jar') compile files('libs/android-volley-master-1.0.15.jar') compile files('libs/Branch-1.10.8.jar') // compile files('libs/ormlite-core-4.41.jar') compile files('libs/sugar-1.3.jar') compile files('libs/google-api-client-1.17.0-rc.jar') // compile files('libs/sinch-android-rtc-3.6.1.jar') compile files('libs/google-api-services-urlshortener-v1-rev22-1.17.0-rc.jar') compile files('libs/crittercism_v5_3_3_sdkonly.jar') // compile files('libs/httpmime-4.1.3.jar') compile files('libs/google-http-client-1.17.0-rc.jar') // compile files('libs/ormlite-android-4.41.jar') // compile files('libs/nvolvlib.jar') provided files('libs/myjson-2.3.1.jar') compile files('libs/google-http-client-android-1.17.0-rc.jar') compile files('libs/iqvisanalytics.jar') compile files('libs/stickygridheaders.jar') compile files('libs/google-api-client-android-1.17.0-rc.jar') // compile files('libs/commSinch.jar') compile project(':resideMenu') compile project(':library') compile project(':nvolvlib') compile project(':extensiblepageindicator') compile project(':ahbottomnavigation') compile project(':commSinch') compile project(':fab') compile files('libs/gentlyWEB-utils-1.1.jar') compile files('libs/JoSQL-2.2.jar') // compile 'com.android.support:recyclerview-v7:23.0.0' // compile 'com.android.support:cardview-v7:23.0.0' compile'joda-time:joda-time:2.7' compile'com.google.android.gms:play-services:8.4.0' compile'com.squareup.picasso:picasso:2.5.2' compile'me.leolin:ShortcutBadger:1.1.3@aar' compile'com.parse.bolts:bolts-android:1.+' compile'com.parse:parse-android:1.+' compile 'com.github.traex.rippleeffect:library:1.3' compile 'com.android.support:appcompat-v7:23.0.0' compile 'com.android.support:design:23.0.0' compile 'com.google.android.gms:play-services-identity:8.4.0' compile 'com.android.support:recyclerview-v7:23.0.0' compile 'com.android.support:cardview-v7:23.0.0' compile 'de.hdodenhof:circleimageview:2.0.0' compile 'com.roughike:bottom-bar:1.2.1' compile 'com.google.guava:guava:19.0' compile 'com.ms-square:expandableTextView:0.1.4' compile 'com.google.android.gms:play-services-gcm:8.4.0' compile 'com.google.android.gms:play-services-ads:8.4.0' }
nvolvlib gradle文件:
apply plugin: 'com.android.library' android { compileSdkVersion 23 buildToolsVersion "23.0.3" useLibrary 'org.apache.http.legacy' defaultConfig { minSdkVersion 16 targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.0.0' compile files('libs/httpmime-4.1.3.jar') compile files('libs/ormlite-core-4.43.jar') compile files('libs/ormlite-android-4.43.jar') compile files('libs/myjson-2.3.1.jar') }
I am getting gradle error while building android app. I am getting following error:
Error:Execution failed for task ':app:transformClassesWithJarMergingForNVOLVDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/myjson/stream/MalformedJsonException.class
Any kind of help would be highly appreciated.
app/gradle
apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion '23.0.3' useLibrary 'org.apache.http.legacy' packagingOptions { exclude 'META-INF/LICENSE' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/license.txt' exclude 'META-INF/NOTICE' exclude 'META-INF/NOTICE.txt' exclude 'META-INF/notice.txt' exclude 'META-INF/ASL2.0' } defaultConfig { applicationId "com.app.iqvis.nvolv_cleanup" minSdkVersion 16 targetSdkVersion 23 versionCode 2 versionName "2.1" multiDexEnabled true renderscriptTargetApi 19 renderscriptSupportModeEnabled true ndk { abiFilters "armeabi", "armeabi-v7a", "x86", "mips" } } productFlavors { NVOLV { applicationId "com.app.iqvis.nvolv" copy { from 'src/main/' include '*.json' into '.' } versionCode 51 versionName "2.0.2" } ISNA { applicationId "com.app.iqvis.isna" // manifest.srcFile "isna/AndroidMenifest.xml" } ARNOVA { applicationId "com.app.iqvis.arnova" } PERISCOPE { applicationId "com.app.iqvis.periscope" } SAN { applicationId "com.app.iqvis.sanjosejazz" } OHIO { applicationId 'com.app.iqvis.ohioaeyc' copy { from 'src/OHIO/' include '*.json' into '.' } versionCode 32 versionName '1.992' } BeckersHealthCare { applicationId 'com.app.iqvis.beckershealthcare' copy { from 'src/BeckersHealthCare/' include '*.json' into '.' } versionCode 32 versionName '1.91' } NPCenter { applicationId 'com.app.iqvis.npcenter' copy { from 'src/NPCenter/' include '*.json' into '.' } versionCode 32 versionName '1.7' } NVOLVDev { applicationId "com.app.iqvis.nvolvdev" copy { from 'src/NVOLVDev/' include '*.json' into '.' } versionCode 19 versionName "2.39" } WSCPA { applicationId "com.app.iqvis.wscpa" copy { from 'src/WSCPA/' include '*.json' into '.' } versionCode 32 versionName "1.2" } UMAA { applicationId "com.app.iqvis.umaa" copy { from 'src/UMAA/' include '*.json' into '.' } versionCode 32 versionName "1.1" } SFDW { applicationId "com.app.iqvis.sfdw" copy { from 'src/SFDW/' include '*.json' into '.' } versionCode 3 versionName "1.96" } CALCPA { applicationId 'com.app.iqvis.calcpa' copy { from 'src/CALCPA/' include '*.json' into '.' } versionCode 2 versionName '1.1' } } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } dexOptions { javaMaxHeapSize "4g" preDexLibraries = true } compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } } repositories { maven { url 'http://repo1.maven.org/maven2' } mavenCentral() } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') testCompile 'junit:junit:4.12' compile files('libs/zbar.jar') compile files('libs/android-volley-master-1.0.15.jar') compile files('libs/Branch-1.10.8.jar') // compile files('libs/ormlite-core-4.41.jar') compile files('libs/sugar-1.3.jar') compile files('libs/google-api-client-1.17.0-rc.jar') // compile files('libs/sinch-android-rtc-3.6.1.jar') compile files('libs/google-api-services-urlshortener-v1-rev22-1.17.0-rc.jar') compile files('libs/crittercism_v5_3_3_sdkonly.jar') // compile files('libs/httpmime-4.1.3.jar') compile files('libs/google-http-client-1.17.0-rc.jar') // compile files('libs/ormlite-android-4.41.jar') // compile files('libs/nvolvlib.jar') provided files('libs/myjson-2.3.1.jar') compile files('libs/google-http-client-android-1.17.0-rc.jar') compile files('libs/iqvisanalytics.jar') compile files('libs/stickygridheaders.jar') compile files('libs/google-api-client-android-1.17.0-rc.jar') // compile files('libs/commSinch.jar') compile project(':resideMenu') compile project(':library') compile project(':nvolvlib') compile project(':extensiblepageindicator') compile project(':ahbottomnavigation') compile project(':commSinch') compile project(':fab') compile files('libs/gentlyWEB-utils-1.1.jar') compile files('libs/JoSQL-2.2.jar') // compile 'com.android.support:recyclerview-v7:23.0.0' // compile 'com.android.support:cardview-v7:23.0.0' compile'joda-time:joda-time:2.7' compile'com.google.android.gms:play-services:8.4.0' compile'com.squareup.picasso:picasso:2.5.2' compile'me.leolin:ShortcutBadger:1.1.3@aar' compile'com.parse.bolts:bolts-android:1.+' compile'com.parse:parse-android:1.+' compile 'com.github.traex.rippleeffect:library:1.3' compile 'com.android.support:appcompat-v7:23.0.0' compile 'com.android.support:design:23.0.0' compile 'com.google.android.gms:play-services-identity:8.4.0' compile 'com.android.support:recyclerview-v7:23.0.0' compile 'com.android.support:cardview-v7:23.0.0' compile 'de.hdodenhof:circleimageview:2.0.0' compile 'com.roughike:bottom-bar:1.2.1' compile 'com.google.guava:guava:19.0' compile 'com.ms-square:expandableTextView:0.1.4' compile 'com.google.android.gms:play-services-gcm:8.4.0' compile 'com.google.android.gms:play-services-ads:8.4.0' }
nvolvlib gradle file:
apply plugin: 'com.android.library' android { compileSdkVersion 23 buildToolsVersion "23.0.3" useLibrary 'org.apache.http.legacy' defaultConfig { minSdkVersion 16 targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.0.0' compile files('libs/httpmime-4.1.3.jar') compile files('libs/ormlite-core-4.43.jar') compile files('libs/ormlite-android-4.43.jar') compile files('libs/myjson-2.3.1.jar') }
原文:https://stackoverflow.com/questions/39847868
最满意答案
我已经改变了你的语法 - http://jsfiddle.net/w25mQ/4/
if( $('#menu').width === 150 )....
和
$(this).animate....
评论者是对的,你应该结合你的点击处理程序,像这样 - http://jsfiddle.net/w25mQ/5/
I have made a change to your syntax - http://jsfiddle.net/w25mQ/4/
if( $('#menu').width === 150 )....
and
$(this).animate....
The commenter is right though, you should combine your click handlers, like this - http://jsfiddle.net/w25mQ/5/
相关问答
更多-
首先需要将事件处理程序定义为单独的(命名)函数: function myMouseWheelHandler(e) { if (e.target.id == 'el') return; e.preventDefault(); e.stopPropagation(); $(this).css({ "overflow-y": "scroll", "position": "fixed", "width": "100%" }); }; 然后保留你拥有的.on() ,但现在使用你的命名 ...
-
jQuery规范化了这个,你可以可靠地调用.preventDefault() ,如下所示: $("#admin_main").delegate("#create_user_form", "submit", function (event) { event.preventDefault(); $.post('create_user', $("#create_user_form").serialize(), function (data) { $("#admin_main").html(data ...
-
该事件需要传递给该函数。 该函数需要两个参数,但它只传递一个参数。 OnClientClick = "return EmpDelete(e," + e.Row.Cells[iFNmae].Text + ");" 完整来源 protected void gv_RowDataBound(object sender, GridViewRowEventArgs e) { e.Row.Cells[iDelete].Controls.Add (new ImageButton ...
-
你可以尝试这样做: 为div设置属性tabindex #divQuickCartDialog :...CSS仅用于样式,将outline设置为0: #divQuickCartDialog { outline:0; height:100%; width:100%; } 然后通过以下方式替换文档click和touchstart处理程序: $("#divQuickCart ...
-
在什么情况下我们可以使用preventDefault()? 实际上,任何类型的事件都可以通过preventDefault();来停止它的默认行为preventDefault(); 因此,不仅要提交按钮,还要按下按钮,滚动事件,并为其命名,并且可以防止它发生。 或者,如果您想将自己的逻辑添加到默认行为中,请考虑记录事件或您选择的任何内容。 2.如何查找所有浏览器的默认行为? 比如,如果我点击一个按钮,浏览器的默认行为是什么? 这是什么意思? 大多数默认行为都是暗含的。 当你点击一个按钮时,onclick事件触 ...
-
我已经改变了你的语法 - http://jsfiddle.net/w25mQ/4/ if( $('#menu').width === 150 ).... 和 $(this).animate.... 评论者是对的,你应该结合你的点击处理程序,像这样 - http://jsfiddle.net/w25mQ/5/ I have made a change to your syntax - http://jsfiddle.net/w25mQ/4/ if( $('#menu').width === 150 ).. ...
-
打破.preventDefault()(Breaking .preventDefault())[2021-09-19]
只要代码中没有出现任何问题,在何处调用preventDefault无关紧要。 如果将它放在代码中,它将阻止默认操作,即使脚本进一步崩溃。 如果你把它放在代码的最后,它只会阻止默认操作,如果脚本在途中没有崩溃。 As long as nothing goes wrong in the code, it doesn't matter where you call preventDefault. If you put it first in the code, it will prevent the defaul ... -
你的问题是; 获取ajax请求后的错误div与移动浏览器中的表单重叠,如下图所示。 您可以使用; margin-top:20px; 为你的错误div。 解决之后,只需使用 return false; 代替 e.preventDefault(); beacuse移动浏览器没有点击事件。 你需要使用touchstart或touchend。 完整代码 $("#formRegister").submit(function (e) { var code = $('#Code').val(); v ...
-
e.preventDefault()对if / else条件不起作用100%(e.preventDefault() is not working 100% to if/else conditions)[2022-06-09]
$('#plus25').on('click', function(e) { var id = $('#selectChoice option:selected').attr('id'), $target = $('#'+ id +'Item'); $target.html(function(i, value) { var currentWidth = parseInt(value, 10), newWidth = currentWi ... -
模糊实现 您的代码可以防止selectChoice的默认值,但不能用于单击! 当通过鼠标或键盘选择选项时,自动完成对象会在input元素上触发selectChoice。 它不会弄乱click事件。 如果您不想要浏览器默认click事件,那么为什么要使用 ? 替代实施建议 你可以像这样制作一个自动完成模板: {% for video in video_qs %} {{ vi ...