0

Every time I open debug mode with any Java project with any launcher activity, if exception breakpoints enabled the app crashed. The exception location that is shown is in the ApplicationPackageManager class in the getServiceInfo() method:

public ServiceInfo getServiceInfo(ComponentName className, ComponentInfoFlags flags)
            throws NameNotFoundException {
        final int userId = getUserId();
        try {
            ServiceInfo si = mPM.getServiceInfo(className,
                    updateFlagsForComponent(flags.getValue(), userId, null), userId);
            if (si != null) {
                return si;
            }
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }

        throw new NameNotFoundException(className.toString());
    }

This is the entire stack trace that is being generated when running anew android studio project:

getServiceInfo:616, ApplicationPackageManager (android.app)
getServiceInfo:599, ApplicationPackageManager (android.app)
getServiceInfo:69, AppLocalesMetadataHolderService (androidx.appcompat.app)
isAutoStorageOptedIn:914, AppCompatDelegate (androidx.appcompat.app)
attachBaseContext2:398, AppCompatDelegateImpl (androidx.appcompat.app)
attachBaseContext:141, AppCompatActivity (androidx.appcompat.app)
attach:8486, Activity (android.app)
performLaunchActivity:3733, ActivityThread (android.app)
handleLaunchActivity:3922, ActivityThread (android.app)
execute:103, LaunchActivityItem (android.app.servertransaction)
executeCallbacks:139, TransactionExecutor (android.app.servertransaction)
execute:96, TransactionExecutor (android.app.servertransaction)
handleMessage:2443, ActivityThread$H (android.app)
dispatchMessage:106, Handler (android.os)
loopOnce:205, Looper (android.os)
loop:294, Looper (android.os)
main:8177, ActivityThread (android.app)
invoke:-1, Method (java.lang.reflect)
run:552, RuntimeInit$MethodAndArgsCaller (com.android.internal.os)
main:971, ZygoteInit (com.android.internal.os)

If I make any changes to the code within the main Activity, the stack changes into:

access:-1, Linux (libcore.io)
access:128, ForwardingOs (libcore.io)
access:76, BlockGuardOs (libcore.io)
access:128, ForwardingOs (libcore.io)
access:8054, ActivityThread$AndroidOs (android.app)
checkAccess:313, UnixFileSystem (java.io)
exists:813, File (java.io)
updateLoader:75, ResourceOverlays (com.android.tools.deploy.instrument)
addResourceOverlays:37, ResourceOverlays (com.android.tools.deploy.instrument)
addResourceOverlays:110, InstrumentationHooks (com.android.tools.deploy.instrument)
getResources:1376, LoadedApk (android.app)
getAssets:1353, LoadedApk (android.app)
makeApplicationInner:1443, LoadedApk (android.app)
makeApplicationInner:1395, LoadedApk (android.app)
handleBindApplication:6959, ActivityThread (android.app)
\-$$Nest$mhandleBindApplication:-1, ActivityThread (android.app)
handleMessage:2236, ActivityThread$H (android.app)
dispatchMessage:106, Handler (android.os)
loopOnce:205, Looper (android.os)
loop:294, Looper (android.os)
main:8177, ActivityThread (android.app)
invoke:-1, Method (java.lang.reflect)
run:552, RuntimeInit$MethodAndArgsCaller (com.android.internal.os)
main:971, ZygoteInit (com.android.internal.os)

If a make a new Kotlin template project and run it the stack trace is:

classForName:-1, Class (java.lang)
findClass:1366, BootClassLoader (java.lang)
loadClass:1426, BootClassLoader (java.lang)
loadClass:367, ClassLoader (java.lang)
loadClass:312, ClassLoader (java.lang)
classForName:-1, Class (java.lang)
forName:536, Class (java.lang)
createView:827, LayoutInflater (android.view)
createView:788, LayoutInflater (android.view)
onCreateView:58, PhoneLayoutInflater (com.android.internal.policy)
onCreateView:942, LayoutInflater (android.view)
onCreateView:962, LayoutInflater (android.view)
createViewFromTag:1016, LayoutInflater (android.view)
createViewFromTag:973, LayoutInflater (android.view)
rInflate:1135, LayoutInflater (android.view)
rInflateChildren:1096, LayoutInflater (android.view)
inflate:694, LayoutInflater (android.view)
inflate:538, LayoutInflater (android.view)
inflate:485, LayoutInflater (android.view)
onResourcesLoaded:2207, DecorView (com.android.internal.policy)
generateLayout:2709, PhoneWindow (com.android.internal.policy)
installDecor:2772, PhoneWindow (com.android.internal.policy)
getDecorView:2154, PhoneWindow (com.android.internal.policy)
enable:75, EdgeToEdge (androidx.activity)
enable$default:71, EdgeToEdge (androidx.activity)
onCreate:19, MainActivity (com.igalblech.school.stupid4)
performCreate:8595, Activity (android.app)
performCreate:8573, Activity (android.app)
callActivityOnCreate:1456, Instrumentation (android.app)
performLaunchActivity:3764, ActivityThread (android.app)
handleLaunchActivity:3922, ActivityThread (android.app)
execute:103, LaunchActivityItem (android.app.servertransaction)
executeCallbacks:139, TransactionExecutor (android.app.servertransaction)
execute:96, TransactionExecutor (android.app.servertransaction)
handleMessage:2443, ActivityThread$H (android.app)
dispatchMessage:106, Handler (android.os)
loopOnce:205, Looper (android.os)
loop:294, Looper (android.os)
main:8177, ActivityThread (android.app)
invoke:-1, Method (java.lang.reflect)
run:552, RuntimeInit$MethodAndArgsCaller (com.android.internal.os)
main:971, ZygoteInit (com.android.internal.os)

