Tag Archives: Android Studio Error

[Solved] Version 28 (intended for Android Pie and below) is the last version of the legacy support library

Error:

Version 28 (intended for Android Pie and below) is the last version of the legacy support library

 

Solution:

You need to migrate the principle support library to AndroidX and use implementation to add dependencies.

Step 1: Code Section

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.0'
    implementation 'androidx.percentlayout:percentlayout:1.0.0'
    testImplementation 'junit:junit:4.13.2'
}

Step 2: Migrate to AndroidX

image

image

image

Test, Launch succeeded, now the problem is solved.

image

[Solved] Android Studio Error: Could not initialize class com.android.sdklib.repository.AndroidSdkHandler

The new android studio (4.2) no longer supports the old one

com.android.tools.build:gradle:2.3.3

Now, some methods and classes will not be found.

 

Solution:

Go to build.gradle and replace this classpath with the latest version. It is best to also get the latest version of gradle and gradle wrapper. for example:

dependencies {
    classpath 'com.android.tools.build:gradle:4.2.1'
     
 
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

[Solved] Android Studio uses constraintlayout preview to prompt rendering sandbox error

This problem is mainly reported in my module project. It is normal for the main project to use constraint layout. I don’t know what bug. Just follow the prompts to modify it

error message

Rendering sandbox error
Property access not allowed during rendering   
    at java.lang.System.getProperties(System.java:718)   
    at com.intellij.idea.IdeaLogger.logErrorHeader   ... (IdeaLogger.java:110)

Solution:

Find the studio, click the idea. Properties file under the directory/bin, and add the following contents:

android.render.sandbox=false

Then restart Android studio to render the layout file normally for preview

[Mac] How to Solve Android Studio error: Unable to access Android SDK add-on list

 

 

Click Cancel directly to download the SDK automatically, which can solve the current problem and also solve the problem of SDK tools directory is missing

 

The problem of SDK tools directory is missing is similar to the following situation:

https://stackoverflow.com/questions/40326075/sdk-tools-directory-is-missing-when-launching-android-studio-on-my-mac

Proxy:

socks5h://127.0.0.1:1080

mirrors.neusoft.edu.cn

Android Studio Error: java.exe” finished with non-z [Solved]

E rror:Execution failed for task ‘: app:preDexDebug ‘.

> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘C:\Program Files\Java\jdk1.8.0_ 51\bin\java.exe” finished with non-zero exit value 1

 

This is caused by a duplicate jar package during compilation

Or your jar package and the system default are repeated. Delete the jar package one by one and debug it

Android Studio Error: Application Installation Failed…INSTALL_FAILED_INVALID_APK…

Android studio’s three mistakes come down to one

1. Pop up the window with the following error

Application Installation Failed…INSTALL_ FAILED_ INVALID_ APK…
WARNING: Uninstalling will remove the applation data:
Do you want to uninstall the existing applation?

2. Event log, the error is as follows

Session ‘app’: Error Installing APKs

3. Run, the error is as follows

Unknown failure (Failure – not installed for 0)
Error while Installing APKs

These three errors can be summed up in one, which also debugged for several hours for various searches. Finally, we found a way:

It can be solved in setting: File — > Settings

Android Studio Error:Unable to resolve dependency for ‘:app@debug/compileClasspath’

Unable to resolve dependency for ‘ :app@debug/compileClasspath ‘xxx

Wait a minute. I can’t get all my dependence

Then there was another toss, but fortunately, with the help of a noble person, a big man in the Android group sent a link, saying that I would try the method in this link

=reader_share&utm_source=qq

Well, that’s it. That’s the big man’s solution

The main reason is the use of proxy

systemProp.https.proxyHost=mirrors.neusoft.edu.cn
systemProp.http.proxyPort=80

This agent causes, so find the gradle.properties file in the. Gradle folder on Disk C: user/user name/directory, comment out prox and use it

## For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
#
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx1024m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#Mon Dec 10 12:56:38 CST 2018
#systemProp.http.proxyHost=mirrors.neusoft.edu.cn
#systemProp.https.proxyPort=80

As shown in the figure, the bottom two lines are annotated. Just try this one

OK! It’s done

Android Studio Error: Failed to delete some children. This might happen because a process has files open

   the error in build APK (s) is as follows:

Unable to delete directory 'F:\AndriodStudioProjects\EDM\app\build\outputs\apk\debug'
  Failed to delete some children. This might happen because a process has files open or has its working directory set in the target directory.
  - F:\AndriodStudioProjects\EDM\app\build\outputs\apk\debug\app-debug.apk

solution: close the folder of \… \ app/build/outputs/APK/debug