2017-10-11 70 views
0

我想通過創建javax.money.CurrencyUnitjavax.money.RoundingContextBuilder的NoClassDefFoundError

public static CurrencyUnit getCurrency() { 
    return Monetary.getCurrency("IDR"); 
    } 

但是,我得到了錯誤:

java.lang.NoClassDefFoundError: 
    at javax.money.RoundingContextBuilder.<init> (RoundingContextBuilder.java:32) 
    at javax.money.RoundingContextBuilder.of (RoundingContextBuilder.java:77) 
    at javax.money.DefaultMonetaryRoundingsSingletonSpi$DefaultCurrencyRounding.<clinit> (DefaultMonetaryRoundingsSingletonSpi.java:266) 
    at javax.money.DefaultMonetaryRoundingsSingletonSpi.<clinit> (DefaultMonetaryRoundingsSingletonSpi.java:43) 
    at javax.money.Monetary.loadMonetaryRoundingsSingletonSpi (Monetary.java:125) 
    at javax.money.Monetary.<clinit> (Monetary.java:54) 
    at id.co.bippo.bidapplication.util.Utils.getCurrency (Utils.java:912) 

與規格的android: Asus ZenFone 5 (ASUS_T00F), 1024MB RAM, Android 4.3

gradle爲錢:

compile 'javax.money:money-api-bp:1.0.1' 
compile 'org.javamoney:moneta-bp:1.1' 

回答

0

嘗試使用此

compile group: 'javax.money', name: 'money-api', version: '1.0.1' 
compile group: 'org.javamoney', name: 'moneta-bp', version: '1.1' 
+0

謝謝你的關心,我會嘗試一下.. –

+0

謝謝你的關心,我會嘗試一下.. –

+0

我想'''錢-api-bp''',而不是'''money-api'''' @Anonymous –