You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 26, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 26, 2023. It is now read-only.
NullPointerException in Android Studio layout preview #15
NullPointerException when viewing the layout in Android Studio 0.3.1. Otherwise everything works fine, so view this as an enhancement more than anything else. Thanks! (Sorry for the screenshot, seems that window of Android Studio doesn't allow copying)
java.lang.ClassNotFoundException: de.timroes.android.listview.R$layout
at com.intellij.util.lang.UrlClassLoader.findClass(UrlClassLoader.java:142)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at de.timroes.android.listview.EnhancedListView.init(EnhancedListView.java:361)
at de.timroes.android.listview.EnhancedListView.<init>(EnhancedListView.java:339)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:375)
at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:100)
at com.android.tools.idea.rendering.ProjectCallback.loadView(ProjectCallback.java:165)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:207)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:135)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:755)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:758)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:373)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:399)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:336)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:332)
at com.android.tools.idea.rendering.RenderService$2.compute(RenderService.java:538)
at com.android.tools.idea.rendering.RenderService$2.compute(RenderService.java:527)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:934)
at com.android.tools.idea.rendering.RenderService.createRenderSession(RenderService.java:527)
at com.android.tools.idea.rendering.RenderService.render(RenderService.java:598)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7.compute(AndroidLayoutPreviewToolWindowManager.java:577)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7.compute(AndroidLayoutPreviewToolWindowManager.java:570)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:945)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.doRender(AndroidLayoutPreviewToolWindowManager.java:570)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.access$1700(AndroidLayoutPreviewToolWindowManager.java:83)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$6$1.run(AndroidLayoutPreviewToolWindowManager.java:518)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)
at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:171)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$6.run(AndroidLayoutPreviewToolWindowManager.java:513)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:297)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
Alltough I tried to compile it and get following error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':activity:processDefaultFlavorDebugManifest'.
> Manifest merging failed. See console for more info.
Is there a fix for this Problem?
EDIT 17.12.13:
I did some additional research on this problem. It seems that this error encores on all three versions of this library, if you import it via MavenCentral.
So I tried to manage the libraries with the libs folder. Also there the same error encores with all of the three versions.
Activity
timroes commentedon Nov 4, 2013
Not occurring for me in 0.3.2. I will try to reproduce it in 0.3.1. Does it also occur after an update to 0.3.2 for you?
jfbibeau commentedon Nov 4, 2013
Sorry I'm actually also running 0.3.2 where I see the NPE.
Here's the EnhancedListView XML if it helps:
Raghnall commentedon Nov 28, 2013
I also have this problem.
Running Android Studio 0.3.6
Loading Enhanced list view via Maven with the following gradle dependencies:
Part of a list fragment so the XML is simple:
safarious commentedon Dec 16, 2013
I got the same Error with Android Studio 0.3.6, Grandle 0.6+. I imported Version 0.1.2 of your library via mavencentral like this:
This is the Error-Log from my layout:
Alltough I tried to compile it and get following error:
Is there a fix for this Problem?
EDIT 17.12.13:
I did some additional research on this problem. It seems that this error encores on all three versions of this library, if you import it via MavenCentral.
So I tried to manage the libraries with the libs folder. Also there the same error encores with all of the three versions.
safarious commentedon Dec 17, 2013
Allright I could sort out what is the problem causing, that you can't build or run the app:
The minSDK + targetSDK in your default Project is higher than the one in your library.
The Library is using minSDK="8" and targetSDK="18" so you need to update your build.grandle the following way:
The NullPointer in your Layoutfile is still there - but at least you can test your application.
timroes commentedon Dec 27, 2013
Null pointer exception doesn't seem to be fixed in 0.1.3 - validate this.