how to solve ava.lang.AssertionError: Leaked SDKs error?

Answered

when i run the test case use com.intellij.testFramework after the case is running ,the error popup As bellow:


Leaked SDKs: [Android API 23 Platform (/Users/androidbot/Library/Android/sdk), Android API 19 Platform (/Users/androidbot/Library/Android/sdk), Android API 27 Platform (/Users/androidbot/Library/Android/sdk), Android API 29 Platform (/Users/androidbot/Library/Android/sdk), Android API 25 Platform (/Users/androidbot/Library/Android/sdk), Android API 24 Platform (/Users/androidbot/Library/Android/sdk), Android API 26 Platform (/Users/androidbot/Library/Android/sdk), Android API 28 Platform (/Users/androidbot/Library/Android/sdk)]
java.lang.AssertionError: Leaked SDKs: [Android API 23 Platform (/Users/androidbot/Library/Android/sdk), Android API 19 Platform (/Users/androidbot/Library/Android/sdk), Android API 27 Platform (/Users/androidbot/Library/Android/sdk), Android API 29 Platform (/Users/androidbot/Library/Android/sdk), Android API 25 Platform (/Users/androidbot/Library/Android/sdk), Android API 24 Platform (/Users/androidbot/Library/Android/sdk), Android API 26 Platform (/Users/androidbot/Library/Android/sdk), Android API 28 Platform (/Users/androidbot/Library/Android/sdk)]
at org.junit.Assert.fail(Assert.java:88)
at com.intellij.testFramework.SdkLeakTracker.checkForJdkTableLeaks(SdkLeakTracker.java:54)
at com.intellij.testFramework.LightPlatformTestCase.lambda$tearDown$8(LightPlatformTestCase.java:399)
at com.intellij.testFramework.RunAll.collectExceptions(RunAll.java:53)
at com.intellij.testFramework.RunAll.run(RunAll.java:43)
at com.intellij.testFramework.RunAll.run(RunAll.java:40)
at com.intellij.testFramework.LightPlatformTestCase.tearDown(LightPlatformTestCase.java:404)
at com.intellij.testFramework.LightPlatformCodeInsightTestCase.tearDown(LightPlatformCodeInsightTestCase.java:280)
at com.sap.cloud.mobile.android.assistant.test.application.tests.uitest.common.NoUITests.tearDown(NoUITests.java:298)
at com.intellij.testFramework.LightPlatformTestCase.startRunAndTear(LightPlatformTestCase.java:577)
at com.intellij.testFramework.LightPlatformTestCase.lambda$runBareImpl$42(LightPlatformTestCase.java:542)
at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:19)
at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:14)
at com.intellij.testFramework.EdtTestUtilKt$runInEdtAndWait$2.run(EdtTestUtil.kt:65)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:349)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
3 comments
Comment actions Permalink

Please use com.intellij.openapi.projectRoots.ProjectJdkTable#addJdk(com.intellij.openapi.projectRoots.Sdk, com.intellij.openapi.Disposable) with com.intellij.testFramework.fixtures.CodeInsightTestFixture#getProjectDisposable as Disposable to register SDK temporarily.

0
Comment actions Permalink

where can i use this code? and my another machine do not have the same problem.

0
Comment actions Permalink

In your test code? It seems you might have different target platforms/version on the other machine.

0

Please sign in to leave a comment.