2015-10-21 83 views
0

我試圖從splitwise使用這個lib(tokenautocomplete)。android studio gradle中的渲染錯誤

我把它插在我的build.gradle上,它正常同步。

但是,當我嘗試使用一些依賴從這個lib下,像這樣的例子:

<com.tokenautocomplete.TokenCompleteTextView 
     android:id="@+id/searchView" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" /> 

我得到以下渲染問題:

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)

我這個問題幾個小時,我的谷歌搜索,沒有發現任何東西。

我想要一些幫助。

順便說一句,我在我的build.gradle依賴關係是這樣的:

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:[email protected]" 
compile "com.google.android.gms:play-services-location:7.5.0" 
compile "com.android.support:design:23.0.1" 
} 

回答

1

這是因爲在庫中的TokenCompleteTextView您使用未正確配置,以支持Android Studio的預覽。

如果您在設備或模擬器上運行應用程序,該視圖(大概)仍然可以正常工作。

如果您想要支持Android Studio的預覽窗格,您應該向圖書館的作者提交一個錯誤。