Fixed
Status Update
Comments
uc...@google.com <uc...@google.com>
xa...@google.com <xa...@google.com>
sp...@google.com <sp...@google.com>
ju...@google.com <ju...@google.com> #2
We've recently updated DefaultActivityLocator to use the new AndroidManifestIndex to find a module's activities without relying on the manifest merger. We've just enabled this under a flag for selecting the default activity during actual app deployments. We can easily reuse the same logic for validation under the same flag-- should have a CL up monday morning.
ju...@google.com <ju...@google.com> #3
And by "Monday morning" I meant probably tomorrow. WIP CL is at ag/9673697. The code should be that simple, just need to include tests.
ju...@google.com <ju...@google.com> #4
ag/9673697 was submitted, then reverted because it somehow introduced flakiness into the APK debugging pipeline. I'm still looking into it.
ju...@google.com <ju...@google.com> #5
Kun, would you investigate the source of the failures? I suspect it's something to do with indices not being available, but I haven't had the chance to look into this too closely.
ku...@google.com <ku...@google.com> #6
Fixed in ag/10192788, ag/10192696, that we validate default activity using AndroidManifestIndex.
ku...@google.com <ku...@google.com> #7
For fast paths implementation, it's tracked here, b/132248837 .
tn...@google.com <tn...@google.com> #8
Excellent, thank you!
mt...@gmail.com <mt...@gmail.com> #9
=== About ===
Build version: Android Studio 4.0 Beta 4 Build #AI-193.6911.18.40.6348893 March 31, 2020
Java version: 1.8.0_242-release-1644-b01amd64
Operating System: Windows 10 (10.0, amd64)
JVM version: OpenJDK 64-Bit Server VM JetBrains s.r.o
=== System ===
Number of CPU: 8
Used memory: 276Mb
Free memory: 211Mb
Total memory: 487Mb
Maximum available memory: 4029Mb
=== Displays ===
Displays:
Display 0: 3840x2160; scale: 1,50
Display 1: 6720x3780; scale: 1,75
=== Plugins ===
Custom plugins: [CheckStyle-IDEA (5.36.2), Equals and HashCode Deluxe Generator (1.0.12), FindBugs-IDEA (1.0.1), GenerateSerialVersionUID (3.0.3), String Manipulation (7.3.191.000.0), Kotlin (1.3.71-release-Studio4.0-1), BugKotlinDocument (0.2.5), ADB Idea (1.5.4), Android Color Manager (1.1.6), Android Toolbox Plugin (1.1.7), Android Drawable Preview (1.1.4), Android Code Generator (1.6), DTO generator (V0.997), Kotlin serialVersionUID generator (0.0.1), Gauge (0.3.18), Markdown Navigator Enhanced (3.0.197.72), EasyMVVM (0.0.2), .ignore (3.2.3.193), Biu (0.2.0), RegexpTester (1.0.6), JSON To Kotlin Class (JsonToKotlinClass) (3.6.1), Droid Snippet (1.0.2)]
Disabled plugins:[Gradle View (3.0.0), AutoValue plugin (1.0.5), Android NDK Support (1.0), Android APK Support (1.0), MVP Generator (0.2.1), Android ButterKnife Zelezny (1.6.0), StepBuilder Generator (1.0.2), Markdown support (183.5153.1), Android Parcelable code generator (0.7.0)]
Still happen on 4.0 beta4, should be fixed in this release or in beta5?
Build version: Android Studio 4.0 Beta 4 Build #AI-193.6911.18.40.6348893 March 31, 2020
Java version: 1.8.0_242-release-1644-b01amd64
Operating System: Windows 10 (10.0, amd64)
JVM version: OpenJDK 64-Bit Server VM JetBrains s.r.o
=== System ===
Number of CPU: 8
Used memory: 276Mb
Free memory: 211Mb
Total memory: 487Mb
Maximum available memory: 4029Mb
=== Displays ===
Displays:
Display 0: 3840x2160; scale: 1,50
Display 1: 6720x3780; scale: 1,75
=== Plugins ===
Custom plugins: [CheckStyle-IDEA (5.36.2), Equals and HashCode Deluxe Generator (1.0.12), FindBugs-IDEA (1.0.1), GenerateSerialVersionUID (3.0.3), String Manipulation (7.3.191.000.0), Kotlin (1.3.71-release-Studio4.0-1), BugKotlinDocument (0.2.5), ADB Idea (1.5.4), Android Color Manager (1.1.6), Android Toolbox Plugin (1.1.7), Android Drawable Preview (1.1.4), Android Code Generator (1.6), DTO generator (V0.997), Kotlin serialVersionUID generator (0.0.1), Gauge (0.3.18), Markdown Navigator Enhanced (3.0.197.72), EasyMVVM (0.0.2), .ignore (3.2.3.193), Biu (0.2.0), RegexpTester (1.0.6), JSON To Kotlin Class (JsonToKotlinClass) (3.6.1), Droid Snippet (1.0.2)]
Disabled plugins:[Gradle View (3.0.0), AutoValue plugin (1.0.5), Android NDK Support (1.0), Android APK Support (1.0), MVP Generator (0.2.1), Android ButterKnife Zelezny (1.6.0), StepBuilder Generator (1.0.2), Markdown support (183.5153.1), Android Parcelable code generator (0.7.0)]
Still happen on 4.0 beta4, should be fixed in this release or in beta5?
ku...@google.com <ku...@google.com> #10
#9
I checked the idea.log, do you want to address the followings? As I don't see any manifest merging related call stacks.
2020-04-08 16:45:06,475 [ 27955] WARN - d.tools.idea.run.ui.BaseAction - [app] Unable to obtain main package from manifest.
com.android.tools.idea.run.ApkProvisionException: [app] Unable to obtain main package from manifest.
at com.android.tools.idea.run.ApkProviderUtil.computePackageName(ApkProviderUtil.java:109)
at com.android.tools.idea.run.NonGradleApplicationIdProvider.getPackageName(NonGradleApplicationIdProvider.java:35)
at com.android.tools.idea.run.deployment.DeviceAndSnapshotComboBoxDeployableProvider.getDeployable(DeviceAndSnapshotComboBoxDeployableProvider.java:57)
...
2020-04-09 09:09:37,817 [ 25074] WARN - d.tools.idea.run.ui.BaseAction - Sorry but parent: Android (app) has already been disposed (see the cause for stacktrace) so the child: com.android.tools.idea.model.AndroidModuleInfo@4e7a6106 will never be disposed
com.intellij.util.IncorrectOperationException: Sorry but parent: Android (app) has already been disposed (see the cause for stacktrace) so the child: com.android.tools.idea.model.AndroidModuleInfo@4e7a6106 will never be disposed
at com.intellij.openapi.util.ObjectTree.register(ObjectTree.java:59)
at com.intellij.openapi.util.Disposer.register(Disposer.java:78)
at org.jetbrains.android.facet.AndroidFacetScopedService.<init>(AndroidFacetScopedService.java:36)
at com.android.tools.idea.model.AndroidModuleInfo.<init>(AndroidModuleInfo.java:88)
at com.android.tools.idea.model.AndroidModuleInfo.getInstance(AndroidModuleInfo.java:69)
at com.android.tools.idea.run.ApkProviderUtil.computePackageName(ApkProviderUtil.java:107)
at com.android.tools.idea.run.NonGradleApplicationIdProvider.getPackageName(NonGradleApplicationIdProvider.java:35)
at com.android.tools.idea.run.deployment.DeviceAndSnapshotComboBoxDeployableProvider.getDeployable(DeviceAndSnapshotComboBoxDeployableProvider.java:57)
....
If so, looks like it has trouble getting package name from the main manifest file of your apk project. Does this finally get resolved? Can you checkout the merged manifest tab/viewer, and see if there's any errors. Thanks!
Also, there's some improvements regarding package name fetch, and it landed in 4.1 Canary 1 [4.1.0.1].
I checked the idea.log, do you want to address the followings? As I don't see any manifest merging related call stacks.
2020-04-08 16:45:06,475 [ 27955] WARN - d.tools.idea.run.ui.BaseAction - [app] Unable to obtain main package from manifest.
com.android.tools.idea.run.ApkProvisionException: [app] Unable to obtain main package from manifest.
at com.android.tools.idea.run.ApkProviderUtil.computePackageName(ApkProviderUtil.java:109)
at com.android.tools.idea.run.NonGradleApplicationIdProvider.getPackageName(NonGradleApplicationIdProvider.java:35)
at com.android.tools.idea.run.deployment.DeviceAndSnapshotComboBoxDeployableProvider.getDeployable(DeviceAndSnapshotComboBoxDeployableProvider.java:57)
...
2020-04-09 09:09:37,817 [ 25074] WARN - d.tools.idea.run.ui.BaseAction - Sorry but parent: Android (app) has already been disposed (see the cause for stacktrace) so the child: com.android.tools.idea.model.AndroidModuleInfo@4e7a6106 will never be disposed
com.intellij.util.IncorrectOperationException: Sorry but parent: Android (app) has already been disposed (see the cause for stacktrace) so the child: com.android.tools.idea.model.AndroidModuleInfo@4e7a6106 will never be disposed
at com.intellij.openapi.util.ObjectTree.register(ObjectTree.java:59)
at com.intellij.openapi.util.Disposer.register(Disposer.java:78)
at org.jetbrains.android.facet.AndroidFacetScopedService.<init>(AndroidFacetScopedService.java:36)
at com.android.tools.idea.model.AndroidModuleInfo.<init>(AndroidModuleInfo.java:88)
at com.android.tools.idea.model.AndroidModuleInfo.getInstance(AndroidModuleInfo.java:69)
at com.android.tools.idea.run.ApkProviderUtil.computePackageName(ApkProviderUtil.java:107)
at com.android.tools.idea.run.NonGradleApplicationIdProvider.getPackageName(NonGradleApplicationIdProvider.java:35)
at com.android.tools.idea.run.deployment.DeviceAndSnapshotComboBoxDeployableProvider.getDeployable(DeviceAndSnapshotComboBoxDeployableProvider.java:57)
....
If so, looks like it has trouble getting package name from the main manifest file of your apk project. Does this finally get resolved? Can you checkout the merged manifest tab/viewer, and see if there's any errors. Thanks!
Also, there's some improvements regarding package name fetch, and it landed in 4.1 Canary 1 [4.1.0.1].
Description
2019-10-31 08:45:30,590 [ 38488] WARN - .idea.model.MergedManifestInfo - getMergedManifestSupplier failed Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library /Users/tnorbye/.gradle/caches/transforms-2/files-2.1/5114d3b43c9e4a0436d28d30ce21e0df/camera-camera2-1.0.0-alpha06/AndroidManifest.xml as the library might be using APIs not available in 19
Suggestion: use a compatible library with a minSdk of at most 19,
or increase this project's minSdk version to at least 21,
or use tools:overrideLibrary="androidx.camera.camera2" to force usage (may lead to runtime failures)
2019-10-31 08:45:31,147 [ 39045] WARN - .idea.model.MergedManifestInfo - getMergedManifestSupplier failed Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library /Users/tnorbye/.gradle/caches/transforms-2/files-2.1/5114d3b43c9e4a0436d28d30ce21e0df/camera-camera2-1.0.0-alpha06/AndroidManifest.xml as the library might be using APIs not available in 19
Suggestion: use a compatible library with a minSdk of at most 19,
or increase this project's minSdk version to at least 21,
or use tools:overrideLibrary="androidx.camera.camera2" to force usage (may lead to runtime failures)
2019-10-31 08:45:31,294 [ 39192] WARN - .idea.model.MergedManifestInfo - getMergedManifestSupplier failed Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library /Users/tnorbye/.gradle/caches/transforms-2/files-2.1/5114d3b43c9e4a0436d28d30ce21e0df/camera-camera2-1.0.0-alpha06/AndroidManifest.xml as the library might be using APIs not available in 19
Suggestion: use a compatible library with a minSdk of at most 19,
or increase this project's minSdk version to at least 21,
or use tools:overrideLibrary="androidx.camera.camera2" to force usage (may lead to runtime failures)
2019-10-31 08:45:32,403 [ 40301] WARN - .idea.model.MergedManifestInfo - getMergedManifestSupplier failed Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library /Users/tnorbye/.gradle/caches/transforms-2/files-2.1/5114d3b43c9e4a0436d28d30ce21e0df/camera-camera2-1.0.0-alpha06/AndroidManifest.xml as the library might be using APIs not available in 19
Suggestion: use a compatible library with a minSdk of at most 19,
or increase this project's minSdk version to at least 21,
or use tools:overrideLibrary="androidx.camera.camera2" to force usage (may lead to runtime failures)
2019-10-31 08:45:32,403 [ 40301] WARN - .idea.model.MergedManifestInfo - getMergedManifestSupplier failed Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library /Users/tnorbye/.gradle/caches/transforms-2/files-2.1/5114d3b43c9e4a0436d28d30ce21e0df/camera-camera2-1.0.0-alpha06/AndroidManifest.xml as the library might be using APIs not available in 19
Suggestion: use a compatible library with a minSdk of at most 19,
or increase this project's minSdk version to at least 21,
or use tools:overrideLibrary="androidx.camera.camera2" to force usage (may lead to runtime failures)
2019-10-31 08:46:55,196 [ 123094] WARN - .idea.model.MergedManifestInfo - getMergedManifestSupplier failed Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library /Users/tnorbye/.gradle/caches/transforms-2/files-2.1/5114d3b43c9e4a0436d28d30ce21e0df/camera-camera2-1.0.0-alpha06/AndroidManifest.xml as the library might be using APIs not available in 19
Suggestion: use a compatible library with a minSdk of at most 19,
or increase this project's minSdk version to at least 21,
or use tools:overrideLibrary="androidx.camera.camera2" to force usage (may lead to runtime failures)
2019-10-31 08:46:55,197 [ 123095] WARN - .idea.model.MergedManifestInfo - getMergedManifestSupplier failed Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library /Users/tnorbye/.gradle/caches/transforms-2/files-2.1/5114d3b43c9e4a0436d28d30ce21e0df/camera-camera2-1.0.0-alpha06/AndroidManifest.xml as the library might be using APIs not available in 19
Suggestion: use a compatible library with a minSdk of at most 19,
or increase this project's minSdk version to at least 21,
I set a breakpoint and noticed that this is done as part of icon calculation:
"OurIconsCalculating Pool@42992" daemon prio=4 tid=0x62 nid=NA runnable
java.lang.Thread.State: RUNNABLE
at com.android.tools.idea.model.MergedManifestInfo.mergeManifests(MergedManifestInfo.java:223)
at com.android.tools.idea.model.MergedManifestInfo.create(MergedManifestInfo.java:192)
at com.android.tools.idea.model.MergedManifestSupplier$getOrCreateSnapshot$$inlined$runReadAction$1.compute(MergedManifestManager.kt:114)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:918)
at com.android.tools.idea.model.MergedManifestSupplier.getOrCreateSnapshot(actions.kt:22)
at com.android.tools.idea.model.MergedManifestSupplier.getOrCreateSnapshotInCallingThread(MergedManifestManager.kt:144)
at com.android.tools.idea.model.MergedManifestManager$Companion.getFreshSnapshot(MergedManifestManager.kt:336)
at com.android.tools.idea.model.MergedManifestManager.getFreshSnapshot(MergedManifestManager.kt:-1)
at com.android.tools.idea.run.activity.DefaultActivityLocator.getMergedManifest(DefaultActivityLocator.java:137)
at com.android.tools.idea.run.activity.DefaultActivityLocator.validate(DefaultActivityLocator.java:94)
at com.android.tools.idea.run.editor.DefaultActivityLaunch$State.checkConfiguration(DefaultActivityLaunch.java:49)
at com.android.tools.idea.run.AndroidAppRunConfigurationBase.checkConfiguration(AndroidAppRunConfigurationBase.java:134)
at com.android.tools.idea.run.AndroidRunConfigurationBase.validate(AndroidRunConfigurationBase.java:191)
at com.android.tools.idea.run.AndroidRunConfigurationBase.checkConfiguration(AndroidRunConfigurationBase.java:111)
at com.intellij.execution.impl.RunnerAndConfigurationSettingsImpl.checkSettings(RunnerAndConfigurationSettingsImpl.kt:310)
at com.intellij.execution.RunnerAndConfigurationSettings.checkSettings(RunnerAndConfigurationSettings.java:116)
at com.intellij.execution.impl.TimedIconCache.calcIcon(TimedIconCache.kt:71)
at com.intellij.execution.impl.TimedIconCache.access$calcIcon(TimedIconCache.kt:18)
at com.intellij.execution.impl.TimedIconCache$get$$inlined$write$lambda$1.fun(TimedIconCache.kt:50)
at com.intellij.execution.impl.TimedIconCache$get$$inlined$write$lambda$1.fun(TimedIconCache.kt:18)
at com.intellij.ui.DeferredIconImpl.evaluate(DeferredIconImpl.java:263)
at com.intellij.ui.DeferredIconImpl.lambda$null$0(DeferredIconImpl.java:151)
at com.intellij.ui.DeferredIconImpl$$Lambda$2093.1293385704.run(Unknown Source:-1)
at com.intellij.ui.IconDeferrerImpl.evaluateDeferred(IconDeferrerImpl.java:111)
at com.intellij.ui.DeferredIconImpl.lambda$null$1(DeferredIconImpl.java:151)
at com.intellij.ui.DeferredIconImpl$$Lambda$2092.596781412.run(Unknown Source:-1)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1109)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:72)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils$$Lambda$1359.314034239.run(Unknown Source:-1)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$1(ProgressIndicatorUtils.java:126)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils$$Lambda$628.1165883188.run(Unknown Source:-1)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:169)
at com.intellij.openapi.progress.impl.CoreProgressManager$$Lambda$193.595503010.run(Unknown Source:-1)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:591)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:537)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:156)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:115)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:72)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:93)
at com.intellij.ui.DeferredIconImpl.lambda$paintIcon$4(DeferredIconImpl.java:150)
at com.intellij.ui.DeferredIconImpl$$Lambda$2091.1780738079.run(Unknown Source:-1)
at com.intellij.util.concurrency.BoundedTaskExecutor.doRun$$$capture(BoundedTaskExecutor.java:207)
at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:-1)
at com.intellij.util.concurrency.BoundedTaskExecutor.access$100(BoundedTaskExecutor.java:29)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.lambda$run$0(BoundedTaskExecutor.java:185)
at com.intellij.util.concurrency.BoundedTaskExecutor$1$$Lambda$86.2020594143.run(Unknown Source:-1)
at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:208)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:181)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Nothing has changed in between these errors getting dumped, so I'm assuming that because merging somehow failed, nothing is cached and it keeps running over and over. We should do something in the manifest merger such that when it's run in IDE mode, these errors aren't fatal and it ends up with a reasonable merged manifest.
Second, we probably shouldn't be computing a full merged manifest just to update icon state. If this is related to locating activities, we should be able to pick a faster code path.