2015-12-14 35 views
1

誤差()我請以下在線168.-AndroidStudio 2.0預覽生成APK示出了從AudioPlayService類的onCreate上的Dalvik

line168- CustomAuxEffectStats aa = CustomAuxEffectStats.getInstance(); 
    if (aa == null) { 
     createCustomAuxEffect(); 
    } 

CustomAuxEffectStats接收機類

public class CustomAuxEffectStats implements Serializable { 
    private static CustomAuxEffectStats customAuxEffectStats = null; 
    public static int CustomPresetID = -100; 

    public static final int DEFAULT_BASS_BOOST_STRENGTH = 900; 

    private boolean isEnabled; 

    private int numBands; 
    private int actualNumPreset; 

    private short selectedPreset; 
    private short minBandLevel; 
    private short maxBandLevel; 
    private short bassboostStrength; 

    private short[] bandLevels; 

    private String[] bandFreq; 
    private String[] presetNames; 

    private CustomAuxEffectStats(short curPreset, String[] presetNamesArr, String[] bandFreqs, short[] bandLevelRange, short[] bandlevels, boolean isEnabled) { 
     this.isEnabled = isEnabled; 
     selectedPreset = curPreset; 

     minBandLevel = bandLevelRange[0]; 
     maxBandLevel = bandLevelRange[1]; 

     numBands = bandlevels.length; 

     bandFreq = bandFreqs; 

     actualNumPreset = presetNamesArr.length - 1; 
     CustomPresetID = presetNamesArr.length; 

     presetNames = presetNamesArr; 

     this.bandLevels = bandlevels; 
     bassboostStrength = 1000; 
    } 

    public static CustomAuxEffectStats getInstance() { 
     return customAuxEffectStats; 
    } 

    public static CustomAuxEffectStats createInstance(short curPreset, String[] presetNamesArr, String[] bandFreqs, short[] bandLevelRange, short[] bandlevels, boolean isEnabled) { 
     if (customAuxEffectStats == null) { 
      customAuxEffectStats = new CustomAuxEffectStats(curPreset, presetNamesArr, bandFreqs, bandLevelRange, bandlevels, isEnabled); 
     } 
     return customAuxEffectStats; 
    } 

    public boolean isEnabled() { 
     return isEnabled; 
    } 

    public void setEnabled(boolean isEnabled) { 
     this.isEnabled = isEnabled; 
    } 

    public int getNumBands() { 
     return numBands; 
    } 

    public void setNumBands(int numBands) { 
     this.numBands = numBands; 
    } 

    public short getSelectedPreset() { 
     return selectedPreset; 
    } 

    public void setSelectedPreset(short selectedPreset) { 
     this.selectedPreset = selectedPreset; 
    } 

    public short getMinBandLevel() { 
     return minBandLevel; 
    } 

    public void setMinBandLevel(short minBandLevel) { 
     this.minBandLevel = minBandLevel; 
    } 

    public short getMaxBandLevel() { 
     return maxBandLevel; 
    } 

    public void setMaxBandLevel(short maxBandLevel) { 
     this.maxBandLevel = maxBandLevel; 
    } 

    public short[] getBandLevels() { 
     return bandLevels; 
    } 

    public void setBandLevels(short[] bandLevels) { 
     this.bandLevels = bandLevels; 
    } 

    public String[] getBandFreq() { 
     return bandFreq; 
    } 

    public void setBandFreq(String[] bandFreq) { 
     this.bandFreq = bandFreq; 
    } 

    public static int getCustompresetid() { 
     return CustomPresetID; 
    } 

    public short getBassBoostStrength() { 
     return bassboostStrength; 
    } 

    public void setBandLevel(short band, short progress) { 
     bandLevels[band] = progress; 
    } 

    public short getbandLevel(short band) { 
     return bandLevels[band]; 
    } 

    public int getNumberOfPresets() { 
     return actualNumPreset; 
    } 

    public String[] getPresetNames() { 
     return presetNames; 
    } 

    public void setPresetNames(String[] presetNames) { 
     this.presetNames = presetNames; 
    } 

    public void setBassboostStrength(short bassboostStrength) { 
     this.bassboostStrength = bassboostStrength; 
    } 
} 

這總是崩潰上奇巧代碼(達爾維克運行時間)設備時,我運行我的應用程序。 但它在L +(ART)設備和仿真器中工作正常。

錯誤對數

FATAL EXCEPTION: main Process: com.newwave.musicsquare, PID: 26143 java.lang.VerifyError: com/newwave/musicsquare/audio/data/CustomAuxEffectStats at com.newwave.musicsquare.services.AudioPlayService.onCreate(AudioPlayService.java:168) at android.app.ActivityThread.handleCreateService(ActivityThread.java:2574) at android.app.ActivityThread.access$1800(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5113) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609) at dalvik.system.NativeStart.main(Native Method)

+0

看起來你發現了一個錯誤。 – Henry

+0

您是否使用multidex 65k支持? 檢查此問題:http://stackoverflow.com/q/668788/4596556 –

+0

我檢查了dex方法計數..它小於65K限制的一半。我不需要multidex支持 –

回答

0

所以我想出來.. 因爲我保持這種傳統的項目.. 序列化類CustomAuxEffectStats有很多的構造函數的參數是被造成的問題,大量的獲得者,制定者... 我刪除了方法,並使所有的字段級別。 刪除構造函數的所有參數... 一切工作正常。