gpt4 book ai didi

android - DisplayLeakActivity 不存在

转载 作者:塔克拉玛干 更新时间:2023-11-02 18:59:42 25 4
gpt4 key购买 nike

一段时间以来我遇到了 LeakCanary 问题(我认为是从 Android Studio 2.2 开始但不确定)

我添加了这个依赖

 dependencies {
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta2'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2'
}

当我在 Android Studio 中点击播放按钮时,我收到此错误消息:

$ adb shell am start -n "com.example.debug/com.squareup.leakcanary.internal.DisplayLeakActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Error while executing: am start -n "com.example.debug/com.squareup.leakcanary.internal.DisplayLeakActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.debug/com.squareup.leakcanary.internal.DisplayLeakActivity }
Error type 3
Error: Activity class {com.example.debug/com.squareup.leakcanary.internal.DisplayLeakActivity} does not exist.

Error while Launching activity

但是当我用 ClassyShark 打开 apk 文件时我可以看到 Activity 在那里。

enter image description here

出了什么问题?

最佳答案

当我尝试在我的应用中启用 LeakCanary 时,我会遇到这种情况。

我在 list 中以某种方式定义了:

<application
android:name="sg.swiftninja.DriverApplication"
android:allowBackup="false"
tools:node="replace" // <-- THIS
android:label="@string/app_name"
android:theme="@style/AppTheme">

我认为问题出在我的应用程序标记中的 tools:node="replace" 上。

我通过替换解决了这个问题:

tools:node="replace" 

tools:replace="android:allowBackup" // or whatever nodes like this tools:replace="icon, label"

或者如果您不需要它,只需删除该行。希望这对您有所帮助!

关于android - DisplayLeakActivity 不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37909067/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com