Default interface methods are only supported starting with Android N

后端 未结 10 1557
天命终不由人
天命终不由人 2020-11-27 10:17

I upgraded to android studio 3.1 and I\'m getting the following error:

Default interface methods are only supported starting with Android N (--min-api 24): vo         


        
10条回答
  •  天命终不由人
    2020-11-27 10:49

    You can resolve this issue by downgrading Source Compatibility and Target Compatibility Java Version to 1.8 in Latest Android Studio Version 3.4.1

    1. Open Module Settings (Project Structure) Winodw by right clicking on app folder or Command + Down Arrow on Mac

    2. Go to Modules -> Properties

    3. Change Source Compatibility and Target Compatibility Version to 1.8

    4. Click on Apply or OK Thats it. It will solve your issue.

    Also you can manually add in build.gradle (Module: app)

    android {
    ...
    
    compileOptions {
            sourceCompatibility = '1.8'
            targetCompatibility = '1.8'
        }
    
    ...
    }
    

提交回复
热议问题