Tag Archives: Android Studio Compile error

[Solved] Android Studio Compile Error: Could not determine java version from ‘11.0.8‘.

There are two solutions to solve Error: Could not determine java version from '11.0.8'.

Method 1: downgrade Android Studio and use the historical version of Android Studio environment;

Method 2: upgrade Gradle version;

1. Error reporting information


 

Open an old project and report the following error:

Could not determine java version from '11.0.8'.

The project uses Gradle version which is incompatible with Studio running on Java 10 or newer.
See details at https://github.com/gradle/gradle/issues/8431
Possible solution:
 - Upgrade Gradle wrapper to 4.8.1 version and re-import the project

Select the “menu bar/file/Project Structure” option,

Check that the Android Gradle plug-in version of the Android project is 3.2.0 and the Gradle version is 4.6. This is the version used a few years ago. At present, the project cannot be compiled using the latest Android studio;

 

 

 

 

2. Solution

Select the menu bar/file/project structure option,

In the pop-up project structure dialog box, update the Android gradle plug-in version to 4.2.1 and the gradle plug-in version to 6.7.1;

[Solved] Android Studio Compile Error: Execution failed for task ‘:APP_MIDI:lintVitalRelease‘.

1. Error reporting information

When compiling Android application, the following error is reported:

Execution failed for task ':app:lintVitalRelease'.
> Lint found fatal errors while assembling a release target.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

 

2. Solution

Method I

lint checks for errors, which are output in the build/reports/lint-results-release-fatal.xml file, and can be changed by changing the error message in the file to modify the syntax error;

Example of error message:

<?xml version="1.0" encoding="UTF-8"?>
<issues format="5" by="lint 4.1.0">

    <issue
        id="NotSibling"
        severity="Fatal"
        message="`@+id/button` is not a sibling in the same `RelativeLayout`"
        category="Correctness"
        priority="6"
        summary="Invalid Constraints"
        explanation="Layout constraints in a given `ConstraintLayout` or `RelativeLayout` should reference other views within the same relative layout (but not itself!)"
        errorLine1="        android:layout_below=&quot;@+id/button&quot;"
        errorLine2="        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="D:\Application\app\src\main\res\layout\activity_main.xml"
            line="836"
            column="9"/>
    </issue>

</issues>

Method II:

Configure in build.gradle to remove lint checks:

android{
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
}

Android Studio compile error: build tools is corrupt [Solved]

Error Messages:
Installed Build Tools revision 32.0.0 rc1 is corrupted. Remove and install again using the SDK Manager.
Problem Cause.
File corruption in buildTools after AndroidSutdio version upgrade.

Solution:
1 Modify d8.bat to dx.bat
2 Modify d8.jar to dx.jar

[Solved] Android Studio Compile error: Cannot use connection to Gradle distribution . as it has been stopped.

Article catalog

1、 Error message II. Solution

 

 

 

 

1、 Error message


 

Cannot use connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-5.6.4-all.zip' as it has been stopped.

 

 

 

 

2、 Solution


 

Occasional errors disappear after recompilation. This problem is encountered only once, and a record is made here;