Reputation: 386
I'm trying to use this lib (tokenautocomplete) from splitwise.
I inserted it on my build.gradle and it synced normally.
But, when I try to use some dependency from this lib, like this for example:
<com.tokenautocomplete.TokenCompleteTextView
android:id="@+id/searchView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
I get the following rendering problem:
Rendering Problems
The following classes could not be instantiated:
- com.tokenautocomplete.TokenCompleteTextView (Open Class, Show Exception, Clear Cache)
Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE Exception Details java.lang.InstantiationException at java.lang.reflect.Constructor.newInstance(Constructor.java:526) 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)
I'm with this problem for a few hours, did my google searches and found nothing.
I would like some help.
By the way, my dependencies in my build.gradle look like this:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "com.android.support:support-v4:23.1.0"
compile "com.android.support:appcompat-v7:23.1.0"
compile "com.android.support:support-v13:23.0.+"
compile "com.beardedhen:androidbootstrap:2.0.0"
compile "com.splitwise:tokenautocomplete:2.0.2@aar"
compile "com.google.android.gms:play-services-location:7.5.0"
compile "com.android.support:design:23.0.1"
}
Upvotes: 0
Views: 165
Reputation: 67189
This is because the TokenCompleteTextView
in the library you are using is not properly configured to support Android Studio's preview.
The view will (presumably) still work fine if you run your app on a device or the emulator.
If you want support for Android Studio's preview pane, you should file a bug with the library's author.
Upvotes: 1