Gradle sync在运行时没有显示任何错误,但是当我尝试运行应用程序时,它显示错误。
我尝试删除重复的库并在我的MainActivity
中添加了 apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.example.kanwal.calculator_test"
minSdkVersion 14
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true }
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-
rules.pro'} } }
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:multidex:1.0.1'
androidTestCompile('com.android.support.test.espresso:espresso
core:2.2.2',{
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile files('libs/javaluator-3.0.1.jar')}
,并试图清理并运行该项目,但没有运气。
错误:
错误:任务':app:transformClassesWithJarMergingForDebug'的执行失败。 com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com / fathzer / soft / javaluator / demo / DemoApplet.class
我的gradle代码:
#include<stdio.h>
int main(){
int a[10],i,j,arr_size;
printf("Enter the size of the array");
scanf("%d",&arr_size);
printf("Enter the array:");
for(i=0;i<arr_size;i++)
scanf("%d",&a[i]);
//here key is 42
//so we'll find the key and print the elements up to that
for(j=0;j<arr_size;j++){
if(j==42)
break;
//loop for the array up to the key
for(i=0;i<j;i++)
printf(" %d",a[i]);
}
return 0;
}