2016-05-17 64 views
1

真當我在的build.gradle文件中添加minifyEnable:true釋放buildType,該應用程序崩潰與此日誌下:minifyEnabled:在發佈應用程序崩潰的支持V4

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.support.v4.view.ViewPager.getCurrentItem()' on a null object reference 
    at com.myapp.springindicator.SpringIndicator.createPoints(Unknown Source) 
    at com.myapp.springindicator.SpringIndicator.onLayout(Unknown Source) 
    at android.view.View.layout(View.java:16636) 
    at android.view.ViewGroup.layout(ViewGroup.java:5437) 
    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1735) 
    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1579) 
    at android.widget.LinearLayout.onLayout(LinearLayout.java:1488) 
    at android.view.View.layout(View.java:16636) 
    at android.view.ViewGroup.layout(ViewGroup.java:5437) 
    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1735) 
    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1579) 
    at android.widget.LinearLayout.onLayout(LinearLayout.java:1488) 
    ... 

有人能幫助我嗎?我已經在ProGuard的文件中添加了這個:

-keep class android.support.v4.app.** { *; } -keep interface android.support.v4.app.** { *; } -keep class android.support.v7.app.** { *; } -keep interface android.support.v7.app.** { *; }

我也跟上應用程序類嘗試

回答

3

-keep class android.support.** { *; }工作很適合我。

試試,因爲你只是只保留android.support.v4.app.下的類,並且在android.support.v4.view.

+0

右崩潰了!謝謝! – Rubber

+1

很高興聽到。接受答案也是值得的! = D –

+0

謝謝,它幫助xD – user25

相關問題