Summary and solution of problems after upgrading Android studio 3.3

1. The solution that the project cannot be opened when it is opened

Several types of such problems have been found so far.

The first category is that the compilation fails.
1. Build configuration error
At this time, you need to check the relevant information of the build window, and track and locate according to the error information.
Some problems can be traced through the window in the figure
Currently, there are errors encountered. The gradle version is lower than the version required in Android studio. To
solve the problem of the gradle version before upgrading, modify the two red lines in the figure. File
insert image description here
gradle-wrapper.properties

distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

The version number of build.gradle (under the project directory) is the version number of your Androidstudio

        classpath 'com.android.tools.build:gradle:3.3.1'

2. Errors in resource files and code files.
After updating the IDE version, I found that sometimes when errors occurred in my program or layout files (mostly resource references do not exist), the corresponding files did not have a red underline prompt, and these errors would cause compilation failures. pass. This type of error can be viewed on the command line as shown in the figure.
Click the button pointed by the red arrow to display the build command line, which will record the information during the build process, including warnings and errors of course.  Resource reference errors will be pointed out here
The second type, there is a problem with synchronization

1. Sync is stuck in read from cache, unable to debug and run the application on the phone.
insert image description here
First, I tried clean rebuild and other operations. Before the compilation did not report an error, it became a compilation error. After locating the resource file and modifying it, repeat it, and there are still problems. At this point build has no problem

After referring to
the solution in https://stackoverflow.com/questions/54586363/android-studio-3-3-stuck-at-project-setupreading-from-cache, put all the files in the .gradle/caches/ directory Delete, restart Android studio, solved
On macOS/Linux: $HOME/.gradle/caches/
On Windows: %USER_HOME%.gradle/caches/
(19.3.15 update) ------------ ----------------------start--------------------------- ---
also try
Click on the option indicated by the arrow

2. The compilation error Could not find com.android.tools.lint:lint-gradle:26.3.1.
The next day, there will be new problems and it cannot run. I really want to complain about the error checking of the new version of Android studio.
The solution stackoverflow
checks whether google() is missing in the build.gradle of the project directory.
If it is missing, add this statement.
After adding, it looks like the following, note that google() should be placed before jcenter() , refer to the comments in this article

buildscript {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
}

(19.3.15 update) -----------------------------------end--------- ---------------------

2. In the USB debugging mode of the mobile phone, the computer can recognize the problem, but the Android studio does not recognize the problem (non-port occupation problems such as missing dll files)

Make a good record here. I have encountered such problems before. It may be that the proprietary port 5037 of adb is occupied by other programs. Use
win+R to call the command line input

netstat -ano|findstr "5037"

Find the program that occupies the adb port and end it through the task manager

But the problem here is not here, so it doesn't work

The api-ms-win-crt-locale-L1-1-0.DLL file appears to be missing when running adb . After downloading the relevant files from the Internet and placing them in the specified directory, an error 0xc000007b is reported again . After searching online, it is said that there is a lack of directX or C++ Redistributable Package.
So downloaded the directx fix . If it is not solved by this procedure, you can browse the solution to 0xc000007b (continued) . The author of this article is also the author of the repair tool. Note that not only games, as long as similar problems occur in applications, you can refer to the above solutions.

Guess you like

Origin blog.csdn.net/fighting_2017/article/details/88554381