naver / android-pull-to-refresh

Pull To Refresh Views for Android! v3.2.3
Apache License 2.0
310 stars 82 forks source link

Nullpointer on layout preview #32

Open mrzorn opened 10 years ago

mrzorn commented 10 years ago

I am getting rendering problems in the layout preview in Android Studio when using any of the views - in this example com.handmark.pulltorefresh.library.PullToRefreshListView.

Getting these able to display in the preview would certainly be helpful.

Rendering Problems The following classes could not be instantiated: - com.handmark.pulltorefresh.library.PullToRefreshListView (Open Class, Show Exception)

Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE

Exception Details

java.lang.NullPointerException
    at android.content.res.BridgeResources.getXml(BridgeResources.java:554)
    at com.handmark.pulltorefresh.configuration.xml.PullToRefreshXmlConfiguration.init(PullToRefreshXmlConfiguration.java:92)
    at com.handmark.pulltorefresh.library.PullToRefreshBase.init(PullToRefreshBase.java:1358)
    at com.handmark.pulltorefresh.library.PullToRefreshBase.<init>(PullToRefreshBase.java:201)
    at com.handmark.pulltorefresh.library.PullToRefreshAdapterViewBase.<init>(PullToRefreshAdapterViewBase.java:84)
    at com.handmark.pulltorefresh.library.PullToRefreshListView.<init>(PullToRefreshListView.java:50)
    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:379)
    at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:99)
    at com.android.tools.idea.rendering.LayoutlibCallback.loadView(LayoutlibCallback.java:172)
    at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:207)
    at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:132)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:806)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:809)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
    at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:401)
    at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:329)
    at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:333)
    at com.android.tools.idea.rendering.RenderService$5.compute(RenderService.java:674)
    at com.android.tools.idea.rendering.RenderService$5.compute(RenderService.java:663)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:932)
    at com.android.tools.idea.rendering.RenderService.createRenderSession(RenderService.java:663)
    at com.android.tools.idea.rendering.RenderService.render(RenderService.java:790)
    at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.doRender(AndroidLayoutPreviewToolWindowManager.java:611)
    at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.access$1900(AndroidLayoutPreviewToolWindowManager.java:81)
    at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7$1.run(AndroidLayoutPreviewToolWindowManager.java:553)
    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$7.run(AndroidLayoutPreviewToolWindowManager.java:548)
    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:327)
    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)
ncoolz commented 10 years ago

This issue was fixed on 3.2.2. Please use the latest version.

mrzorn commented 10 years ago

Excellent - thank you. I just copied the dependency from the quick start guide and didn't realize it wasn't the latest. Sorry for the erroneous error.