Wrong Java Compiler When Including a Java Module as Dependency in Android Studio

前端 未结 2 630
独厮守ぢ
独厮守ぢ 2021-01-04 06:49

I have a java module in my Android Studio project that is a dependency of an Android module. I am having problems on build with the following exception appearing.

         


        
2条回答
  •  清歌不尽
    2021-01-04 07:44

    So I have found the solution at this blog post.

    The trick is in your Java Library module's build.gradle file you need to include the following.

    apply plugin: 'java'
    sourceCompatibility = 1.6
    targetCompatibility = 1.6
    

    This will then work.

提交回复
热议问题