2017-12-02 20 views
0

이 내 AndroidManifest.xml :I 앱 테마에 styles.xml에 오류가 오전

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
package="com.example.sammar.materialdeisgn"> 

<application 
    android:allowBackup="true" 
    android:icon="@mipmap/ic_launcher" 
    android:label="@string/app_name" 
    android:roundIcon="@mipmap/ic_launcher_round" 
    android:supportsRtl="true" 
    android:theme="@style/AppTheme.NoActionBar"> 
    <activity 
     android:name=".MainActivity" 
     android:label="YourAppName" 
     android:theme="@style/AppTheme.NoActionBar"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
</application> 

</manifest> 

그리고 이것은 내 styles.xml

<resources> 

<!-- Base application theme. --> 
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> 
    <!-- Customize your theme here. --> 
    <item name="colorPrimary">@color/colorPrimary</item> 
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item> 
    <item name="colorAccent">@color/colorAccent</item> 
</style> 

입니다 그리고 난 다음 무엇입니까 오류 :

1)Error:No resource found that matches the given name (at 'theme' with value '@style/AppTheme.NoActionBar'). 



2)Error:No resource found that matches the given name (at 'theme' with value '@style/AppTheme.NoActionBar'). 



3)Error:No resource found that matches the given name (at 'theme' with value '@style/AppTheme.NoActionBar'). 



4)Error:No resource found that matches the given name (at 'theme' with value '@style/AppTheme.NoActionBar'). 



5)Error:Execution failed for task ':app:processDebugResources'. 



> com.android.ide.common.process.ProcessException: Failed to execute 

aapt 

답변

0

매니페스트 스타일로 사용하지 선언 한

+0

그것은 일했다. 그러나 나는 문제가 무엇인지에 관해 이해할 수 없다. –

+0

괜찮습니다. –

+0

@SammarAhmad StackOverflow에서 대답을 수락하는 방법을 알고 있습니까? – Omi

0

사용해보기 :

<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar"> 
    <!-- Customize your theme here. --> 
    <item name="colorPrimary">@color/colorPrimary</item> 
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item> 
    <item name="colorAccent">@color/colorAccent</item> 
</style> 

응용 프로그램에 name = "AppTheme"이 사용되었을 수 있습니다. 그래서. 그래서 선 아래 그렇게

<style name="AppTheme.NoActionBar"> 
    <item name="windowActionBar">false</item> 
    <item name="windowNoTitle">true</item> 
</style> 

당신의 Style.xml 추가 NoActionBar 테마를 참조하지 않는 당신은 스타일의 조치 표시 줄, 다음 매니페스트에서 필요 그냥 매니페스트

<activity 
      android:name=".MainActivity" 
      android:label="YourAppName" 
      android:theme="@style/AppTheme"> 
+0

여전히 같은 오류가 발생합니다. –

0

모양은 다음과 같습니다.

<resources> 

<!-- Base application theme. --> 
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> 
    <!-- Customize your theme here. --> 
    <item name="colorPrimary">@color/colorPrimary</item> 
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item> 
    <item name="colorAccent">@color/colorAccent</item> 
</style> 
<style name="AppTheme.NoActionBar"> 
     <item name="windowActionBar">false</item> 
     <item name="windowNoTitle">true</item> 
    </style> 
</resources>