2017-10-27 4 views
0

エミュレータでAndroidアプリケーションを実行しているときに次の例外が発生します。実行::私はアンドロイドアリーナにスカラ座/ SBTと全く新しいを使用していますと言って未知の翻訳エラー:com.android.dx.cf.code.SimException:--min-sdk-version> = 24なしで使用されるデフォルトまたはスタティックインターフェイスメソッド

Uncaught translation error: com.android.dx.cf.code.SimException: default or static interface method used without --min-sdk-version >= 24 

言うまでもなくSBTのアンドロイドを使用して。

"com.google.guava" % "guava" % "23.2-android" 

または上multidexを回す:

dexMulti in Android := true 

これはどのように私のビルドされ

私はグアバの最新バージョンを使用してのように見つけることができるすべてのソリューションを試してみました。 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 

どんな種類の助けでも大歓迎です。

答えて

0

build.sbt 1.7でJavaソースとターゲットバージョンの両方を変更する必要がありました:

javacOptions in Compile ++= "-source" :: "1.7" :: "-target" :: "1.7" :: Nil 

それは今、魔法のように動作します。

関連する問題