Rendering issue in XML preview : Unable to locate mode 0 [duplicate] Rendering issue in XML preview : Unable to locate mode 0 [duplicate] android android

Rendering issue in XML preview : Unable to locate mode 0 [duplicate]


That's problem with RecyclerView in com.android.support:design:25.0.0

Maybe there is some issue in that version.Changed version to 24.1.1 solved my problem.

compile 'com.android.support:appcompat-v7:24.1.1'compile 'com.android.support:support-v13:24.1.1'compile 'com.android.support:design:24.1.1'

in case you not have not removed the default provided gradle imports change this also

androidTestCompile 'com.android.support:support-annotations:24.2.1'


Either downgrade to v24

OR

The following is neither a solution nor a work around.

If you ONLY want to see the PREVIEW, add app:layoutManager="0" for the recyclerView in a layout XML.

Adding this will throw runtime InflateException. So, please remove that property from XML layout file before running the app.


Just change your compileSdkVersion to 24 and downgrade the dependencies:

compile 'com.android.support:appcompat-v7:24.2.1'compile 'com.android.support:design:24.2.1'compile 'com.android.support:recyclerview-v7:24.2.1'compile 'com.android.support:cardview-v7:24.2.1'

That's it.