2015-11-19 32 views
0

我剛剛在OS X(10.10.5)上安裝了最新的Android Studio 1.4.1。當我創建空白活動時,我收到由Android Studio自行生成的源代碼導致的錯誤。最新Android Studio中的WindowDecorActionBar錯誤

誤差可以看出,在所附截圖:

enter image description here

可能存在AppCompatActivity和其他的東西之間的衝突。

這是AS產生的Activity

import android.support.v7.app.AppCompatActivity; 
import android.os.Bundle; 

public class ScanActivity extends AppCompatActivity { 

    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.activity_scan); 
    } 
} 

與下面的XML的佈局:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" 
    android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    android:paddingTop="@dimen/activity_vertical_margin" 
    android:paddingBottom="@dimen/activity_vertical_margin" 
    tools:context="it.informagica.mywings.ScanActivity"> 

</RelativeLayout> 

編譯設置如下的:

enter image description here

enter image description here

而且依賴是這些:

enter image description here

我想我已經安裝了所有的SDK平臺和SDK工具,我需要的。但是,我有這個錯誤,我不知道如何解決它。

任何幫助?

+0

這可能是相同的問題:http://stackoverflow.com/questions/33742114/rendering-problems-the-following-classes-could-not-be-found-android-support-v7 –

+0

有關信息,最新的android工作室2.0預覽2 http://tools.android.com/download/studio/builds/2-0-preview-2 – Context

回答

2
在style.xml變化

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> 

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> 
0

我有此異常爲Android Studio版本1.5。 我所做的一切是在style.xml改變

只要變更樣式父爲母公司= 「Theme.AppCompat.Light.NoActionBar」

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> 

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> 

我的天堂」找到其他更好的選擇,如果您有任何一個人有更好的選擇來解決問題,請告訴我們。