6

こんにちは、私はAndroidスタジオでレンダリングエラーが発生しています。誰かがこれがなぜ起こったのか知っていますか?レンダリングの問題レンダリング中に例外が発生しました:色と位置の配列は同じ長さでなければなりません

私のxml:

<!-- ListRow Left side Thumbnail image --> 

    <LinearLayout 
     android:id="@+id/thumbnail" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentLeft="true" 
     android:layout_marginRight="5dip" 
     android:background="@drawable/image_bg" 
     android:padding="0dip" > 

    <ImageView 
     android:id="@+id/list_image" 
     android:layout_width="50dip" 
     android:layout_height="50dip" 
     android:scaleType="centerCrop" 
      /> 
    </LinearLayout> 

    <TextView 
     android:id="@+id/title" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignTop="@+id/thumbnail" 
     android:layout_marginTop="0dip" 
     android:layout_toRightOf="@+id/thumbnail" 
     android:text="De Titel van het geweldige bericht" 
     android:textColor="#60a926" 
     android:textSize="15dip" 
     android:textStyle="bold" 
     android:ellipsize="end" 
     android:typeface="sans" /> 

    <TextView 
     android:id="@+id/subtitle" 
     android:layout_width="match_parent" 
     android:layout_height="25dp" 
     android:layout_below="@id/title" 
     android:layout_marginTop="0dip" 
     android:layout_toLeftOf="@+id/imageView1" 
     android:layout_toRightOf="@+id/thumbnail" 
     android:text="Nieuwsbericht subtitel mooi iets ..." 
     android:textStyle="bold" 
     android:ellipsize="end" 
     android:textColor="#9f9e9f" 
     android:textSize="10dip" /> 


    <ImageView 
     android:id="@+id/imageView1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentRight="true" 
     android:layout_centerVertical="true" 
     android:src="@drawable/arrow" /> 

    <!-- datum van bericht --> 
    <TextView 
     android:id="@+id/date" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignLeft="@+id/artist" 
     android:layout_alignTop="@+id/imageView1" 
     android:layout_marginTop="18dp" 
     android:layout_marginLeft="175dp" 
     android:gravity="right" 
     android:text="" 
     android:textColor="#ffffff" 
     android:textSize="10dip" 
     android:textStyle="bold" /> 

</RelativeLayout> 

私はこのエラーを取得していプレビューを使用しています:

"Rendering Problems Exception raised during rendering: color and position arrays must be of equal length" 

これはAndroid Studioバグですか、私が何か間違ったことをやっていますか?

私は誰かが解決策を持っていることを願っています。

答えて

3

私はそれを解決しました。この問題は、偽のグラデーションスタイルファイルを使用することによって発生しました。グラデーションファイルを削除すると、私の問題が解決しました。

2

今日は2015年4月14日(15Apr14)です。 'レンダリング中にレンダリングの問題が発生しました'

ここは私の仕事です。

Android SDKマネージャが19,19.1,22、および24.1.2をダウンロードしました。 22.0.0はSDKマネージャには表示されません。私はGradleのスクリプト「の下build.gradle(モジュールのApp) 『クリック』のAndroid Studioのライン

コンパイル変更 『COM』 コンパイル へ」にcom.android.support:appcompat-v7:22.0.0をダブル.android.support:appcompat-v7:19.1 '

レンダラーの上のドロップダウンメニューで、小さなAndroid(「Androidバージョンを使用する...」ドロップダウンメニューからマウスオーバー)アイコンの横にあるドロップダウンメニュー'API 19:Android 4.4.2'

レンダリングが機能しました。

buildToolsVersion "19.1.0"

targetSdkVersion

3

19を、私は上のプレビューをdisabelingことで、この問題を解決:

以前は、同じスクリプトのターゲットバージョンでは、ツールのバージョンをビルドするには19に設定されましたAndroidのプレビュー版ですこの

アンドロイドN.同様 も

16

はまず最高の機能を選ぶ自動的に無効にできます。すべて

ザッツをレンダリングするための非プレビューAPIバージョンを選択して、私のために働いた:)

enter image description here

次に使用する際の問題を修正するために与えられた。また、この答えを

を(あなたは、画像の下に見ることができます)レンダリング用に更新されていないビルドツールバージョン。もう一つの問題を修正する方法:

オープンSDK Manager、あなたがレンダリングする際Build ToolsPreviewバージョンを使用したい場合はPreview ChannelBuild Toolsバージョンを更新。