【发布时间】:2018-04-09 00:41:15
【问题描述】:
使用 sbt android:run 在模拟器中运行我的 android 应用程序时遇到以下异常:
Uncaught translation error: com.android.dx.cf.code.SimException: default or static interface method used without --min-sdk-version >= 24
不用说,我正在使用 Scala/SBT 并且对 android 领域是全新的。
我已经尝试了所有我能找到的解决方案,比如使用最新版本的 guava:
"com.google.guava" % "guava" % "23.2-android"
或开启multidex:
dexMulti in Android := true
这就是我的 build.sbt 的样子:
name := "Scala1"
version := "0.0.1"
scalaVersion := "2.12.3"
platformTarget := "android-26"
javacOptions in Compile ++= "-source" :: "1.8" :: "-target" :: "1.8" :: Nil
enablePlugins(AndroidApp)
dexMulti in Android := true
minSdkVersion in Android := "24"
libraryDependencies ++= Seq(
"com.android.support" % "appcompat-v7" % "24.0.0",
"com.google.guava" % "guava" % "23.2-android")
// libraryDependencies ++= Seq(
// "com.android.support" % "appcompat-v7" % "24.0.0"
// )
// Enable proguard and link it to the config file 'proguard-project.txt'
proguardOptions in Android ++= io.Source.fromFile("proguard-project.txt").getLines.toSeq
非常感谢任何形式的帮助。
【问题讨论】: