java.lang.NullPointerException (no error message) APK building

前端 未结 6 1598
隐瞒了意图╮
隐瞒了意图╮ 2021-02-19 08:44
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        maven {
            url \"h         


        
相关标签:
6条回答
  • 2021-02-19 08:51

    see this other issue : while this is stated in Retrolambda documentation you should not specify JAVA version to 1.8 while using Retrolambda. Therefore setting jack support to true should not be required anymore. This worked for me.

    0 讨论(0)
  • 2021-02-19 08:54

    I have had the same kind of problem these days. I found it might be caused by the version of gradle. After changing the version to 2.1.0, the problem's gone.

    dependencies {
            classpath 'com.android.tools.build:gradle:2.1.0'
        }
    

    I'm not sure it works for you.

    0 讨论(0)
  • 2021-02-19 08:58

    Just Delete your project under contains .gradle folder and restart android studio. it tested by and approve by google developer pages. It 100% working.

    0 讨论(0)
  • 2021-02-19 09:05

    Add this to your app module's build.gradle file:

    lintOptions {
        checkReleaseBuilds false
    }
    
    0 讨论(0)
  • 2021-02-19 09:07

    Android compiles by default with Java 7 but your project might be using some Java 8 features. If you recently switched from Oracle JDK to Open JDK, make sure you are using Java 8. In your terminal, if you run java -version, the output should be something like:

    openjdk version "1.8.0_222"
    OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_222-b10)
    OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.222-b10, mixed mode)
    
    0 讨论(0)
  • 2021-02-19 09:08

    I had the same issue after adding:

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    

    It was because my default java version was 10:

    $ java -version
    java version "10.0.1" 2018-04-17
    

    After changing to 1.8 (with sudo update-alternatives --config java) issue was fixed.

    0 讨论(0)
提交回复
热议问题