栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

Android Studio - 北极狐 | 2020.3.1 补丁 3 现已推出

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Android Studio - 北极狐 | 2020.3.1 补丁 3 现已推出

2021 年 10 月 11 日,星期一

Android Studio - 北极狐 | 2020.3.1 补丁 3 现已在稳定频道中提供。


如果您已经在稳定频道上安装了 Android Studio 版本,则 可以通过单击 帮助 > 检查更新 (Android Studio > 检查更新 在 macOS 上)来获取更新。否则,您可以 在此处下载。
 

一般修复和功能

此更新包括对以下问题的修复:

Android Gradle 插件
  • 问题 #198453608:lint 独立插件无法正确处理 gradleApi() 依赖项 
    * What went wrong:
    Execution failed for task ':buildSrc-tests:lintAnalyze'.
    > Don't know how to handle ComponentIdentifier 'Gradle API'of type class org.gradle.internal.component.local.model.OpaqueComponentIdentifier
    
    * Try:
    Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    
    * Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':buildSrc-tests:lintAnalyze'.
    Caused by: java.lang.RuntimeException: Don't know how to handle ComponentIdentifier 'Gradle API'of type class org.gradle.internal.component.local.model.OpaqueComponentIdentifier
    	at com.android.build.gradle.internal.ide.dependencies.ResolvedArtifact.computeModelAddress(ResolvedArtifact.kt:167)
    	at com.android.build.gradle.internal.lint.LintDependencyModelBuilder.addArtifact(LintDependenciesModelBuilder.kt:70)
    	at com.android.build.gradle.internal.ide.dependencies.ArtifactDependencyGraph.createDependencies(ArtifactDependencyGraph.java:91)
    	at com.android.build.gradle.internal.lint.ArtifactInput.computeDependencies$gradle_core(AndroidLintInputs.kt:1590)
    	at com.android.build.gradle.internal.lint.AndroidArtifactInput.toLintModel$gradle_core(AndroidLintInputs.kt:1298)
    	at com.android.build.gradle.internal.lint.VariantInputs.toLintModel(AndroidLintInputs.kt:922)
    	at com.android.build.gradle.internal.lint.AndroidLintAnalysisTask.writeLintModelFile(AndroidLintAnalysisTask.kt:136)
    	at com.android.build.gradle.internal.lint.AndroidLintAnalysisTask.doTaskAction(AndroidLintAnalysisTask.kt:122)
    	at com.android.build.gradle.internal.tasks.NonIncrementalTask$taskAction$$inlined$recordTaskAction$1.invoke(baseTask.kt:66)
    	at com.android.build.gradle.internal.tasks.Blocks.recordSpan(Blocks.java:51)
    	at com.android.build.gradle.internal.tasks.NonIncrementalTask.taskAction(NonIncrementalTask.kt:98)
  • 问题 #183632446:当 Gradle 构建在 Studio 之外运行时触发 JPS 构建
    Created issue.
    importANT: Please read
    https://developer.android.com/studio/report-bugs.html carefully and supply
    all required information.
    
    Studio Build: 4.3.1, 4.2.0 Beta06, 4.3.0 Alpha 11
    Version of Gradle Plugin: 4.3.1, 4.2.0-beta06, 7.0.0-alpha11
    Version of Gradle: 683
    Version of Java: Java 8, and then Java 15
    OS: Mac OS 11.2.3
    
    I have tried all possible ways to tackle this issue.
    And I've looked at any previous issues, resolutions, stackoverflow advises, you name it.
    
    Here are all the cases I've tried, no success whatsoever:
    - https://stackoverflow.com/questions/66439933/classes-jar-already-contains-entry-meta-inf-module-name-debug-kotlin-module
    - https://discuss.kotlinlang.org/t/running-into-issue-with-entry-name-meta-inf-module-build-type-kotlin-module-collided/19690
    - https://github.com/Kotlin/kotlinx.coroutines/issues/1064#issuecomment-742172419
    
    I've tried below, and then replaced with pickFirst(), still an issue:
    packagingOptions {
        exclude "meta-INF/*.kotlin_module"
        exclude "meta-INF/rxkotlin.properties"
        exclude "meta-INF/rxkotlin_main.kotlin_module"
        exclude "meta-INF/kotlinx-io.kotlin_module"
        exclude "meta-INF/atomicfu.kotlin_module"
        exclude "meta-INF/kotlinx-coroutines-io.kotlin_module"
        exclude "meta-INF/rxkotlin.properties"
        exclude "meta-INF/rxkotlin_main.kotlin_module"
      }
    
    Attached is a simple project which fails and logs the error.
    
    I've tried to make the sample as dummy as possible.
    It just includes references between `library modules`, `kotlinx serialization` and `coroutines`, to replicate the issue in my real project.
    
    When you open the sample for the first time, it will most likely work.
    
    Please close it at least once, and after opening, make sure you:
    - Sync project with Gradle files
    - Build > Clean project
    
    In the 2nd or 3rd attempt after restarting the project, you will start seeing the error when trying to compile.
    And from there onwards, every compilation fails. Cleaning, restarting, wiped `.gradle` cache, even under my mac folder.
    Still happily failing.
  • 问题 #198667126:在包含生成源的处理器的项目中同时启用 KSP 和 Kapt 会破坏 BundleLibraryClassesInputs 
    Created issue.
    DESCRIBE THE ISSUE IN DETAIL: Having multiple tasks/dirs contributing meta-INF/proguard directories appears to break BundleLibraryClassesInputs
    
    STEPS TO REPRODUCE:
    
    Enable KSP and Kapt in a project
    Add some auto-value-moshi classes for kapt code gen and plain kotlin data classes using @JsonClass(generateAdapter = true) for use with moshi-ksp code gen
    Run the bundleLibRuntimeToDirRelease task and observe this failure
    [2021-08-28T01:45:53.750Z] FAILURE: Build failed with an exception.
    
    [2021-08-28T01:45:53.750Z] 
    
    [2021-08-28T01:45:53.750Z] * What went wrong:
    
    [2021-08-28T01:45:53.750Z] Execution failed for task ':libraries:model:bundleLibRuntimeToDirRelease'.
    
    [2021-08-28T01:45:53.750Z] > A failure occurred while executing com.android.build.gradle.internal.tasks.BundleLibraryClassesWorkAction
    
    [2021-08-28T01:45:53.750Z]    > /mnt/tmp/android-dev/libraries/model/build/intermediates/runtime_library_classes_dir/release/meta-INF/proguard
    
    ...
    
    [2021-08-28T01:45:53.760Z] Caused by: java.nio.file.DirectoryNotEmptyException: /mnt/tmp/android-dev/libraries/model/build/intermediates/runtime_library_classes_dir/release/meta-INF/proguard
    
    [2021-08-28T01:45:53.760Z] 	at com.android.utils.FileUtils.copyFile(FileUtils.java:151)
    
    [2021-08-28T01:45:53.760Z] 	at com.android.utils.FileUtils.copyFile(FileUtils.java:133)
    
    [2021-08-28T01:45:53.761Z] 	at com.android.utils.FileUtils.copyFile(FileUtils.java:116)
    
    [2021-08-28T01:45:53.761Z] 	at com.android.build.gradle.internal.tasks.BundleLibraryClassesWorkAction.copyFilesNonIncrementally(BundleLibraryClasses.kt:372)
    
    [2021-08-28T01:45:53.761Z] 	at com.android.build.gradle.internal.tasks.BundleLibraryClassesWorkAction.run(BundleLibraryClasses.kt:315)
    
    [2021-08-28T01:45:53.761Z] 	at com.android.build.gradle.internal.profile.ProfileAwareWorkAction.execute(ProfileAwareWorkAction.kt:74)
    In some testing with Ivan to print the classes property in a doFirst block
    
    build/intermediates/javac/release/classes - no meta-INF/proguard dir
    build/tmp/kotlin-classes/release - no, only containing a meta-INF/... .kotlin_module  file
    build/tmp/kapt3/classes/release - yes, containing generated proguard files for moshi
    build/generated/ksp/release/resources - yes, containing generated proguard files for moshi
    the build/intermediates/runtime_library_classes_dir/release/meta-INF/proguard dir it's complaining about not being empty only contains the kapt-generated proguard files though, interestingly. This is also the case without KSP too (not empty)
    
    Studio Build: N/A
    Version of Gradle Plugin: 7.0.2
    Version of Gradle: 7.2
    Version of Java: 16.0.3
    OS: macOS Big Sur
