-
Notifications
You must be signed in to change notification settings - Fork 147
NullPointerException in Android Studio layout preview #15
Comments
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? |
Sorry I'm actually also running 0.3.2 where I see the NPE. Here's the EnhancedListView XML if it helps: <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/parentLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<de.timroes.android.listview.EnhancedListView
android:id="@id/android:list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/adLayout"
android:layout_alignParentTop="true" />
<TextView
android:id="@id/android:empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center"
android:text="@string/main_no_gifts" >
</TextView>
<RelativeLayout
android:id="@+id/adLayout"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true" >
</RelativeLayout>
</RelativeLayout> |
I also have this problem.
Part of a list fragment so the XML is simple: <?xml version="1.0" encoding="utf-8"?>
<de.timroes.android.listview.EnhancedListView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fastScrollEnabled="true" /> |
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. |
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. |
Null pointer exception doesn't seem to be fixed in 0.1.3 - validate this. |
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)
The text was updated successfully, but these errors were encountered: