Tag Archives: Android studio

Android studio AAPT: error: attribute android:requestLegacyExternalStorage not found.

AAPT: error: attribute android:requestLegacyExternalStorage not found.
The SDK used in the project is 28. After updating the third-party SDK, the compiler will report an error.
Ā 
Solutions:
Set compileSdkVersion to 29.

https://blog.csdn.net/zqurapig/article/details/109474011
https://blog.csdn.net/itTalmud/article/details/107517449

The solution of Android package error

Before, when I was working on the company’s APP, the functions had been fully realized and it could also run normally on the mobile phone, but it kept reporting errors when packaging

\build\intermediates\res\ resources-anzhi-debug-ap_ ‘specified for property ‘resourceFile’ does not exist, so I found a lot of information on the web.
Some say that the version of SDK is lower than the version of ADT. It is suggested to upgrade the SDK version. Some say that an option of the Android Studio setting is removed.
Finally on the net or found a solution to the code, now record.
In fact, we only need to modify the build.gradle code

BuildTypes {
release {
does not display the LOG/* * * */confused
/* * * */

/minifyEnabled false Zipalign optimization * * * */
zipAlignEnabled true
Remove useless resource files/* * * */
shrinkResources true
proguardFiles getDefaultProguardFile (‘ proguard – android. TXT), ‘proguard – rules. Pro’
}
The debug {

minifyEnabled false shrinkResources false
proguardFiles getDefaultProguardFile (‘ proguard – android. TXT), ‘proguard – rules. Pro’

}}

ShrinkResources = false Release ShrinkResources = false Interested can go to the Internet to check the reason.

The Android packaging problem is solved.

It’s as simple as that.

Android studio reported an error in the release package: Lint found fatal errors while assembling a release target

Today, I upgraded Android Studio and found that the code can run, but there is an error in the release package. The error is as follows

Lint found fatal errors while assembling a release target.
To proceed, either fix the issues identified by lint, or modify your build script as follows:
...
android {
    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }
}

The error provides us with the above two kinds of repair way of version
a: repair
Lint to check out the problem 2: in the build of the module. The gradle add the following code, so you can ignore these problems, the normal packaging

android {
    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }
}

The second method is convenient, but it’s not recommended to ignore the problem, according to the website

In addition to testing the Android application to make sure it meets its functional requirements, you must also make sure that the code has no structural problems. Disorganized code affects the reliability and efficiency of an Android application and makes it harder to maintain the code.

Lint check problems is to prevent the above problems, so the way we use the following method to solve this problem
in the error above only hint Lint has a problem But didn’t tell me about any problem. Can use the android studio to see these errors

in the menu bar

can complete inspection can also specify folder check, click OK to wait for a while can see the test result, and then the error of the test results to solve can normal packing up

Reference links
https://developer.android.google.cn/studio/write/lint?hl=zh-CN

Android studio introduces code error, but it can run normally

I just encountered this problem because the computer monitor was black, so I directly shut down and restarted the project. After booting up, the AndroidStudio project could run normally, but many clearly existing classes were reported to introduce errors, causing various methods and classes to draw red lines, although they could run normally, but this has affected the normal development.
After searching on the Internet, I found several solutions and tried to find the most effective one:
1. Close AndroidStudio
2.
: : Users\WIN10\.AndroidStudio3.4

Android studio push project to GitHub

Introduction :Android Studio itself supports Github. So it’s easy to push direct code onto Github.

Prepare _ configuration account
Import the Git
Settings -> Version Control -> Set Git directory

Set up Github
After setting, click Test to Test.

Prepare 2_ create project
Create the As project

Create Github’s repository

Add Git management to the As project


Add the address of the Push
1. Right mouse button in the testProject created = “gitBash

Add Git management to files in your Git directory

Then commit

Then push


OK
If all goes well, you can see that the document was submitted successfully.

Android studio disable install run

Recently, I have been trying to access Tencent’s hot fix solution -Tinker in the project
After clone the sample on Github, I would like to run it on the virtual machine. The error is as follows:

Tinker does not support instant run mode, please trigger build by assembleDebug or disable instant run in 'File->Settings...'.

So go ahead and disable install Run,
Version information:

Android Studio 3.2
Build #AI-181.5540.7.32.5014246, built on September 18, 2018
JRE: 1.8.0_152-release-1136-b06 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.6

The menu bar – & gt; Android Studio -> The Preferences… -> Then it is shown as follows:

And then uncheck the red box,
apply -> ok
Finished!

Android studio “sync project with gradle files” button disappears

In the process of using Android studio today, I suddenly found a project error. The sync project button appeared and disappeared. My confusion was over.

1.Sync project with Gradle Files button disappears, app mark Red Cross

2. There is nothing in android project area, have I deleted modules?
?
?