In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Today, I will talk to you about how to update AndroidStudio3.0. Many people may not know much about it. In order to make you understand better, the editor has summarized the following for you. I hope you can get something according to this article.
Installation
If you click update from within Android Studio, you will jump to Android's website, where students without ladders can go to this site to download updates:
Problems encountered in the installation of Android Studio3.0 official Edition
1 、 Gradle Sync failed:
Gradle sync failed: Cause: com.android.build.gradle.api.BaseVariant.getOutputs () Ljava/util/List;Consult IDE log for more details (Help | Show Log) (8s 123ms)
In fact, it was not this fault at first, it was a fault of redownload at first, and then LZ deleted version 2.3, cleared the cache, and then became this mistake. Since there is a mistake, then solve it. Baidu has one. Let's take a look at the solution of stackoverflow.
This method really works for me, too. After downgrading ButterKnife, I became OK. If there is a better solution, you are welcome to send me a private message and give me a paid red packet. "the solution to one problem is to better meet the emergence of the next problem"-- Lu Xun
Solution 1: downgrade the dependent ButterKnife in the project to 8.4.0
Solution 2: reduce the gradle plugin version to 2.3.3 and recompile it (thank you here for being Xiao Hei Youth)
2 、 Unable to resolve dependency for:
At first glance, I thought that I did not rely on appCommon in setting.gradle. After reading it, I did, and this was an old project, which was normal in the AS2.3 version. Then I knew it was another pit, so I went to Internet again, and then I tried to add a preview node to buildTypes, as I said on the Internet, but it didn't work. I checked for a long time and still couldn't find a solution. Later, when I looked at this error message, I saw signingConfigs. I thought that there seemed to be such a node in gradle. With the attitude of trying, I deleted that node. Then, shit, it could be compiled successfully. Is there a rush to lie down and cross the hole? If there is a better solution, you are welcome to send me a private message and give me a red packet for a fee.
Solution: just delete the signingConfigs node in the project, and if you're worried about multi-channel packaging, use the packaging tool.
Here are some of the problems encountered by friends in the group:
3 、 app:transformDexArchiveWithExterLibsDexMergeForDebug
Solution: delete the .gradle directory from your computer (erase the gradle cache) and re-build.
Reference stackoverflow
The solution is detailed here.
4. Gradle packaging, custom apk name code error (Cannot set the value of read-only property 'outputFile')
Error: (56,0) Cannot set the value of read-only property 'outputFile' for ApkVariantOutputImpl_Decorated {apkData=Main {type=MAIN, fullName=debug, filters= []} of type com.android.build.gradle.internal.api.ApkVariantOutputImpl.Open File
Solution: modify the file name code, please write like this
Android.applicationVariants.all {variant-> variant.outputs.all {outputFileName = "xinlebao_$ {defaultConfig.versionName} _ ${releaseTime ()} .apk"}}
Solution: turn off APPT2 compilation in gradle.properties
5. AAPT2 compiler error AAPT2 error
The copy code is as follows:
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Solution: turn off APPT2 compilation in gradle.properties
Android.enableAapt2=false
Note: if the project is transferred from eclipse to as, there may be no gradle.properties file, please create it manually in the project root directory
6. Apt plug-in issues (Error:Cannot choose between the following configurations of project: mylibrary:)
Error:Cannot choose between the following configurations of project: mylibrary:- debugApiElements- debugRuntimeElements- releaseApiElements- releaseRuntimeElementsAll of them match the consumer attributes:
Solution: as follows
/ / 1. Delete classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'//2 from the build.gradle of project. Delete apply plugin: 'android-apt'//3. Change the dependencyapt 'com.jakewharton:butterknife-compiler:8.1.0'// in the build.gradle file of module to annotationProcessor' com.jakewharton:butterknife-compiler:8.1.0'
Well, these are some of the problems encountered in the recent update 3.0.
Android Studio 3.0
1. .gradle file
Wow, after the problem is solved, I want to create a new project quickly to see what has changed. The first big change is the .gradle file:
We can see that Google Dad "killed" the version of the buildToolsVersion build tool. In previous versions, buildToolsVersion would also bring a lot of mistakes to the project build, and now Google Dad has "killed" it; and the following dependency has been replaced with implementation, so what's the difference between it and compile? Don't worry, have a cup of tea and listen to me:
Compile and api
Api is completely equivalent to compile, and there is no difference between the two. As we all know, with the update of the Android version, there are many outdated classes and methods, and so is compile, and we can think of compile as the past tense of api.
Api and implementation
These two are new instructions in the AS3.0 version. Here is a picture to illustrate the difference between the two:
Picture reference
If you want to know more about it, please refer to the official
2. Support Kotlin
For those of you who are still learning the Kotlin language, AS3.0 supports converting Java code directly into Kotlin code. Let's take a look at this feature through a VCR:
In the java file, select the code you want to convert, and then select Code-- > Convert Java File to Kotlin File at the top to convert. After the conversion, this is a Kotlin file.
3. Logcat column
In several versions of AS, when Logcat was still Android Monitor, there were a lot of things, such as network, memory, CPU, and so on. In AS3.0, Google separated them, and Logcat was released separately. The previous one that looked at the network, memory, and CPU was brought out separately, a thing called Android Profiler:
Is it very handsome? it is said that this thing also has its own bag grabbing function (this is one of LZ's favorite features). It's just that it's off by default, and we have to turn it on manually. Go to Run-- > Edit Configurations and hook the following:
It should be noted that the API version of your project must be below API26, and your mobile phone version must be above Android5.0 to use the packet capture function. After opening it, let's grab a bag and try it:
When we initiate a network request on the phone, there will be an obvious change in the NETWORK column. When we select that area to grab the packet, we can see that an interface MainServlet is requested (if multiple interfaces are requested under this area, it will be listed one by one), and then we click MainServlet, and there will be information such as Json,Header sent from the background. How is it? is it cool? you don't have to bother to test to help you grab the bag any more. And you don't have to install any other software. CPU and MEMORY, too, have data that records the current page, and you can analyze them accordingly. These two will not be displayed. Interested students can update them and play by themselves. Finally, it is important to note that turning this on slows down the build speed of the application, so enable it only when you want to start profiling the application.
4. File Manager
In AS3.0, the file manager tool allows seamless interaction with your AS-connected phone, and you can view, copy and delete files on your device on AS3.0. This is useful when checking files created by an application or when talking about file transfer to a device:
Data/data/app_name/ contains data files for applications stored on internal storage sdcard/ contains user files (pictures, etc.) stored on external user storage
5. Support Java8
Similarly, students who like to write lambda also have benefits. This revision of AS supports Java8. You can directly format the Java code into lambda format, but you have to set your project to support Java8, right-click your module, select open Module Settings, and then follow the following settings:
In this way, you can use lambda expressions, and the system will automatically remind you where you can convert them to lambda expressions. Is that smart?
After reading the above, do you have any further understanding of how to update AndroidStudio3.0? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.