0

Ich habe diesen Fehler beim Hinzufügen der Projektbibliothek gpuimage-library. zu meiner App würde grade.build das Problem beheben, tut es jedoch nicht. Hier ist, wie meine app grapple.build derzeit aussieht.Erstellung fehlgeschlagen für Fehler: Ausführung fehlgeschlagen für Task ': app: transformNative_libsWithMergeJniLibsForRelease'

Dies ist Top-Level-build.gradle config:

// Top-level build file where you can add configuration options common to all sub-projects/modules. 
 

 
buildscript { 
 
    repositories { 
 
     jcenter() 
 
    } 
 
    dependencies { 
 
     classpath 'com.android.tools.build:gradle:2.2.2' 
 

 
     // NOTE: Do not place your application dependencies here; they belong 
 
     // in the individual module build.gradle files 
 
    } 
 
} 
 

 
allprojects { 
 
    repositories { 
 
     jcenter() 
 
    } 
 
} 
 

 
task clean(type: Delete) { 
 
    delete rootProject.buildDir 
 
}

Das ist meine app/build.gradle config:

import org.apache.tools.ant.taskdefs.condition.Os 
 

 
apply plugin: 'com.android.application' 
 

 
android { 
 
    compileSdkVersion 25 
 
    buildToolsVersion "25.0.2" 
 
    defaultConfig { 
 
     minSdkVersion 16 
 
     targetSdkVersion 25 
 
     versionCode 2 
 
     versionName "2.0" 
 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
 
     ndk { 
 
      abiFilters 'armeabi-v7a' 
 
     } 
 
    } 
 
    buildTypes { 
 
     release { 
 
      minifyEnabled false 
 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
 
     } 
 
    } 
 

 
    packagingOptions { 
 
     exclude 'lib/armeabi-v7a/librsjni.so' 
 
    } 
 
    sourceSets.main.jni.srcDirs = [] 
 
    sourceSets.main.jniLibs.srcDirs = ['src/main/libs', 'src/main/jniLibs'] 
 

 
    task ndkBuild(type: Exec, description: 'Compile JNI source with NDK') { 
 
     Properties properties = new Properties() 
 
     properties.load(project.rootProject.file('local.properties').newDataInputStream()) 
 
     def ndkDir = properties.getProperty('ndk.dir') 
 

 
     if (Os.isFamily(Os.FAMILY_WINDOWS)) { 
 
      commandLine "$ndkDir/ndk-build.cmd", '-C', file('src/main/jni').absolutePath 
 
     } else { 
 
      commandLine "$ndkDir/ndk-build", '-C', file('src/main/jni').absolutePath 
 
     } 
 
    } 
 

 
    tasks.withType(JavaCompile) { 
 
     compileTask -> compileTask.dependsOn ndkBuild 
 
    } 
 

 
    task ndkClean(type: Exec, description: 'Clean NDK Binaries') { 
 
     Properties properties = new Properties() 
 
     properties.load(project.rootProject.file('local.properties').newDataInputStream()) 
 
     def ndkDir = properties.getProperty('ndk.dir') 
 

 
     if (Os.isFamily(Os.FAMILY_WINDOWS)) { 
 
      commandLine "$ndkDir/ndk-build.cmd", 'clean', '-C', file('src/main/jni').absolutePath 
 
     } else { 
 
      commandLine "$ndkDir/ndk-build", 'clean', '-C', file('src/main/jni').absolutePath 
 
     } 
 
    } 
 

 
    clean.dependsOn 'ndkClean' 
 
} 
 

 

 
dependencies { 
 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
 
     exclude group: 'com.android.support', module: 'support-annotations' 
 
    }) 
 
    compile project(':stmobile') 
 
    compile project(':rajawali') 
 
    compile 'com.android.support:appcompat-v7:25.3.1' 
 
    compile 'com.android.support:recyclerview-v7:25.3.1' 
 
    compile 'com.android.support:design:25.3.1' 
 
    compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.4.1' 
 
    testCompile 'junit:junit:4.12' 
 
    compile 'it.sephiroth.android.library.horizontallistview:hlistview:1.3.1' 
 
    compile 'com.github.bumptech.glide:glide:3.8.0' 
 
    compile 'com.android.support:cardview-v7:25.0.0' 
 
    compile 'com.facebook.android:audience-network-sdk:4.+' 
 
    compile project(':library') 
 
}

Error:Execution failed for task ':app:transformNative_libsWithMergeJniLibsForDebug'. 
 
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK lib/armeabi-v7a/libgpuimage-library.so 
 
\t File1: C:\Users\DASF\Desktop\\ssss\app\build\intermediates\exploded-aar\jp.co.cyberagent.android.gpuimage\gpuimage-library\1.4.1\jni 
 
\t File2: C:\Users\DASF\Desktop\ssssp\app\build\intermediates\exploded-aar\facesnap\library\unspecified\jni

Was mache ich falsch und wie man es beheben? . Folgende in Config danke

Antwort

0

Arbeits Lösung für mich unterstützen, ist Top-Level-build.gradle hinzuzufügen:

allprojects { 
repositories { 
    jcenter() 
    maven { 
     url "https://maven.google.com" 
    } 
}} 
Verwandte Themen