Strange exception encountered in android studio
Hi, everyone, I am a monkey who loves to eat bananas. When I was watching the project today, the studio strikes a problem that I haven’t encountered before. Record it
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
注: 某些输入文件使用了未经检查或不安全的操作。
注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
注: 某些消息已经过简化; 请使用 -Xdiags:verbose 重新编译以获得完整输出
I believe that many people have encountered this problem, but some compilation succeeded, a little failed, I am the latter.
Now write about my solution ideas:
- First of all, there was no problem with my project before, and now there is an exception. According to the information, it can be believed that it is a configuration problem or a cache problem.
- ./gradew clean ## invalid
- Invalidate cache / restart ## invalid
- Then, changing the api, changing the gradle version did not solve
- Because my studio version is 4.1, I guess it’s a new version of Yaomozi. After searching, I found it. It’s the cause of androidx. Because the new version does not support support, I need to change to androidx. Therefore, androidx must be disabled.
- Disable the two gradle.properties places: see the picture,
modify these two places, it is resolved
Because of the lack of in-depth experience of android studio, I deliberately wrote a record of android studio, and then write new discoveries later.
Code的搬运工V1.0
Use of Android Studio
- .gitignore
- Configuration (I will not explain one by one, I also use it on the basis of others' recommendation)
.gradle
.idea
.git
/local.properties
/.idea/workspace.xml
/.idea/libraries
/.idea
/.idea/codeStyleSettings.xml
/.idea/compiler.xml
/.idea/encodings.xml
/.idea/gradle.xml
/.idea/misc.xml
/.idea/modules.xml
/.idea/vcs.xml
.DS_Store
build
app/build
/captures
*.apk
*.ap_
*.dex
*.class
/bin/
/gen/
/proguard/
*.log
*.iml
.svn
/app/jdi_315303586
/projectFilesBackup
/Test
/app/.externalNativeBuild
- Memory modification
- Currently I am using this configuration
- studio64.exe.vmoptions
- Change download source
// 可以使用阿里云的仓库代替 google 和 jcenter
handler.maven { url 'https://maven.aliyun.com/repository/google' }
handler.maven { url 'https://maven.aliyun.com/repository/jcenter' }
handler.maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
- debugging
- Hierarchy view tools: Tools/Layout inspector
- Shortcut key: ctrl + shift + q (File structure defined by yourself)
Code的搬运工V2.0