And if a change the Kotlin code the stack traces is the same as I changes the Java code.

I was not able to find any way online to fix or circumvent this error, when running the app normally everything works fine.

I've tried to reinstall android studio. And stepping over this specific exception, but it caused other exceptions to be thrown.

Update:
The exception is in the Android plugin, the stack trace that is shown for that is:

com.intellij.diagnostic.PluginException: Sorry but parent: {DUMB_AWARE=true, FILE_KEY=LightVirtualFile: \android-33\UnavailableSource, editor.notification.provider={class com.android.tools.idea.editors.AttachAndroidSdkSourcesNotificationProvider=com.android.tools.idea.editors.AttachAndroidSdkSourcesNotificationProvider$MyEditorNotificationPanel[,0,0,824x35,invalid,layout=java.awt.BorderLayout,alignmentX=0.0,alignmentY=0.0,border=NamedBorderImpl(name='borderWithoutStatus', original=com.intellij.util.ui.JBEmptyBorder@18d50d5a),flags=16777225,maximumSize=,minimumSize=,preferredSize=]}, file.level.intentions=[]} (class com.android.tools.idea.uibuilder.editor.multirepresentation.sourcecode.SourceCodeEditorWithMultiRepresentationPreview) has already been disposed (see the cause for stacktrace) so the child: com.android.tools.idea.concurrency.CoroutinesUtilsKt$cancelJobOnDispose$1@57becb8f (class com.android.tools.idea.concurrency.CoroutinesUtilsKt$cancelJobOnDispose$1) will never be disposed [Plugin: org.jetbrains.android]
    at com.intellij.ui.EditorNotificationsImpl$updateEditors$job$1.invokeSuspend(EditorNotificationsImpl.kt:251)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Caused by: com.intellij.util.IncorrectOperationException: Sorry but parent: {DUMB_AWARE=true, FILE_KEY=LightVirtualFile: \android-33\UnavailableSource, editor.notification.provider={class com.android.tools.idea.editors.AttachAndroidSdkSourcesNotificationProvider=com.android.tools.idea.editors.AttachAndroidSdkSourcesNotificationProvider$MyEditorNotificationPanel[,0,0,824x35,invalid,layout=java.awt.BorderLayout,alignmentX=0.0,alignmentY=0.0,border=NamedBorderImpl(name='borderWithoutStatus', original=com.intellij.util.ui.JBEmptyBorder@18d50d5a),flags=16777225,maximumSize=,minimumSize=,preferredSize=]}, file.level.intentions=[]} (class com.android.tools.idea.uibuilder.editor.multirepresentation.sourcecode.SourceCodeEditorWithMultiRepresentationPreview) has already been disposed (see the cause for stacktrace) so the child: com.android.tools.idea.concurrency.CoroutinesUtilsKt$cancelJobOnDispose$1@57becb8f (class com.android.tools.idea.concurrency.CoroutinesUtilsKt$cancelJobOnDispose$1) will never be disposed
    at com.intellij.openapi.util.ObjectTree.register(ObjectTree.java:43)
    at com.intellij.openapi.util.Disposer.register(Disposer.java:161)
    at com.android.tools.idea.concurrency.CoroutinesUtilsKt.cancelJobOnDispose(CoroutinesUtils.kt:170)
    at com.android.tools.idea.concurrency.CoroutinesUtilsKt.AndroidCoroutineScope(CoroutinesUtils.kt:161)
    at com.android.tools.idea.concurrency.CoroutinesUtilsKt.AndroidCoroutineScope$default(CoroutinesUtils.kt:159)
    at com.android.tools.idea.editors.AttachAndroidSdkSourcesNotificationProvider.createCoroutineScopeForEditor(AttachAndroidSdkSourcesNotificationProvider.kt:143)
    at com.android.tools.idea.editors.AttachAndroidSdkSourcesNotificationProvider.doCreatePanel(AttachAndroidSdkSourcesNotificationProvider.kt:115)
    at com.android.tools.idea.editors.AttachAndroidSdkSourcesNotificationProvider.access$doCreatePanel(AttachAndroidSdkSourcesNotificationProvider.kt:53)
    at com.android.tools.idea.editors.AttachAndroidSdkSourcesNotificationProvider$createPanel$1.apply(AttachAndroidSdkSourcesNotificationProvider.kt:100)
    at com.android.tools.idea.editors.AttachAndroidSdkSourcesNotificationProvider$createPanel$1.apply(AttachAndroidSdkSourcesNotificationProvider.kt:99)
    at com.intellij.ui.EditorNotificationsImpl$updateEditors$job$1$2.invokeSuspend(EditorNotificationsImpl.kt:243)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
    at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:194)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:843)
    at com.intellij.openapi.application.impl.ApplicationImpl$4.run(ApplicationImpl.java:463)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithEnabledImplicitRead(RwLockHolder.kt:75)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithImplicitRead(RwLockHolder.kt:67)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWithImplicitRead(ApplicationImpl.java:1436)
    at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:82)
    at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:124)
    at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:44)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:792)
    at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
    at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:761)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:695)
    at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$12(IdeEventQueue.kt:589)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithoutImplicitRead(RwLockHolder.kt:44)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:589)
    at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:72)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:355)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:354)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:793)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:354)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:349)
    at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1014)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
    at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1014)
    at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:349)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:848)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:391)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.