我想生成已簽名的apk。但我達到了64k的方法限制,所以我搜索了一些解決方案,其中一個是使用proguard。 我編輯的build.gradle這樣的:Android Proguard「找不到引用」
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
當我再嘗試生成APK簽署我得到了很多的警告:
Warning:com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar$2: can't find referenced method 'android.widget.TextView access$000(com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar)' in program class com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar
Warning:com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar$2: can't find enclosing method 'void setTextProgressAlign()' in program class com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar
Warning:com.github.mikephil.charting.data.realm.base.RealmBarLineScatterCandleBubbleDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.base.RealmBarLineScatterCandleBubbleDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.base.RealmBaseDataSet: can't find referenced class io.realm.Sort
Warning:com.github.mikephil.charting.data.realm.base.RealmBaseDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.base.RealmBaseDataSet: can't find referenced class io.realm.Sort
Warning:com.github.mikephil.charting.data.realm.base.RealmBaseDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.base.RealmBaseDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.base.RealmLineRadarDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.base.RealmLineRadarDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.base.RealmLineRadarDataSet: can't find referenced class io.realm.DynamicRealmObject
Warning:com.github.mikephil.charting.data.realm.base.RealmLineRadarDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.base.RealmLineRadarDataSet: can't find referenced class io.realm.DynamicRealmObject
Warning:com.github.mikephil.charting.data.realm.base.RealmLineRadarDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.base.RealmLineRadarDataSet: can't find referenced class io.realm.DynamicRealmObject
Warning:com.github.mikephil.charting.data.realm.base.RealmLineRadarDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.base.RealmLineRadarDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.base.RealmLineRadarDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.base.RealmLineScatterCandleRadarDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.base.RealmLineScatterCandleRadarDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.base.RealmUtils: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.base.RealmUtils: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.base.RealmUtils: can't find referenced class io.realm.DynamicRealmObject
Warning:com.github.mikephil.charting.data.realm.base.RealmUtils: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.base.RealmUtils: can't find referenced class io.realm.DynamicRealmObject
Warning:com.github.mikephil.charting.data.realm.base.RealmUtils: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.base.RealmUtils: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.base.RealmUtils: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.base.RealmUtils: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.base.RealmUtils: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBarData: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBarData: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBarData: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBarData: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBarDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBarDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBarDataSet: can't find referenced class io.realm.DynamicRealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBarDataSet: can't find referenced class io.realm.RealmList
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBarDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBarDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBarDataSet: can't find referenced class io.realm.DynamicRealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBarDataSet: can't find referenced class io.realm.RealmList
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBarDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBarDataSet: can't find referenced class io.realm.RealmList
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBarDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBarDataSet: can't find referenced class io.realm.DynamicRealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBarDataSet: can't find referenced class io.realm.RealmList
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBarDataSet: can't find referenced class io.realm.DynamicRealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBarDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBarDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBarDataSet: can't find referenced class io.realm.RealmList
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBarDataSet: can't find referenced class io.realm.DynamicRealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBarDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBarDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBubbleData: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBubbleData: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBubbleData: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBubbleData: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBubbleDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBubbleDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBubbleDataSet: can't find referenced class io.realm.DynamicRealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBubbleDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBubbleDataSet: can't find referenced class io.realm.DynamicRealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBubbleDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBubbleDataSet: can't find referenced class io.realm.DynamicRealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBubbleDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBubbleDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmBubbleDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmCandleData: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmCandleData: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmCandleData: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmCandleData: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmCandleDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmCandleDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmCandleDataSet: can't find referenced class io.realm.DynamicRealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmCandleDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmCandleDataSet: can't find referenced class io.realm.DynamicRealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmCandleDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmCandleDataSet: can't find referenced class io.realm.DynamicRealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmCandleDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmCandleDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmCandleDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmLineData: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmLineData: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmLineData: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmLineData: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmLineDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmLineDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmPieData: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmPieData: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmPieData: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmPieData: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmPieDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmPieDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmPieDataSet: can't find referenced class io.realm.DynamicRealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmPieDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmPieDataSet: can't find referenced class io.realm.DynamicRealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmPieDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmPieDataSet: can't find referenced class io.realm.DynamicRealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmPieDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmPieDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmPieDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmRadarData: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmRadarData: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmRadarData: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmRadarData: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmRadarDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmRadarDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmScatterData: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmScatterData: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmScatterData: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmScatterData: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmScatterDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmScatterDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmScatterDataSet: can't find referenced class io.realm.DynamicRealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmScatterDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmScatterDataSet: can't find referenced class io.realm.DynamicRealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmScatterDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmScatterDataSet: can't find referenced class io.realm.DynamicRealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmScatterDataSet: can't find referenced class io.realm.RealmObject
Warning:com.github.mikephil.charting.data.realm.implementation.RealmScatterDataSet: can't find referenced class io.realm.RealmResults
Warning:com.github.mikephil.charting.data.realm.implementation.RealmScatterDataSet: can't find referenced class io.realm.RealmObject
Warning:there were 283 unresolved references to classes or interfaces.
Warning:there were 2 unresolved references to program class members.
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForFreeRelease'.
> java.io.IOException: Please correct the above warnings first.
所以,問題似乎是我實現了資源庫。我讀過,我必須配置proguard-rules.pro文件,但我從來沒有使用過,並不知道語法。 我該如何解決這個問題?
EDIT 依賴關係:
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:recyclerview-v7:24.2.1'
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.bignerdranch.android:expandablerecyclerview:2.1.1'
compile 'com.github.lzyzsd:circleprogress:[email protected]'
compile 'com.github.PhilJay:MPAndroidChart:v2.2.3'
compile 'net.qiujuer.genius:ui:1.5.2'
compile 'com.akexorcist:RoundCornerProgressBar:2.0.3'
compile 'com.rengwuxian.materialedittext:library:2.1.4'
compile 'com.github.medyo:fancybuttons:1.8.1'
compile 'com.google.android.gms:play-services:9.6.1'
compile 'com.github.sundeepk:compact-calendar-view:1.9.3'
添加'build.gradle'的依賴部分。 –
@R.Zagórski我做編輯 – XxGoliathusxX
buildTypes { 發佈 調試的假 minifyEnabled假 proguardFiles getDefaultProguardFile( 'proguard的-android.txt'), 'proguard-rules.pro' } 調試{ 調試的真實 minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro' } } –