-1
也許我試圖去純函數功能,但我發現添加scalaz 2.11-7.1.1到我的android應用程序在scala 2.11導致編譯時錯誤。起初,當我構建項目時,一切都編譯成功。當我將軟件包導出到Android時,然後出現編譯時錯誤,如「對象IO不是包scalaz.effect的成員。注意:類IO存在但它沒有伴隨對象」。 eclipse IDE自動完成scalaz.effect.IO對象,就在打包和安裝到模擬器時,我會遇到問題。AndroidProguardScala和Scalaz
這裏是代碼的例子,其中的Eclipse + Android的Proguard的斯卡拉插件顯示錯誤
def updateCredentials(response: AccountAuthenticatorResponse,
account: Account,
authTokenType: String,
options: Bundle): Bundle = scalaz.effect.IO({Log.v(OutlookAuthenticator.TAG, "updateCredentials()")}).map(_ => null).unsafePerformIO
就是Eclipse只是沒有得到RAM? scalaz包是不可能dex的?也許我應該放棄嘗試整合?
這是我的eclipse.ini文件
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140116-2212
--launcher.XXMaxPermSize
256m
-vmargs
-Xmx1048m
-Xms512m
-XX:MaxPermSize=512m
你的proguard配置是什麼? – drstevens 2014-11-22 18:31:05
僅包含scalaz_core時,我看到「無法排除錯誤」錯誤。我認爲這是因爲調用了IO的東西(即使是在調用scala.xml庫的scalaz_core中),這些調用最終都可用於JVM,但不一定在Dalvik中。我要關閉票。如果我需要他們,我會自己寫monads。 – DetriusXii 2014-11-23 18:23:43