unable to see views in design tab in intellij idea - android

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

Related

ClassNotFoundException: android.view.OnBackInvokedCallback with Compose 1.2.0-alpha07

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

How to fix "Render problem", "java.lang.NoClassDefFoundError: sun/misc/Cleaner" in IntelliJ IDEA?

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

Gradle sync error using Navigation Component in base module

Using Navigation component alpha09 and have added apply plugin: "androidx.navigation.safeargs" to top of base module build.gradle but getting following error when doing gradle sync. I'm using Android Studio 3.4 Canary 9 (but also had same problem using 3.3 RC3)
It looks like a related fix was included in alpha09 - https://issuetracker.google.com/issues/119662045
Caused by: kotlin.TypeCastException: null cannot be cast to non-null type org.gradle.api.resources.TextResource
at androidx.navigation.safeargs.gradle.SafeArgsPlugin.setApplicationId(SafeArgsPlugin.kt:87)
at androidx.navigation.safeargs.gradle.SafeArgsPlugin.access$setApplicationId(SafeArgsPlugin.kt:39)
at androidx.navigation.safeargs.gradle.SafeArgsPlugin$apply$1$task$1.execute(SafeArgsPlugin.kt:63)
at androidx.navigation.safeargs.gradle.SafeArgsPlugin$apply$1$task$1.execute(SafeArgsPlugin.kt:39)
at org.gradle.api.internal.tasks.DefaultTaskContainer.create(DefaultTaskContainer.java:360)
at androidx.navigation.safeargs.gradle.SafeArgsPlugin$apply$1.invoke(SafeArgsPlugin.kt:59)
at androidx.navigation.safeargs.gradle.SafeArgsPlugin$apply$1.invoke(SafeArgsPlugin.kt:39)
at androidx.navigation.safeargs.gradle.SafeArgsPluginKt$sam$org_gradle_api_Action$0.execute(SafeArgsPlugin.kt)
at org.gradle.internal.ImmutableActionSet$SingletonSet.execute(ImmutableActionSet.java:225)
at org.gradle.api.internal.DefaultDomainObjectCollection.doAdd(DefaultDomainObjectCollection.java:247)
at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:236)
at com.android.build.gradle.LibraryExtension.addVariant(LibraryExtension.java:93)
at com.android.build.gradle.FeatureExtension.addVariant(FeatureExtension.java:121)
at com.android.build.gradle.internal.ApiObjectFactory.create(ApiObjectFactory.java:134)
Just updated to alpha11 and not seeing this issue any more. (https://developer.android.com/jetpack/androidx/releases/navigation#1.0.0-alpha11)
UPDATE
From comments below it looks like alpha11 didn't resolve issue for some people but beta1 did

Rendering Problems: Unable to find the layout for Action Bar solved

i found solution ,and i replace new 2.3.3 as ,and use 1.0.2
all of the question render problem solved!!!
Cause the problem that IDE AS 1.0.2 use actionbar !
But as2 etc looks like OLD ACTIONBAR DEPRECIATED!
I am making an Android app and trying to use an ActionBar.
I am getting the following error in the log:
UnsupportedMethodException
Unsupported method: AndroidProject.getPluginGeneration().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect to.
Alternatively, you can ignore this exception and read other information from the model.
And this error for the layout:
Rendering Problems Unable to find the layout for Action Bar.
Consider updating to a more recent version of appcompat, or switch the
rendering library in the IDE down to API 21 (Details) Tip: Try to
refresh the layout.
When I tried reducing the SDK version to 20 or 21 it did not help.
Has anyone been able to solve this?
The details about action bar? I guess it is ,but I am not sure?
 Rendering Problems (Details)
java.lang.RuntimeException: Unable to find the layout for Action Bar.
at com.android.layoutlib.bridge.bars.BridgeActionBar.<init>(BridgeActionBar.java:57)
at com.android.layoutlib.bridge.bars.AppCompatActionBar.<init>(AppCompatActionBar.java:59)
at com.android.layoutlib.bridge.impl.Layout.createActionBar(Layout.java:238)
at com.android.layoutlib.bridge.impl.Layout.<init>(Layout.java:150)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:301)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:429)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:389)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:548)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:533)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:966)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:533)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$70(RenderTask.java:659)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Android studio 2.2 preview 5 design editor/preview seem to be broken?

After updating from Android studio 2.2 preview 4 to 5, Design and Preview tabs stopped to show previews.
They don't show anything, only the error (described below) and a tip "Try to refresh the layout".
Refreshing and choosing different options in a top bar (API, device orientation) doesn't help.
Was trying File -> Invalidate Caches/Restart. Doesn't help either.
Any suggestions?
java.nio.file.InvalidPathException: Illegal char <:> at index 8: #android:drawable/ic_menu_send
at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
at java.nio.file.Paths.get(Paths.java:84)
at com.android.ide.common.res2.ResourceItem.parseFileName(ResourceItem.java:585)
at com.android.ide.common.res2.ResourceItem.parseXmlToResourceValue(ResourceItem.java:405)
at com.android.ide.common.res2.ResourceItem.getResourceValue(ResourceItem.java:240)
at com.android.ide.common.res2.AbstractResourceRepository.getConfiguredResources(AbstractResourceRepository.java:393)
at com.android.ide.common.res2.AbstractResourceRepository.getConfiguredResources(AbstractResourceRepository.java:349)
at com.android.tools.idea.configurations.ResourceResolverCache$1.compute(ResourceResolverCache.java:166)
at com.android.tools.idea.configurations.ResourceResolverCache$1.compute(ResourceResolverCache.java:163)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:966)
at com.android.tools.idea.configurations.ResourceResolverCache.getResourceResolver(ResourceResolverCache.java:163)
at com.android.tools.idea.configurations.Configuration.getResourceResolver(Configuration.java:1212)
at com.android.tools.idea.rendering.RenderTask.getResourceResolver(RenderTask.java:198)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:425)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$52(RenderTask.java:659)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
UPD1: Seem to be an issue.
In your activity.xml file there must be a line as xmlns:app="". Delete it.
There is an error in xml file check that no
android: or xmlns:app=""
Fixed in Android studio 2.2 (Canary) Preview 6 (also see issue).

Categories

Resources