Android Studio Rendering Problems without message - android

I'm an Android Studio user who has recently experienced the Rendering Problem...
Usually when there is a rendering problem, all cases that I searched have messages - type missing, known bug, etc.
However, there was no error message for my case, and it just says, "Rendering Problems."
I tried many things like:
Converting API Versions
Rebuild / Refresh
Invalidating Cashe
SDK Version Update
Remaking the XML files
Restarting the project / Rebooting
And plenty of not useful solutions
And the following detail is shown below:
java.lang.NullPointerException
at android.graphics.Paint_Delegate.reset(Paint_Delegate.java:1238)
at android.graphics.Paint_Delegate.<init>(Paint_Delegate.java:1179)
at android.graphics.Paint_Delegate.nInit(Paint_Delegate.java:675)
at android.graphics.Paint.nInit(Paint.java)
at android.graphics.Paint.<init>(Paint.java:457)
at android.graphics.drawable.ColorDrawable.<init>(ColorDrawable.java:47)
at com.android.layoutlib.bridge.impl.ResourceHelper.getDrawable(ResourceHelper.java:357)
at com.android.layoutlib.bridge.impl.ResourceHelper.getDrawable(ResourceHelper.java:262)
at com.android.layoutlib.bridge.impl.Layout.<init>(Layout.java:125)
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)

Related

Error:Android Source Generator: IndexOutOfBoundsException after PC crash

My PC has crashed occasionally, and after restart I got this, and can't run my project. What do to, who knows?
UPDATED for moderator: this is definitely Android Studio bug, so appropriate tag is important for whose who will search the same. The cause is in Android Studio's .idea file, I assume for now.
Error:Android Source Generator: Error:
java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsException at
java.io.ByteArrayInputStream.read(ByteArrayInputStream.java:180) at
com.intellij.util.io.CompressedAppendableFile$SegmentedChunkInputStream.read(CompressedAppendableFile.java:541)
at java.io.DataInputStream.readFully(DataInputStream.java:195) at
com.intellij.util.io.PersistentHashMapValueStorage.readBytes(PersistentHashMapValueStorage.java:401)
at
com.intellij.util.io.PersistentHashMap.doGet(PersistentHashMap.java:518)
at
com.intellij.util.io.PersistentHashMap.get(PersistentHashMap.java:472)
at
org.jetbrains.jps.incremental.storage.AbstractStateStorage.getState(AbstractStateStorage.java:117)
at
org.jetbrains.jps.android.AndroidSourceGeneratingBuilder.runAaptCompiler(AndroidSourceGeneratingBuilder.java:913)
at
org.jetbrains.jps.android.AndroidSourceGeneratingBuilder.doBuild(AndroidSourceGeneratingBuilder.java:210)
at
org.jetbrains.jps.android.AndroidSourceGeneratingBuilder.build(AndroidSourceGeneratingBuilder.java:114)
at
org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1237)
at
org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:911)
at
org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:983)
at
org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:870)
at
org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:696)
at
org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:387)
at
org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:194)
at
org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:138)
at
org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:294)
at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:125)
at
org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$1.run(BuildMain.java:232)
at
org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:44)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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)
The answer is: delete .idea folder
Or better move it first to somewhere, on the case you forget something from configuration.
Android Studio 2.3.3

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: Rendering Problems when I open a project

I am having this issue with Rendering problems every time i open a project.
java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or descendant) with the design library.
at android.support.design.widget.ThemeUtils.checkAppCompatTheme(ThemeUtils.java:36)
at android.support.design.widget.CoordinatorLayout.<init>(CoordinatorLayout.java:192)
at android.support.design.widget.CoordinatorLayout.<init>(CoordinatorLayout.java:186)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:465)
at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:172)
at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:105)
at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:186)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:334)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:345)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:245)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
at android.view.LayoutInflater.inflate(LayoutInflater.java:495)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:324)
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$72(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)
Screenshot of the problem
I don't know how to fix it permanently, or why this is happening repeatedly.
I read up on it and someone suggested that I Change the theme to the following:
theme change
I did that, and it takes care of the problem for the session, but as soon as i close android studio ad open it back up again, i am greeted by the sae problem.
What am I doing wrong here?
How can I fix this for good?
Restart Android Studio by invalidating the caches
File → Invalidate Caches / Restart.
This may fix the issue.
For more information visit this site
Alternative Solution
Use a higher SDK as the minimum SDK like lollipop or marshmallow when building the project. If you really want to use a lower SDK as the minimum SDK, start from blank activity and develop from there onwards
on the very first line of your log cat its already telling you
java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or descendant) with the design library.
follow as it says.

AVD not getting started in Android Studio. IDE internal error occured

I imported one of my android project and tried to run it in a simulator. A soon i clicked the run button and ADB was about to initialize i saw a red balloon" An Internal error occured". Logs show the following error
null
java.lang.NullPointerException
at com.android.sdklib.internal.avd.AvdManager.parseAvdInfo(AvdManager.java:1514)
at com.android.sdklib.internal.avd.AvdManager.buildAvdList(AvdManager.java:1478)
at com.android.sdklib.internal.avd.AvdManager.<init>(AvdManager.java:373)
at com.android.sdklib.internal.avd.AvdManager.getInstance(AvdManager.java:411)
at com.android.tools.idea.avdmanager.AvdManagerConnection.initIfNecessary(AvdManagerConnection.java:159)
at com.android.tools.idea.avdmanager.AvdManagerConnection.getAvds(AvdManagerConnection.java:255)
at com.android.tools.idea.run.editor.DevicePicker.lambda$refreshAvds$496(DevicePicker.java:186)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:369)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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)
I tried alot with the solutions mentioned in other problems but all in vain
Any solution for this please
Attached is image also
I just solved this problem by delete all files in ~/.android/avd
but my avd still can't run properly.

Intellij IDEA: Rendering problems (Android)

Edit: I should have included more info, so here's more stuff (if more is needed let me know):
Windows 10
Intellij 15.0.6.
Any/all options in the preview window have been tried with the same "Rendering Problems" dialog.
OK, so right now I'm getting this error when trying to display the xml preview window: Rendering Problems - This version of the rendering library is more recent than your version of IntelliJ IDEA. Please update IntelliJ IDEA.
This question has been asked here a couple times before but I seem to be getting nowhere with those answers.
Intellij is at its latest version (determined from Help > Check for updates), everything in the Android SDK manager is up to date, and I've tried changing the preview window's API to a non-Preview API. Those three things were the old questions' answers. I don't know what to do next.
Here are the error details:
org.jetbrains.android.uipreview.RenderingException: This version of the rendering library is more recent than your version of IntelliJ IDEA. Please update IntelliJ IDEA
at org.jetbrains.android.uipreview.LayoutLibraryLoader.load(LayoutLibraryLoader.java:90)
at org.jetbrains.android.sdk.AndroidTargetData.getLayoutLibrary(AndroidTargetData.java:180)
at com.android.tools.idea.rendering.RenderService.createTask(RenderService.java:163)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.doRender(AndroidLayoutPreviewToolWindowManager.java:640)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.access$1700(AndroidLayoutPreviewToolWindowManager.java:80)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7$1.run(AndroidLayoutPreviewToolWindowManager.java:585)
at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:142)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:446)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:127)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7.run(AndroidLayoutPreviewToolWindowManager.java:580)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:337)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:327)
at com.intellij.util.ui.update.MergingUpdateQueue$3.run(MergingUpdateQueue.java:271)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:286)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:244)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:234)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:352)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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)

Categories

Resources