2015-11-06 15 views
6

Ich versuche derzeit, einen Release-Build für eine App in Android Studio zu generieren. Ich habe versucht, alle Probleme loszuwerden, während ich den Release-Build erstelle, aber ich stecke auf ein paar Probleme fest.Fehler beim Generieren signierter Apk für die Veröffentlichung: Proguard config

Warning:com.viewpagerindicator.LinePageIndicator: can't find referenced method 'float ceil(float)' in library class android.util.FloatMath 
Warning:org.androidannotations.api.rest.RestClientHeaders: can't find referenced class org.springframework.http.HttpAuthentication 
Warning:org.androidannotations.api.rest.RestClientSupport: can't find referenced class org.springframework.web.client.RestTemplate 
Warning:org.androidannotations.api.rest.RestErrorHandler: can't find referenced class org.springframework.core.NestedRuntimeException 
Warning:there were 4 unresolved references to classes or interfaces. 
    You may need to add missing library jars or update their versions. 
    If your code works fine without the missing classes, you can suppress 
    the warnings with '-dontwarn' options. 
    (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass) 
Warning:there were 1 unresolved references to library class members. 
    You probably need to update the library versions. 
    (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember) 
Exception while processing task 
java.io.IOException: Please correct the above warnings first. 

ich auch mit einem Fehler präsentiert bin die

Error:Execution failed for task ':app:packageRelease'. 
> Unable to compute hash of /Users/rohanmahale/AndroidStudioProjects/Prism/app/build/intermediates/classes-proguard/release/classes.jar 

In meiner gradle Datei heißt ich folgende

android { 
compileSdkVersion 23 
buildToolsVersion '23.0.2' 
defaultConfig { 
    applicationId 'com.prism.prismapp' 
    minSdkVersion 16 
    targetSdkVersion 23 
    versionCode 1 
    versionName "1.0" 
} 
buildTypes { 
    release { 
     minifyEnabled true 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
} 
productFlavors { 
} 

}

Meine Liste von Abhängigkeiten gesetzt haben, sind als folgt

dependencies { 
compile fileTree(include: ['*.jar'], dir: 'libs') 
apt "org.androidannotations:androidannotations:$AAVersion" 
compile "org.androidannotations:androidannotations-api:$AAVersion" 
compile 'com.android.support:appcompat-v7:23.1.0' 
compile 'com.android.support:cardview-v7:23.0.+' 
compile 'com.android.support:recyclerview-v7:23.0.+' 
compile 'de.greenrobot:eventbus:2.4.0' 
compile 'com.joooonho:selectableroundedimageview:1.0.1' 
compile 'com.commonsware.cwac:camera:0.6.+' 
compile 'com.squareup.retrofit:retrofit:1.9.0' 
compile 'commons-io:commons-io:2.4' 
compile 'com.facebook.android:facebook-android-sdk:4.7.0' 
compile 'com.github.nkzawa:socket.io-client:0.5.2' 
compile 'io.nlopez.smartlocation:library:3.2.0' 
compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
    transitive = true; 
} 
compile 'uk.co.chrisjenx:calligraphy:2.1.0' 
compile 'com.github.bumptech.glide:glide:3.6.1' 
compile 'com.pixplicity.multiviewpager:library:1.0' 
compile 'com.githang:viewpagerindicator:[email protected]' 
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1' 
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1' 
compile 'com.commit451:PhotoView:1.2.4' 
compile 'me.villani.lorenzo.android:android-cropimage:1.1.0' 
compile ('com.google.android.gms:play-services-analytics:8.1.0') { 
    exclude module: 'play-services-ads' 
}} 

Wie bekomme ich die Probleme los und erfolgreich erstellen die Release-Build?

UPDATE:

ich in der Lage war der Warnung an android Anmerkungen im Zusammenhang loszuwerden.

ich mit der folgenden Ausgabe am linken

Warning:com.viewpagerindicator.LinePageIndicator: can't find referenced method 'float ceil(float)' in library class android.util.FloatMath 
Warning:there were 1 unresolved references to library class members. 
    You probably need to update the library versions. 
     (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember) 
+1

Es weil 'FloatMath.ceil sein könnte()' ist dekreptiert. Sie müssen mit 'Math.ceil()' wechseln. – Fllo

+0

Wie und wo sollte ich diese Änderung vornehmen? Es ist Teil einer Viewindicator-Bibliothek aar, die ich gefunden habe. – Rohan

+0

In der Tat wird dies ein Problem sein. Ich habe das gleiche Problem, aber ich benutzte die lib in lokalen Ordner, daher konnte ich diese Methoden ändern. Da es in LinePageIndicator.java 'private' gibt, weiß ich zumindest nicht, dass Sie diese lib im lokalen Ordner bekommen. – Fllo

Antwort

9

Für mich ist die aktuelle Lösung ist die folgende Zeile in meine proguard Datei hinzufügen:

-dontwarn com.viewpagerindicator.** 

Dies entfernt Warnung in über Paket kommt, wenn Sie erstellen Freigabe bauen

+0

sollte ich noch -keep public class com.viewpagerindicator.LinePageIndicator hinzufügen? – natsumiyu

0

Verwenden Sie dies, es hat die Lösung.

Kompilierung 'fr.avianey.com.viewpagerindicator: Bibliothek: [email protected]'

können Sie überprüfen diese github issue

Verwandte Themen