C++ 编辑器
  • 问题 #197323118:UI 因后台长时间的 JniReferencesSearch 计算而冻结
    Created issue.
    Android Studio performance is very slow.
    The caret freezes almost every time anything is written and debug mode is simply not usable (sometimes it takes minutes just to evaluate simple expressions).
    
    All actions taken in AS are slow and take many seconds to respond.
    
    Build: AI-203.7717.56.2031.7621141, 202108071636,
    
    AI-203.7717.56.2031.7621141, JRE 11.0.10+0-b96-7281165x64 JetBrains s.r.o., OS Mac OS X(x86_64) v11.5.2, screens 3584.0x2240.0, 1920.0x1080.0; Retina
    
    AS: Arctic Fox | 2020.3.1 Patch 1; Kotlin plugin: 203-1.5.21-release-328-AS7717.8; Android Gradle Plugin: 7.0.1; Gradle: 7.0.2; Gradle JDK: version 11.0.10; NDK: from local.properties: (not specified), latest from SDK: (not found); LLDB: pinned revision 3.1 not found, latest from SDK: (package not found); CMake: from local.properties: (not specified), latest from SDK: 3.10.2, from PATH: 3.19.3Source: user_sentiment_feedback
    
    importANT: Please read https://developer.android.com/studio/report-bugs.html carefully and supply all required information.
