2017-12-02 16 views
0

これは私のAndroidManifest.xml私はアプリのテーマでの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> 

名前= "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> 
関連する問題