2017-06-10 5 views
1

私はしばらくの間googledしています。レイアウトをAPI19(Android 4.4.2)に切り替えるときにエラーが発生しました

mono.android.DesignerException: java.lang.NullPointerException at mono.android.DesignerException.fromThrowable(DesignerException.java:46) at mono.android.DesignerSession.checkRenderResultForError(DesignerSession.java:187) at mono.android.DesignerSession.load(DesignerSession.java:239) at mono.android.DesignerSession.processMessage(DesignerSession.java:702) at mono.android.MessageListener.executeMessage(MessageListener.java:88) at mono.android.MessageListener$Runner.run(MessageListener.java:44) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NullPointerException at android.content.res.Resources_Delegate.disposeSystem(Resources_Delegate.java:85) at com.android.layoutlib.bridge.android.BridgeContext.disposeResources(BridgeContext.java:264) at com.android.layoutlib.bridge.impl.RenderAction.tearDown(RenderAction.java:257) at com.android.layoutlib.bridge.impl.RenderAction.release(RenderAction.java:220) at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:438) at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:368) at mono.android.DesignerSession.load(DesignerSession.java:233) ... 4 more

これはMain.axmlファイルです:私の問題は、私はAPIバージョン19にレイアウトを変更しようとすると、私は、このエラーがスローされるツール、

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    tools:gridSpec="1|8|#0093eeff|K:#ee8700ff:16,l:72,l:16,r|S:#83ee00ff:16,0,l:16,56,l:16,0,r" 
    android:minWidth="25px" 
    android:minHeight="25px"> 
    <Button 
     android:text="Hello world" 
     android:layout_width="match_parent" 
     android:layout_height="259.5dp" 
     android:id="@+id/button1" 
     android:onClick="btnOneClick" /> 
</LinearLayout> 

私はエキストラをインストールしようとSDK 19からAPI 19を取得しましたが、何も動作していません。これがなぜ起こったのか誰かを知っていますか?

答えて

0

同じエラーが発生しましたが、私は助けたthis thread hereが見つかりました。 OlafBが私を助け半押しについての応答を掲示:プロジェクトのプロパティの[アプリケーション]タブの[(ターゲットフレームワーク)設定:

I changed the application to another API level and it now displays correctly in the Designer. Not sure what the problem was/is.

I had the 'Compile using Android version' set to API 19. When I changed it to Android 6.0, the designer works, even though the Minimum Android Version and Targeted Android Version are still API 19 (Android 4.4.2).

彼は変更話していることのオプションは、Androidのバージョンを使用してコンパイルです。 彼が話している他の設定は、プロパティの「Android Manifest」セクションにあります。 私の場合、私は現在「テスト中」のバージョンなので、「Compile using ...」設定をAndroid 4.1に変更しました。

関連する問題