数据库检查员 
  • 问题 #161081452:允许保存数据库
    Created issue, assigned to jg...@google.com.
    Allow users to dump data, from cache of in-memory DBs or on-device DBs, to DB/CSV file
  • 问题 #195968515:无法使用应用程序检查/数据库检查器导出数据,路径中有空格
    Created issue.
    Hi,
    
    I cannot export data using the Database Inspector. Android Studio gives the following error message:
    
    Issue while exporting data: Cannot run program "C:UsersSebastian": CreateProcess error=193, %1 ist keine zulässige Win32-Anwendung
    
    (the last part translates to "%1 is not a valid Win32-Application")
    
    In the database inspector, I can see all the data from the database fine. only exporting does not work.
    
    The AS logs show this:
    
    2021-08-10 12:26:54,426 [1122447]   INFO - lite.cli.SqliteCliProviderImpl - Checking C:UsersSebastian OltmannsAppDataLocalAndroidSdkplatform-toolssqlite3.exe for sqlite3
    2021-08-10 12:26:54,426 [1122447]   INFO - lite.cli.SqliteCliProviderImpl - Located sqlite3 under C:UsersSebastian OltmannsAppDataLocalAndroidSdkplatform-toolssqlite3.exe
    2021-08-10 12:26:54,440 [1122461]   INFO - sqlite.cli.SqliteCliClientImpl - Executing external command C:UsersSebastian OltmannsAppDataLocalAndroidSdkplatform-toolssqlite3.exe with arguments [.open 'C:UsersSebastian OltmannsAppDataLocalGoogleAndroidStudio2020.3database-inspectordatadata...mypackagename...databasesdatabase', PRAGMA wal_checkpoint(TRUNCATE);, .quit]
    2021-08-10 12:27:03,934 [1131955]   INFO -               NativeSymbolizer - Creating a native symbolizer. Executable path: C:Program FilesAndroidAndroid Studiobinlldbbinllvm-symbolizer.exe
    2021-08-10 12:27:50,896 [1178917]   INFO - .script.IdescriptEngineManager - javax.script.scriptEngineManager initialized in 59 ms
    2021-08-10 12:27:54,688 [1182709]   INFO - j.ide.actions.RevealFileAction - Exit code 1
    
    I strongly believe that this comes from the fact that the path of the sqlite executable contains a blank space. When running the command without and with quotes in the commandline, a similar error occurs when running without quotes, and it works when running with quotes. (see image)
    
    I guess one could reproduce this putting the SDK in a location that contains a blank space?
    
    Thank you.
    
    AS Information:
    
    Build: AI-203.7717.56.2031.7583922, 202107261959,
    
    AI-203.7717.56.2031.7583922, JRE 11.0.10+0-b96-7249189x64 JetBrains s.r.o, OS Windows 10(amd64) v10.0 , screens 1920.0x1080.0
    
    AS: Arctic Fox | 2020.3.1; Kotlin plugin: 203-1.5.21-release-328-AS7717.8; Android Gradle Plugin: 7.0.0; Gradle: 7.0.2; Gradle JDK: version 11; NDK: from local.properties: (not specified), latest from SDK: (not found); LLDB: pinned revision 3.1 not found, latest from SDK: (package not found); CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: (not found)
德克塞尔 (D8) 
  • 问题 #197625454:Java lambda 在子类化类时导致意外行为 
    Created issue.
    Build: AI-203.7717.56.2031.7621141, 202108071636,
    
    AI-203.7717.56.2031.7621141, JRE 11.0.10+0-b96-7281165x64 JetBrains s.r.o., OS Mac OS X(x86_64) v11.5.1, screens 2560.0x1440.0, 3584.0x2240.0; Retina
    
    AS: Arctic Fox | 2020.3.1 Patch 1; Kotlin plugin: 203-1.5.21-release-328-AS7717.8; Android Gradle Plugin: 7.0.1; Gradle: 7.0.2; Gradle JDK: version 11.0.10; NDK: from local.properties: (not specified), latest from SDK: (not found); LLDB: LLDB 3.1 (revision: 3.1.4508709); CMake: from local.properties: (not specified), latest from SDK: 3.18.1-g262b901, from PATH: (not found)
    
    TL;DR: when using lambdas in a base class and a child class, if the class names and methods are the same, running a lambda in the base class invokes the lambda in the child class.
    
    Example base class com.example.myapplication.utils.MyKlaus:
    
    package com.example.myapplication.utils;
    
    import android.util.Log;
    
    public abstract class MyKlaus {
      public Runnable r;
      public void myMethod() {
        r = () -> Log.e("MyKlausbase", getString());
      }
      public abstract String getString();
    }
    
    Example child class com.example.myapplication.MyKlaus:
    
    package com.example.myapplication;
    
    import android.util.Log;
    
    public class MyKlaus extends com.example.myapplication.utils.MyKlaus {
    
      @Override
      public void myMethod() {
        super.myMethod();
        if (Math.random() < 0) {  // always false
          Runnable local = () -> Log.e("MyKlausChild", getString());
        }
        r.run();
      }
    
      @Override
      public String getString() {
        return "foo";
      }
    }
    When invoking com.example.myapplication.MyKlaus().myMethod(), it is expected that E/MyKlausbase: foo would be printed to log, whereas E/MyKlausChild: foo is actually printed.
    
    In other words invoking the lambda of the base class executes a lambda in the child class that is placed in a condition that is always false and is never invoked directly.
    
    I noticed the following regarding this issue:
    
    I tried to reproduce it in a plain (non-android) java8 project - doesn't happen.
    I tried to reproduce it in a Kotlin class - doesn't happen.
    If the class name of the parent/child isn't the same - doesn't happen
    if the method name of the parent/child isn't the same - doesn't happen.
    if the lambda doesn't reference the abstract method - doesn't happen.
    My guess right now is that during desugaring, the lambda name isn't fully qualified (so it's just lambda$methodName$number$simpleClassName), so the child lambda can "override" the base class lambda during compilation.
    
    I've tried searching for a similar issue in the tracker, didn't find anything.
    
    Attaching a toy project that reproduces the issue.
收缩器 (R8)
  • 问题 #197754200:在 r8 缩小期间出现“无法约束类型”错误 
    Created issue, assigned to an...@google.com.
    Recently we have upgraded Android Gradle Plugin from 4.2.2 to 7.0.0 and switched from using r8 2.0.99 to the one that comes with AGP 7.0.0.
    
    However we encountered following error when trying to build 'release' variant of our app. We use following r8 related options for our 'release' variant:
    
    minifyEnabled true
    shrinkResources true
    We tried several r8 versions, including 3.0.47 and 3.0.65, but the error persists.
    
    We generated a compiler-input dump according to this manual that reproduces the error. We will be happy to share the compiler-input dump with r8 team privately.
  • 问题 #200057495:执行 R8 3.0.69(来自 AGP 7.0.2)和 3.0.72 时出现问题​​​​​​​
    Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, position: Lio/netty/handler/codec/DefaultHeaders;equals(Ljava/lang/Object;)Z, origin: /Users/user/.gradle/caches/modules-2/files-2.1/io.netty/netty-codec/4.1.6.Final/86ce3c559af6759a0b991b9ad2faec20981e18e/netty-codec-4.1.6.Final.jar:io/netty/handler/codec/DefaultHeaders.class	
    at Version.fakeStackEntry(Version_3.0.69.java:0)	
    •••
    at com.android.build.gradle.internal.tasks.R8Task$Companion.shrink(R8Task.kt:592)	
    at com.android.build.gradle.internal.tasks.R8Task.doTaskAction(R8Task.kt:443)	
    at com.android.build.gradle.internal.tasks.NonIncrementalTask$taskAction$$inlined$recordTaskAction$1.invoke(baseTask.kt:63)	
    at com.android.build.gradle.internal.tasks.Blocks.recordSpan(Blocks.java:51)	
    at com.android.build.gradle.internal.tasks.NonIncrementalTask.taskAction(NonIncrementalTask.kt:94)	
    •••
    Caused by: com.android.tools.r8.internal.GG: Unexpected usage left in method `boolean io.netty.handler.codec.DefaultHeaders.equals(java.lang.Object)` after inlining: Invoke-Interface     v41 <- v4, v37, v39; method: boolean io.netty.util.HashingStrategy.equals(java.lang.Object, java.lang.Object)	
    at com.android.tools.r8.internal.gg.a(SourceFile:376)	
    •••

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/325220.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号