Tag Archives: AS

[Solved] AndroidStudio Error: checkDebugAarMetadata & CheckAarMetadataWorkAction

Description

Execution failed for task ':app:checkDebugAarMetadata'.

> Multiple task action failures occurred:

   > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction

      > The minCompileSdk (31) specified in a

        dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)

        is greater than this module's compileSdkVersion (android-30).

        Dependency: androidx.recyclerview:recyclerview:1.3.0-alpha02.

If you upgrade to compilesdk 31 according to the prompt, you are faced with a large number of Android 12 and below are not available, and upgrade the current jdk8 to jdk11 or above, but the set of source code was still available more than 2 months ago. Now it is not available for no reason, which is not in line with the routine.

If the current compilesdk is kept at 30 or 28, gradle compiles and passes, but the above error is reported when running debugging.

I can’t understand it.

Solution:

Take the following three steps to finally solve the problem
1. keep the current compilesdk at 30 or 28.

2. lower the corresponding version number of dependent components, such as dependency: Android. Recyclerview: recyclerview: 1.3.0-alpha02. Change the original version number of the corresponding gradle file from 1. + to 1.2. +, that is, lower the version number by one. Shape such as

The original gradle file is implementation 'androidx.recyclerview:recyclerview:1.+'// means 1.xx latest version, maybe 1.0, 1.1, 1.2, 1.3, 1.4, 1.5 in that order

Now read
implementation 'androidx.recyclerview:recyclerview:1.2.+'// means 1.2.xx latest version, maybe 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5 in that order

3. After recompiling, debug and run again, and the prompt of the dependent component does not appear again, indicating that the modification is effective. By analogy, reduce the version number of other dependent components until similar prompt no longer appears, and the problem is solved.

Error: not found; no service started

Sometimes it’s a headache to report an error. If you have a problem with your own code, you can still solve it. However, if there is a problem with the as tool, it’s embarrassing!
I’ve heard that as2.3 has its own bug before, but I haven’t encountered it. Fortunately, I did today! All kinds of search information, over the wall!
The error is as follows:

Starting service: Intent 
{ act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] 
cmp=com.xxx.xxx.constrain/com.android.tools.fd.runtime.InstantRunService }
Error: Not found; no service started.

Solution:
first, simply and crudely re install as2.3 (I use version 2.3)
Second, upgrade as in the case of upgrade. At present, my as is upgraded from 2.3 to 2.3.1
and above, and all the problems can be solved

AAPT: error: resource android:attr/colorError not found.

As error:

AAPT: error: resource android:attr/colorError not found.

Solutions:
1 build.gradle Set as follows:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "29.0.2"

    defaultConfig {
        applicationId "com.lgl.answersystem"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
    }

Later, an error was reported

AAPT: error: resource android:attr/dialogCornerRadius not found.

terms of settlement:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    buildToolsVersion "29.0.2"

    defaultConfig {
        applicationId "com.lgl.answersystem"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
    }

Perfect solution Error:Execution failed for task ‘: APP:transformClassesWithDexForDebug ‘… Problem

believe that everyone in the Android development can not avoid to be integrated in the process of the third party after a project, integration, sometimes it will encounter this ash often hate transformClassesWithDexForDebug, detailed Log is as follows:


Error:Execution failed for task ':APP:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException

The main reason for this problem is that the introduction of Libary overlaps with some Libs in existing projects. Please check in detail and make sure that there is only one copy of lib in use, such as v4, v7, utdid.jar, etc.

if you use other android’s official support library see, http://developer.android.com/tools/support-library/features.html

if there is still a problem after the above situation check, you can try to use the following configuration to solve the problem

defaultConfig {
    ...
    minSdkVersion 14
    targetSdkVersion 21
    ...

    //Enabling multidex support.
    multiDexEnabled true
}
dependencies {
    compile ´com.android.support:multidex:1.0.1´
}


and then in the manifest we introduce this, if there is a custom AppApplication, let your own AppApplication inherit this class

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.android.multidex.myapplication">
    <application
        ...
        android:name="android.support.multidex.MultiDexApplication">
        ...
    </application>
</manifest>

may also be a JDK version 1.8 problem, which is not an accident, so suspect that Gradle has compatibility problems with JDK 1.8 and try to reduce the number of JDK dependencies to 1.7

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_7
    targetCompatibility JavaVersion.VERSION_1_7
}

can be run or there will be errors after the configuration is completed, so we can also add this sentence in app.bulid and re-run after that. The specific amount or 4g can be seen from the computer configuration modification (2g, 3g, 6g, 8g).

dexOptions {
    javaMaxHeapSize "4g"
}

the above is the Error: I met in the Execution failed for task ‘: APP: transformClassesWithDexForDebug’ all solutions, sharing out hope to help everyone.


android studio Error Gradle project sync failed. Please fix your project and try again

  • Android Studio may report Gradle project sync failed. Please fix your project and try again, the reason should be that some of the Gradle items are not properly configured.

  • open File – >

  • the two versions must be locally available, and must be compatible. How do you know if you have them locally?The following 2 pictures show their respective paths.


(gradle\m2repository\com\ Android \tools\build\gradle)


(the default path for Windows is in C:\Users\ administrator.gradle \wrapper\ covariance)

If the following packets cannot be downloaded, you must manually download them by following the value of the distributionUrl property in the gradle\wrapper\gradle-wrapper.properties file under the current project.

  • the synchronized

  • you can now run the project.