V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
inoridream
V2EX  ›  Android

引用 okhttp3 后编译报错,请教诸位怎样解决

  •  
  •   inoridream · Apr 11, 2019 · 15319 views
    This topic created in 2585 days ago, the information mentioned may be changed or developed.
    implementation("com.squareup.okhttp3:okhttp:3.14.1")方式引用 okhttp3 后,执行编译,报错,内容如下:
    Caused by: com.android.builder.dexing.DexArchiveBuilderException: Failed to process D:\gradle\caches\modules-2\files-2.1\com.squareup.okhttp3\okhttp\3.14.1\67612a22d4b8f33c55263b188bf5a72774d06d18\okhttp-3.14.1.jar

    Caused by: com.android.builder.dexing.DexArchiveBuilderException: Error while dexing.

    Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete

    Caused by: com.android.tools.r8.utils.AbortException: Error: Static interface methods are only supported starting with Android N (--min-api 24): okhttp3.Request okhttp3.Authenticator.lambda$static$0(okhttp3.Route, okhttp3.Response)

    3 replies    2019-04-11 14:33:40 +08:00
    unco020511
        1
    unco020511  
       Apr 11, 2019
    使用 jdk8
    inoridream
        2
    inoridream  
    OP
       Apr 11, 2019
    compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
    }
    qianji201712
        3
    qianji201712  
       Apr 11, 2019
    一楼正解
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   906 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 21:30 · PVG 05:30 · LAX 14:30 · JFK 17:30
    ♥ Do have faith in what you're doing.