Since updating to androidx.compose 1.2.0-alpha06 I'm unable to see any previews. I haven't found similar issues anywhere. Preview renderer crashes with the following message
java.lang.ClassNotFoundException: android.view.OnBackInvokedCallback
at com.android.tools.idea.rendering.classloading.loaders.DelegatingClassLoader.findClass(DelegatingClassLoader.kt:81)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at com.android.tools.idea.rendering.classloading.loaders.DelegatingClassLoader.loadClass(DelegatingClassLoader.kt:65)
at androidx.compose.ui.tooling.ComposeViewAdapter$FakeOnBackPressedDispatcherOwner$1.<init>(ComposeViewAdapter.kt:744)
at androidx.compose.ui.tooling.ComposeViewAdapter.<init>(ComposeViewAdapter.kt:743)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:352)
at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:189)
at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:149)
at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:301)
...
Similar issue has not been answered by anyone.
Applying the workaround specified here did not work, although the case seems similar to mine, the error differs from mine, I guess that's the reason.
I saw an issue that required to set the same compose-activity version as compose version, it did not help. My activity-ktx version is 1.6.0-alpha01.
I'm using
Android Studio Bumblebee | 2021.1.1 Patch 3
Try using Activity 1.5.0-beta01 as 1.6.0-alpha01 is only compatible with Android 13 Developer Preview 2 SDK as indicated here: https://developer.android.com/jetpack/androidx/releases/activity#1.6.0-alpha01
Related
I am working on an android application with AR elements. When it is redirecting me from the onboarding screen to the AR screen it crashes with the following error.
java.lang.IllegalArgumentException: Could not find tag for key 'org.codeaurora.qcamera3.exposure_metering.exposure_metering_mode')
at android.hardware.camera2.impl.CameraMetadataNative.nativeGetTagFromKeyLocal(Native Method)
at android.hardware.camera2.impl.CameraMetadataNative.setBase(CameraMetadataNative.java:1389)
at android.hardware.camera2.impl.CameraMetadataNative.set(CameraMetadataNative.java:459)
at android.hardware.camera2.impl.CameraMetadataNative.set(CameraMetadataNative.java:463)
at android.hardware.camera2.CaptureRequest$Builder.set(CaptureRequest.java:848)
at dez.a(PG:49)
at gtf.g(PG:104)
at det.a(Unknown Source:12)
at gjw.e(PG:5)
at gnx.run(PG:12)
at gsa.run(PG:2)
at gtc.run(PG:1)
at gsw.f(PG:2)
at gsv.run(PG:6)
Suppressed: gnv: [gpc{Cancelling}#66fb9dc, Dispatchers.IO]
It works fine on android API level 31 and the crash only happens on level 29. Does anybody have any idea what is causing this error?
Apparently it is a device dependent problem and the issue is reported on ARCore github.
https://github.com/google-ar/arcore-android-sdk/issues/1261
I have recently installed Android Studio on my new setup. However, it keeps on crashing unexpectedly at random times, without warning.
The same exception keeps happening during the crash:
2022-01-13 15:23:06,066 [ 85372] WARN - util.DeprecatedMethodException - This method in 'com.intellij.codeInsight.daemon.LineMarkerInfo' is deprecated and going to be removed soon. Please use LineMarkerInfo(T, TextRange, Icon, Function, GutterIconNavigationHandler, Alignment, Supplier) instead
com.intellij.util.DeprecatedMethodException: This method in 'com.intellij.codeInsight.daemon.LineMarkerInfo' is deprecated and going to be removed soon. Please use LineMarkerInfo(T, TextRange, Icon, Function, GutterIconNavigationHandler, Alignment, Supplier) instead
at com.intellij.util.DeprecatedMethodException.report(DeprecatedMethodException.java:28)
at com.intellij.codeInsight.daemon.LineMarkerInfo.<init>(LineMarkerInfo.java:161)
at org.jetbrains.kotlin.idea.highlighter.KotlinSuspendCallLineMarkerProvider$SuspendCallMarkerInfo.<init>(KotlinSuspendCallLineMarkerProvider.kt:32)
at org.jetbrains.kotlin.idea.highlighter.KotlinSuspendCallLineMarkerProvider.collectSlowLineMarkers(KotlinSuspendCallLineMarkerProvider.kt:77)
at com.intellij.codeInsight.daemon.impl.LineMarkersPass.queryProviders(LineMarkersPass.java:182)
at com.intellij.codeInsight.daemon.impl.LineMarkersPass.lambda$doCollectInformation$3(LineMarkersPass.java:83)
at com.intellij.codeInsight.daemon.impl.Divider.divideInsideAndOutsideInOneRoot(Divider.java:81)
at com.intellij.codeInsight.daemon.impl.LineMarkersPass.doCollectInformation(LineMarkersPass.java:78)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:56)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:400)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1146)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:393)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:658)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:610)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:65)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:392)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:368)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:172)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:189)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:366)
at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:188)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
My machine is running on Ubuntu 21.10, and the Android Studio version is 2020.3.1 Patch 2, installed from snap(although the same problem happened when installed from the official website).
Thank you!
I'm starting in Android Jetpack Compose. I installed Canary, when I create an Empty Compose Activity and run it without changes (Hello Android!) I have the next error:
Process: com.example.jetpacktest2, PID: 24788
java.lang.AbstractMethodError: abstract method "void androidx.lifecycle.DefaultLifecycleObserver.onCreate(androidx.lifecycle.LifecycleOwner)"
at androidx.lifecycle.FullLifecycleObserverAdapter.onStateChanged(FullLifecycleObserverAdapter.java:36)
at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:354)
at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.java:196)
at androidx.compose.ui.platform.AndroidComposeView.onAttachedToWindow(AndroidComposeView.android.kt:808)
at android.view.View.dispatchAttachedToWindow(View.java:19855)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3597)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3604)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3604)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3604)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3604)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2376)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1993)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8459)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1256)
at android.view.Choreographer.doCallbacks(Choreographer.java:995)
at android.view.Choreographer.doFrame(Choreographer.java:887)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1224)
at android.os.Handler.handleCallback(Handler.java:900)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:219)
at android.app.ActivityThread.main(ActivityThread.java:8387)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)
I didn't modify anything, it is the base code created by Android. Any help is appreciated.
PS: I load others codes made it on Android Studio (Without compose) and it run without errors.
I have the same issue. It is the issue of android studio canary build. It is one of the kind of bug of Canary build. So its fix is easy and simple.
Do these steps:
Uninstall the canary Android Studio.
Download the latest Android Studio Release Candidate (2020.3.1 RC 1)
link: https://developer.android.com/studio/preview
It will now work fine as previously. I fixed my problem the same as this. It will work 100% gurrantee.
I'm following Kotlin Application for Android development by Google on Udacity (code here: https://github.com/udacity/andfun-kotlin-guess-it/ ), and IntelliJ shows a "Render problem" error whenever I try to access Design view of any fragment.xml file and doesnt show any layout elements (just a blank and blue screen). It also shows me this error:
java.lang.NoClassDefFoundError: sun/misc/Cleaner
at libcore.util.NativeAllocationRegistry.registerNativeAllocation_Original(NativeAllocationRegistry.java:130)
at libcore.util.NativeAllocationRegistry_Delegate.registerNativeAllocation(NativeAllocationRegistry_Delegate.java:66)
at libcore.util.NativeAllocationRegistry.registerNativeAllocation(NativeAllocationRegistry.java:119)
at android.os.Binder.<init>(Binder.java:404)
at com.android.internal.view.IInputMethodClient$Stub.<init>(IInputMethodClient.java:18)
at android.view.inputmethod.InputMethodManager$1.<init>(InputMethodManager.java:606)
at android.view.inputmethod.InputMethodManager.<init>(InputMethodManager.java:606)
at android.view.inputmethod.InputMethodManager_Delegate.getInstance(InputMethodManager_Delegate.java:43)
at android.view.inputmethod.InputMethodManager.getInstance(InputMethodManager.java:681)
at com.android.layoutlib.bridge.impl.RenderAction.setUp(RenderAction.java:245)
at com.android.layoutlib.bridge.impl.RenderAction.init(RenderAction.java:133)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.init(RenderSessionImpl.java:163)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:383)
at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:193)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:511)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$4(RenderTask.java:640)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassNotFoundException: sun.misc.Cleaner PluginClassLoader[org.jetbrains.android, 10.3.3] com.intellij.ide.plugins.cl.PluginClassLoader#25058ce2
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:75)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 22 more
I already tried Invalidating Caches and restarting the application, Clean project, Re-syncing Gradle and changing different settings in Design View, such as API Level and App Theme.
I'm working with Android API 28 and Java version 1.8
I would like to be able to work with Design View tab and make the error go away.
There should be a fix in the new version of Intellij IDEA
See https://youtrack.jetbrains.com/issue/IDEA-219113#focus=streamItem-27-3621529.0-0
Post of Dmitry Jemerov
BR Wolfgang
Recently I installed new version of intellij idea and i tried to update classpath (in build.gradle :application) to
'com.android.tools.build:gradle:3.4.2'
after that i can't see or edit any views in design tab. text tab is working completely but design in not working.
unfortunately i cant upload image because of reputation.
but know that the page is only showing me a blanked screen of phone.
I tried to return classpath to version 3.4.0 but that did not worked too.
I changed style from
Theme.AppCompat.Light.DarkActionBar
to
Base.Theme.AppCompat.Light.DarkActionBar .
that didn't worked too.
I received this message in Render problem from warnings and errors tab:
java.lang.NoClassDefFoundError: sun/misc/Cleaner
at libcore.util.NativeAllocationRegistry.registerNativeAllocation_Original(NativeAllocationRegistry.java:130)
at libcore.util.NativeAllocationRegistry_Delegate.registerNativeAllocation(NativeAllocationRegistry_Delegate.java:66)
at libcore.util.NativeAllocationRegistry.registerNativeAllocation(NativeAllocationRegistry.java:119)
at android.os.Binder.<init>(Binder.java:404)
at com.android.internal.view.IInputMethodClient$Stub.<init>(IInputMethodClient.java:18)
at android.view.inputmethod.InputMethodManager$1.<init>(InputMethodManager.java:606)
at android.view.inputmethod.InputMethodManager.<init>(InputMethodManager.java:606)
at android.view.inputmethod.InputMethodManager_Delegate.getInstance(InputMethodManager_Delegate.java:43)
at android.view.inputmethod.InputMethodManager.getInstance(InputMethodManager.java:681)
at com.android.layoutlib.bridge.impl.RenderAction.setUp(RenderAction.java:245)
at com.android.layoutlib.bridge.impl.RenderAction.init(RenderAction.java:133)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.init(RenderSessionImpl.java:163)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:383)
at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:193)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:511)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$4(RenderTask.java:640)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassNotFoundException: sun.misc.Cleaner PluginClassLoader[org.jetbrains.android, 10.3.3] com.intellij.ide.plugins.cl.PluginClassLoader#b45afd8
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:75)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 22 more
please help me
It's a known issue that will be fixed in 2019.2.2 version. Right now you can use Android Studio or the previous IntelliJ IDEA release.
they actually tried to fix this issue in IntelliJ IDEA 2019.2.1 and somehow they did.
but jetbrains technicians made another issue.same error but this time attributes tab can't be loaded.
for now best new version we can use is 2019.2 jbr8