简体   繁体   English

android studio gradle中的渲染错误相关

[英]Rendering error in android studio gradle related

I'm trying to use this lib (tokenautocomplete) from splitwise. 我正在尝试从splitwise使用此lib(tokenautocomplete)。

I inserted it on my build.gradle and it synced normally. 我将其插入到build.gradle中,并正常同步。

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: 顺便说一下,我在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:2.0.2@aar"
compile "com.google.android.gms:play-services-location:7.5.0"
compile "com.android.support:design:23.0.1"
}

This is because the TokenCompleteTextView in the library you are using is not properly configured to support Android Studio's preview. 这是因为您使用的库中的TokenCompleteTextView没有正确配置为支持Android Studio的预览。

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. 如果要支持Android Studio的预览窗格,则应向库的作者提交错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM