0

Here's the error:

 C:\Users\User\AndroidStudioProjects\FinalProject\app\src\main\res\values-v21\styles.xml
Error:(3, 5) No resource found that matches the given name: attr 'windowActionBar'.
Error:(3, 5) No resource found that matches the given name: attr 'windowNoTitle'.
C:\Users\User\AndroidStudioProjects\FinalProject\app\src\main\res\values\styles.xml
Error:(11, 5) No resource found that matches the given name: attr 'windowActionBar'.
Error:(11, 5) No resource found that matches the given name: attr 'windowNoTitle'.
Error:(4, 5) No resource found that matches the given name: attr 'colorAccent'.
Error:(4, 5) No resource found that matches the given name: attr 'colorPrimary'.
Error:(4, 5) No resource found that matches the given name: attr 'colorPrimaryDark'.
C:\Users\User\AndroidStudioProjects\FinalProject\app\build\intermediates\res\merged\debug\values\values.xml
Error:(31) Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
Error:(37) Error retrieving parent for item: No resource found that matches the given name 'ThemeOverlay.AppCompat.Dark.ActionBar'.
Error:(42) Error retrieving parent for item: No resource found that matches the given name 'ThemeOverlay.AppCompat.Light'.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\User\AppData\Local\Android\sdk\build-tools\23.0.2\aapt.exe'' finished with non-zero exit value 1

Furthermore my AndroidManifest.XML:

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

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

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>-->
        </activity>
        <activity
            android:name=".Login"
            android:label="@string/title_activity_login"
            android:theme="@style/AppTheme.NoActionBar">
            <!--
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>-->
        </activity>
        <activity
            android:name=".ReceiveOffer"
            android:label="@string/title_activity_receive_offer"
            android:theme="@style/AppTheme.NoActionBar">

                <!--<intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>-->
        </activity>
        <activity
            android:name=".PostReviews"
            android:label="@string/title_activity_post_reviews"
            android:theme="@style/AppTheme.NoActionBar">

            <!--<intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>-->
        </activity>
        <activity
            android:name=".PostComplaints"
            android:label="@string/title_activity_post_complaints"
            android:theme="@style/AppTheme.NoActionBar">

            <!--<intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>-->
        </activity>
        <activity
            android:name=".RegistrationV"
            android:label="@string/title_activity_registration_v"
            android:theme="@style/AppTheme.NoActionBar">
        <!--
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>-->
        </activity>
        <activity
            android:name=".LoginV"
            android:label="@string/title_activity_login_v"
            android:theme="@style/AppTheme.NoActionBar">

       <!-- <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>-->
        </activity>
        <activity
            android:name=".ProvideOffer"
            android:label="@string/title_activity_provide_offer"
            android:theme="@style/AppTheme.NoActionBar">

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".RegActivity"
            android:label="@string/title_activity_reg"
            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>

My mainactivity.java:

 package com.example.user.finalproject;

    import android.app.Activity;
    import android.os.Bundle;
    import android.support.design.widget.FloatingActionButton;
    import android.support.design.widget.Snackbar;
    import android.support.v7.app.AppCompatActivity;
    import android.support.v7.widget.Toolbar;
    import android.view.View;
    import android.view.Menu;
    import android.view.MenuItem;
    import android.view.ViewGroup.LayoutParams;

    public class MainActivity extends AppCompactActivity {


        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
            setSupportActionBar(toolbar);

            FloatingActionButton fab = (FloatingActionButton)    findViewById(R.id.fab);
            fab.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                            .setAction("Action", null).show();
                }
            });
        }

        @Override
        public boolean onCreateOptionsMenu(Menu menu) {
            // Inflate the menu; this adds items to the action bar if it is present.
            getMenuInflater().inflate(R.menu.menu_main, menu);
            return true;
        }

        @Override
        public boolean onOptionsItemSelected(MenuItem item) {
            // Handle action bar item clicks here. The action bar will
            // automatically handle clicks on the Home/Up button, so long
            // as you specify a parent activity in AndroidManifest.xml.
            int id = item.getItemId();

            //noinspection SimplifiableIfStatement
            if (id == R.id.action_settings) {
                return true;
            }

            return super.onOptionsItemSelected(item);
        }
    }

