leakcanary

Android:Unable to determine application id: com.android.tools.idea.run.ApkProvisionException

a 夏天 提交于 2020-03-04 23:30:23
Android Studio 从3.0升级到3.6+之后,安装软件在下方run的调试台出现 Unable to determine application id: com.android.tools.idea.run.ApkProvisionException: No outputs for the main artifact of variant: debug。 点击上方run的绿色箭头按钮,除了run调试台,没有任何反应 编译正常,代码无错误,在app/build/outputs/apk其实是有debug包生成的,把它拷贝到手机上,也能安装,如果你不嫌麻烦的话。不过不能安装就不能debug。 出现这个问题,是由于Android Studio升级后,他的gradle和classpath不匹配。这是一份,2015年的项目,依赖包多,代码老化,使用的classpath是2.3.3,gradle是3.3,现在的classpath能到3.6+,gradle能5.+。想要不改动就解决的话,下载一个Android3.0或者2.3 。使用新版Android Studio的往下看 如果你想要符合你编译器默认的,就新建一个项目,对比一下,然而我在使用了它新建后默认的classpath3.6.1和gradle5.5后,出现了, NoClassDefFoundError: com/android

被裁的第50天,我终于拿到心仪公司Offer

杀马特。学长 韩版系。学妹 提交于 2020-02-26 17:01:24
今天分享的是之前分享文章中被裁的小C,可以看这篇文《寒冬之下,被cai的那些人到底去哪了?》,最近他已经找到心仪公司今日头条Offer,并且即将入职,在应我要求下,他写了篇总结文如下。下文中的"我",不是鱼哥,是特指小C。 这两个月听的最多的两个词就是 寒冬 和 裁员 ,作为被裁大军中的一员,经历焦虑到担心,再到自信,最后到喜悦。焦虑的是那段被裁日子,不太好过,每天不敢下楼,就在房间里复习。也不敢告诉家里人。担心的是自己找不到工作,成为失业人员。自信是拿了几家二、三线厂offer后,越来越自信。喜悦是同时也拿到自己梦寐以求的公司绿灯通道。今天主要分享下技术面试过程中需要注意的点。 更新简历 在鱼哥指导下,我把简历中亮点项目的一些细节着重介绍了下,以及做的一些成绩用数据量化,简历最好不要写太多页,一般2-3页就够,捡重点写,写牛逼的地方和自己亲自参与的,最好不要写牛逼的项目,但是你却不熟悉的,这很打脸,让人怀疑你的真实性。这点很感谢鱼哥指导。 投递简历 投递简历基本都是找人内推,拉钩,boss上回复意愿貌似很低,有些公司不像是真正招人,内推好处就是可以后续方便跟踪反馈,开始没有着急出去面试,而是准备了半个月有余,把过去从Java,Android,设计模式,算法与数据结构,基本都过了一遍,弱项是算法与数据结构,这里主要去刷了些题目,在LeetCode上。 复习内容 在 Java复习 中

记一次关于Fragment的内存泄漏

六眼飞鱼酱① 提交于 2020-02-26 10:14:29
之前使用单Activity多Fragment架构完成过一个项目,在后期维护时发现,很多Fragment在关闭之后,内存无法被回收,出现了内存泄漏问题。leakcanary显示引用链信息如下: LoginFragment关闭后仍然被FragmentManangerImpl中的mCreatedMenus所引用,导致LoginFragment无法被释放。 我又使用Android Profiler工具查看了内存中的实例,步骤如下: 1、运行app,打开Android Profiler工具,然后点击MEMORY,会显示如下视图: 2、点击左上角的“Force garbage collection”按钮执行一次垃圾回收,再点击它旁边的“Dump Java heap”按钮便可将堆中的实例全部分析出来: 如上图我把fragment过滤出来,LoginFragment确实还在内存中,但是FragmentManangerImpl中mAdded中已经不存在LoginFragment,再看看mCreatedMenus: 里面包含了LoginFragment。mCreatedMenus是个什么东西呢,为什么会引用着已关闭的页面?它是FragmentManangerImpl中的属性,只能去FragmentManangerImpl中找找答案了。 在FragmentManangerImpl找到了如下一段代码:

ConnectivityManager leaking, not sure how to resolve

