0

Hello I have a problem in my Android Studio :

Error:Gradle: Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Hady\AppData\Local\Android\Sdk\build-tools\19.1.0\aapt.exe'' finished with non-zero exit value 1

I try all but I can't solve this problem ..

My gradle file is like this :

apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion '19.1.0'

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 19
    }
}

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

enter image description here

My AndroidManifest.xml :

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="hadi.calculator">
    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="16" />
    <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">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

</manifest>
Vini.g.fer
  • 11,639
  • 16
  • 61
  • 90
Programmer
  • 54
  • 1
  • 2
  • 9

4 Answers4

1

It looks like you may have a typo in activity_main.xml: layout_heig8t

Correcting the typo in your resource should clear it up.

Rein S
  • 889
  • 6
  • 18
1

like Dalija said it's a result of a build.gradle dependencies conflict so please update your compileSdkVersion and buildToolsVersion to newest one. Also you could (but this is highly not recommended) downgrade your support library version

Feel free to take a look at this issue: Gradle finished with non zero exit value

EDIT: Check also spelling of words to avoid mistakes like heigh8t

Community
  • 1
  • 1
piotrek1543
  • 19,130
  • 7
  • 81
  • 94
  • please can you tell me how to update compileSdkVersion and buildToolsVersion – Programmer Dec 07 '15 at 21:02
  • Change your `buld.gradle` file like @dalija-prasnikar does. Next, open your `sdk manager` by clicking [this icon](http://documentation.kii.com/en/samples/push-notifications/push-notifications-android/configure-eclipse/as_toolbar_sdk_manager.png) and finally choose `Launch Standalone SDK Manager`. Check if `Android SDK Build tools` you installed are in the newest version. Than `Build -> Rebuild project` – piotrek1543 Dec 07 '15 at 21:12
  • If you have still a problem please update your screenshot or put in comment or next post a part of an app log with definition of issue – piotrek1543 Dec 07 '15 at 21:18
  • I see that problem you have is not only in layout, but also in Java class. Did you try to `Rebuild project`? Please add in next post full content of your `build gradle` file – piotrek1543 Dec 07 '15 at 22:27
0

You are using appcompat-v7:23.1.1, you should upgrade your build tools and SDK versions to the latest.

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.2'

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 23
    }
}

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

You can also remove SDK from Android manifest, because Gradle settings will override them and they are not needed.

<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="16" />

Additionally, pay attention to typos like heig8t, and take time to read and understand what error message is trying to tell you. Most of the times the answer will be right there.

If it says No resource identifier found for attribute layout height.. then it means that you have most likely spelled out layout height wrong. In this case it should be android:layout_height

Dalija Prasnikar
  • 27,212
  • 44
  • 82
  • 159
  • Still not working , please see the photo i add it to the question – Programmer Dec 07 '15 at 20:46
  • I added additional explanations. But if you ask question and answer resolves your primary error you should go and ask another question about new error (after you Google it first). This question has turned out to be endless debugging session and this is not how SO works. – Dalija Prasnikar Dec 08 '15 at 10:31
0

Please Open File-> Invalidate Cache/Restart the Android Studio It works fine