Also this thing happened for don't know what reason.

Please suggest some solutions as i have tried: 1. Installing new Android Studio 2. Cleaning the project. 3. Gradle build.

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>

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

<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.NoActionBar" />

<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

App level build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.2'

defaultConfig {
    applicationId "com.example.user.finalproject"
    minSdkVersion 19
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.3'
    defaultConfig {
        applicationId "com.example.user.finalproject"
        minSdkVersion 19
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}
dependencies {

compile 'com.android.support:appcompat-v7:23.0.3-alpha2'
compile 'com.android.support:design:23.0.3-alpha2'
compile 'com.android.support:support-annotations:23.0.3-alpha2'
compile 'com.android.support:support-v4:23.0.3-alpha2'
compile 'com.android.support:support-v13:23.0.3-alpha2'
compile 'com.android.support:gridlayout-v7:23.0.3-alpha2'
compile 'com.android.support:mediarouter-v7:23.0.3-alpha2'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.android.gms:play-services-ads:8.4.0'
compile 'com.google.android.gms:play-services-auth:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.3'

}

}

The error shown in gradle build is this: Cannot read package Name from C:\Users\User\AndroidStudioProjects\FinalProject\app\src\main\ AndroidManifest.xml

Now there is this error:

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\User\AppData\Local\Android\sdk\build-tools\23.0.3\aapt.exe'' finished with non-zero exit value 1

3 Answers3

0

You should go to res/values/styles.xml and change this line :

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

to the :

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
majid
  • 812
  • 1
  • 12
  • 36
0

can you add build.gradle file ? here are some reference link link2 link3 link4

EDIT

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.1'
}

your dependencies are empty.

Community
  • 1
  • 1
Nilesh Deokar
  • 2,975
  • 30
  • 53
  • Here it is build.gradle: 'code' // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.1.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } } task clean(type: Delete) { delete rootProject.buildDir } – JAY TRIVEDI Apr 30 '16 at 08:45
  • app level build.gradle and you can edit the ans with same – Nilesh Deokar Apr 30 '16 at 08:52
  • I am extremely sorry i did that in hurry! – JAY TRIVEDI Apr 30 '16 at 08:56
  • Still didn't get it @ndeokar – JAY TRIVEDI Apr 30 '16 at 10:03
  • refer to Akhil's ans as well he had mentioned same – Nilesh Deokar May 02 '16 at 10:02
0

I am guessing the error is at

<style name="AppTheme.NoActionBar">

Change it to

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

or any other Theme already available from android(for the parent attribute). In first case you just created a new style named "AppTheme.NoActionBar". But in order to create a new style you have to specify a parent Style(provided by android) in the parent attribute.

UPDATE

Your dependencies section is empty. That's what causing the error. Add

compile fileTree(dir: 'libs', include: ['*.jar']) 
testCompile 'junit:junit:4.12' 
compile 'com.android.support:appcompat-v7:23.2.1'

inside the dependencies{} in your gradle file. Sorry i didn't notice it before.

Akhil Soman
  • 2,077
  • 2
  • 17
  • 30
  • No it didn't help, instead it too became an error.@AkhilSoman – JAY TRIVEDI Apr 30 '16 at 16:05
  • I have updated the dependencies, please have a look. @Akhil Soman – JAY TRIVEDI May 06 '16 at 08:56
  • First **Clean and then Rebuild** your project(BUILD->Clean Project and then Build->Rebuild Project) . If you are still getting the Error, and a "cannot find symbol R" error, then check all your xml files for any wrong references, like using reference to an image that doesnot exist in your resource folder. Check if all the name of the resources in your resource folder(image, video, mp3 etc) are in small letters(also check the file extension also). I mean if the file name is like : image.JPG(instead of image.jpg) an error might occur. – Akhil Soman May 06 '16 at 11:12
  • Hey Akhil i am so sorry i am updating this late but i solved my error by switching back to an old buildSDKversion! Thank you so much for helping me out! – JAY TRIVEDI May 06 '16 at 19:14