為{幸葍}努か 提交于 2020-02-01 04:41:06
问题 So, I have this method that let's me know if the user has an active internet connection. It works well. However, leak canary has identified a memory leak associated with the connectivityManager. I am presently not closing the connectivityManager anywhere in my code at any time that I know of. I've tried to close the connectivityManager in onDestroy. Either that isn't an option or I don't know the code. Truth be told, I simply tried to get auto fill to tell me how to do it. No luck. public

ConnectivityManager leaking, not sure how to resolve

对着背影说爱祢 提交于 2020-02-01 04:41:06
问题 So, I have this method that let's me know if the user has an active internet connection. It works well. However, leak canary has identified a memory leak associated with the connectivityManager. I am presently not closing the connectivityManager anywhere in my code at any time that I know of. I've tried to close the connectivityManager in onDestroy. Either that isn't an option or I don't know the code. Truth be told, I simply tried to get auto fill to tell me how to do it. No luck. public

Android之超级开源公司square(picasso、okhttp、leakcanary)简单介绍

你说的曾经没有我的故事 提交于 2020-01-25 04:38:02
0、 https://square.github.io/#android 这是它家官网,开源了好多库,我只能说真牛逼,佩服佩服!!! 1、Android上开发一个App,从网络库、图片库、内存泄漏库,全套都可以用它们的,真是一家牛逼的公司!下面是知名度相对较高的几个库!!超级轮子,牛逼!! picasso (图片库) okhttp (网络库) leakcanary (内存泄漏) retrofit moshi 等等…… 2、 http://www.piwai.info/index.html 接着我发现一个大佬,它是square的一个技术leader,leakcanary它是作者之一,牛逼,它的CV可真漂亮 这哥们的自我介绍: Pierre-Yves Ricau 我住在旧金山。 我在Square做软件工程师。 我领导了一个团队,专注于让外部移动开发者在使用Square的商业平台时获得成功 他的工作愿景: My Ideal Job(我是不是也该想想自己的Ideal Job,这也是我的理想) Strong technical culture High impact Remote friendly Small teams 我理想的工作环境 雄厚的技术文化 激情满满 充满友善 小型团队 他现在的感受: py.ricau@gmail.com 我很少回复招聘邮件。 我在Square真的很开心。

LeakCanary report leak in InputMethodManager

Deadly 提交于 2020-01-22 12:35:08
问题 I am trying to figure it out a leak in my app but I am not sure were this comes from. LeakCanary is telling me that I can ignore it. Is that right? 01-06 12:04:56.580 6935-9159/com.mypackage D/LeakCanary: * LEAK CAN BE IGNORED. 01-06 12:04:56.580 6935-9159/com.mypackage D/LeakCanary: * com.mypackage.ui.map.MapComponentFragment has leaked: 01-06 12:04:56.580 6935-9159/com.mypackage D/LeakCanary: * GC ROOT android.view.inputmethod.InputMethodManager$1.this$0 (anonymous class extends com.android

Preventing false positives with Leak Canary

天大地大妈咪最大 提交于 2020-01-14 10:16:08
问题 We observe a lot of false-positives with Leak Canary, ie., Leak Canary detects that there is a leak but later comes back with the message: LeakCanary: * NO LEAK FOUND. I think this is because GC didn't claim the object in time. Is there anything that we could do to reduce these false positives ? 来源: https://stackoverflow.com/questions/37557329/preventing-false-positives-with-leak-canary

MapView v2 keeping Context around

◇◆丶佛笑我妖孽 提交于 2020-01-01 08:38:08
问题 When using the MapView from the latest google maps API, I am getting a memory leak because MapView is holding onto my activity. I used Leak Canary and have this trace D/LeakCanary﹕ * GC ROOT com.google.android.gms.location.internal.t.a D/LeakCanary﹕ * references com.google.android.gms.location.internal.s.a D/LeakCanary﹕ * references com.google.maps.api.android.lib6.d.v.c D/LeakCanary﹕ * references com.google.maps.api.android.lib6.d.aj.b D/LeakCanary﹕ * references com.google.maps.api.android

How to use Leak Canary

倖福魔咒の 提交于 2019-12-31 09:11:34
问题 I know this is probably a dumb question, but I am pretty new at developing android, and I currently experiencing an OutOfMemoryError in my apps, which I have tried to debug using MAT, but it is still too hard to find the leak in a few activities, then I found LeakCanary, which seems simpler and easier to use, however I could not find any beginner step by step guide on using Leak Canary, even on Google. I have installed LeakCanary through the dependencies in my build.gradle, and this is what I