2016-09-13 4 views
0

ich versuche apk zu erzeugen und diese Fehlermeldung zu erhalten:generieren APK Fehler unterzeichnet

Fehler: Ausführung für die Task fehlgeschlagen ': transformClassesAndResourcesWithProguardForRelease'.

Hat jemand weiß, was ich bin tun müssen, erzeugen die die apk das ist meine build.gradle Datei:

buildscript { 
    repositories { 
     maven { url "http://dl.bintray.com/populov/maven" } 
     jcenter() 
     mavenCentral() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.1.3' 

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

allprojects { 
    repositories { 
     maven { url "http://dl.bintray.com/populov/maven" } 
     jcenter() 
     mavenCentral() 
    } 
} 

apply plugin: 'com.android.application' 

//Explain the libraries we use. 
dependencies { 
    compile fileTree(dir: 'libs', include: '*.jar') 
    compile 'com.google.android.gms:play-services:3.2.65' 
    compile 'com.android.support:support-v4:23.1.+' 
    compile 'com.android.support:appcompat-v7:23.4.0' 
    compile files('libs/PDFNet.jar') 
    compile 'de.hdodenhof:circleimageview:2.0.0' 
    compile "com.squareup.picasso:picasso:2.4.0" 
    compile 'com.devbrackets.android:exomedia:3.0.1' 
    compile 'com.viewpagerindicator:library:[email protected]' 
} 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.3" 
    sourceSets { 
     main { 
      manifest.srcFile 'AndroidManifest.xml' 
      java.srcDirs = ['src'] 
      resources.srcDirs = ['src'] 
      aidl.srcDirs = ['src'] 
      renderscript.srcDirs = ['src'] 
      res.srcDirs = ['res'] 
      assets.srcDirs = ['assets'] 
      jniLibs.srcDirs = ['libs'] 
     } 

     // Move the tests to tests/java, tests/res, etc... 
     instrumentTest.setRoot('tests') 

     // Move the build types to build-types/<type> 
     // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ... 
     // This moves them out of them default location under src/<type>/... which would 
     // conflict with src/ being used by the main source set. 
     // Adding new build types or product flavors should be accompanied 
     // by a similar customization. 
     debug.setRoot('build-types/debug') 
     release.setRoot('build-types/release') 
    } 
    buildTypes { 
     release { 
      minifyEnabled true 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg' 
//   proguardFile 'D:/Development/kalsefer/trunk/AndroidTronReader/playstore.kalsefer.keystore' 
     } 
    } 
    lintOptions { 
     checkReleaseBuilds false 
     // If true, stop the gradle build if errors are found 
     abortOnError false 
    } 

    splits { 
     abi { 
      enable true 
      reset() 
      include 'armeabi', 'armeabi-v7a', 'x86', 'x86_64' //select ABIs to build APKs for 
      universalApk true //generate an additional APK that contains all the ABIs 
     } 
    } 

    // map for the version code 
    project.ext.versionCodes = ['armeabi': 1, 'armeabi-v7a': 2, 'x86': 3, 'x86_64': 4] 

    android.applicationVariants.all { variant -> 
     // assign different version code for each output 
     variant.outputs.each { output -> 
      output.versionCodeOverride = 
        project.ext.versionCodes.get(output.getFilter(com.android.build.OutputFile.ABI), 0) * 1000000 
     } 
    } 
    android { 
     useLibrary 'org.apache.http.legacy' 
    } 
} 
+0

Was ist eine Konfiguration Ihrer Proguard-Datei? Warum haben Sie Ihre benutzerdefinierten Regeln Erweiterung von proguard.cfg? Ist das nicht proguard.pro? –

+0

Wo kann ich es finden? –

+0

[SCREEN_SHOT] (http://prnt.sc/chjmzs) Es sollte sich im selben Ordner wie Ihre Build.Gradle-Datei befinden. –

Antwort

0

können Sie überprüfen, ob Sie keine proguard Einstellungen für dritte verpasst haben Pary-Bibliotheken, die Sie verwenden. Für die erweiterte Liste der Programmregeln für Bibliotheken können Sie hier nachsehen: Android Proguard Snippets

+0

Danke Tom, das war das Problem. ich fügte drei Bibliotheken hinzu und ich füge sie nicht dem proguard hinzu –

+0

Nett, ist es gut, dass Sie ein Problem dachten. Das erste, was zu prüfen ist, wenn der Progamm den Build abstürzt, sind die Proguard-Regeln. –

-1
-optimizationpasses 5 
-dontusemixedcaseclassnames 
-dontskipnonpubliclibraryclasses 
-dontskipnonpubliclibraryclassmembers 
-dontpreverify 
-verbose 
-dontshrink 

-dontwarn android.support.v4.** 
-dontwarn com.google.android.gms.** 

#Obfuscate settings 
-dontobfuscate 

#Optimization settings 
#-optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 
-dontoptimize 
#-optimizations !field/removal/writeonly,!field/marking/private,!class/merging/*,!code/allocation/variable 

-keepparameternames 
-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,*Annotation*,EnclosingMethod 


-keep public class * extends android.app.Activity 
-keep public class * extends android.app.Application 
-keep public class * extends android.app.Service 
-keep public class * extends android.content.BroadcastReceiver 
-keep public class * extends android.content.ContentProvider 
-keep public class * extends android.app.backup.BackupAgentHelper 
-keep public class * extends android.preference.Preference 
-keep public class com.android.vending.licensing.ILicensingService 


-keep public class com.kalsefer.app.ui.BrowserActivity 
-keep public class com.kalsefer.app.ui.BrowserActivity$IJavascriptHandler 
-keep public class com.kalsefer.app.ui.BrowserActivity$DownloadBookDRM 
-keep public class com.kalsefer.app.ui.BrowserActivity$DownloadBook 
-keep public class * implements com.kalsefer.app.ui.BrowserActivity$IJavascriptHandler 

-keepclassmembers class com.kalsefer.app.ui.BrowserActivity$IJavascriptHandler { 
    <methods>; 
} 

-keepnames public class com.kalsefer.app.reader.** { 
    public protected private *; 
} 

-keepclasseswithmembers public class com.kalsefer.app.reader.BookReader { 
    public protected private *; 
    private native <methods>; 
} 

-keepclasseswithmembers public class com.kalsefer.app.reader.DocumentManager { 
    public protected private *; 
    private native <methods>; 
} 

-keepclasseswithmembers public class com.kalsefer.app.reader.MarkInfo { 
    public protected private *; 
} 

-keepclasseswithmembers public class * { 
    public protected private *; 
} 


-keepclasseswithmembers class * { 
    private native <methods>; 
} 

-keepclasseswithmembers class * { 
    public <init>(android.content.Context, android.util.AttributeSet); 
} 

-keepclasseswithmembers class * { 
    public <init>(android.content.Context, android.util.AttributeSet, int); 
} 

-keepclassmembers enum * { 
    public static **[] values(); 
    public static ** valueOf(java.lang.String); 
} 

-keep class * implements android.os.Parcelable { 
    public static final android.os.Parcelable$Creator *; 
} 

-keepclassmembers class * { 
    @android.webkit.JavascriptInterface <methods>; 
} 

-keep class pdftron.PDF.PDFViewCtrl$RenderCallback { *; } 
-keep class pdftron.PDF.PDFViewCtrl$PrivateDownloader { *; } 
-keep class pdftron.PDF.PDFViewCtrl$LinkInfo { *; } 
-keep class pdftron.Filters.CustomFilter$CustomFilterCallback { *; } 
-keep class pdftron.PDF.ProgressMonitor { *; } 
-keep class pdftron.SDF.ProgressMonitor { *; } 
+0

Bitte geben Sie an, warum das hilft, wo legt er das hin, was das tut usw. –

Verwandte Themen