Error:Newer :Execution failed for task ':app:dexDebug'. com.android.ide.common.process.ProcessException

时间:2016-03-02 10:49:21

标签: android import build.gradle

Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/volume1/Android Studio/android-sdk-linux/build-tools/23.0.2/aapt'' finished with non-zero exit value 1

gradle:

     apply plugin: 'com.android.application'

android {

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/LGPL2.1'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/notice.txt'
    }
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.ibussinesscard"
        multiDexEnabled true
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'


   // compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:appcompat-v7:23.1.0'

}

-- I have tried all possible solution available on stack-overflow and on Google..

-- I have issue in resolving imports..

--Rebuild or clean or changing buildToolVersion is not working for me

-- Restarting or build-->Make project is also not working for me

-- multiDexEnabled true is also not working

enter image description here

4 个答案:

答案 0 :(得分:1)

I think that you should try to change: compile 'com.android.support:appcompat-v7:23.1.1' to compile 'com.android.support:appcompat-v7:23.0.2' It worked for me.

答案 1 :(得分:1)

添加

  1. multiDexEnabled true

  2. 致电v7:23.1.0

  3. 试试这个

     android {
        compileSdkVersion 23
        buildToolsVersion "23.0.2"
    
        defaultConfig {
            applicationId "com.ibussinesscard"
            minSdkVersion 16
            targetSdkVersion 23
            versionCode 1
            versionName "1.0"
            multiDexEnabled true
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        testCompile 'junit:junit:4.12'
        compile 'com.android.support:appcompat-v7:23.1.0'
    
    }
    

    然后 Clean-Rebuild-Sync 您的项目。

答案 2 :(得分:1)

import android.graphics.Typeface;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.widget.TextView;

import com.google.android.gms.analytics.Tracker;
import com.icrea.findmymacros.fragment.FMMHome_Fragment;
import com.icrea.findmymacros.fragment.MealDetailsWithExistUser_Fragment;
import com.icrea.findmymacros.fragment.MyProfile_Fragment;
import com.icrea.findmymacros.fragment.AddMeal_Fragment;
import com.icrea.findmymacros.app.AppController;
import com.icrea.findmymacros.fragment.PastMealSubmission_Fragment;


import java.util.ArrayList;
import java.util.List;


public class Home_Activity extends AppCompatActivity {


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        try {
            super.onCreate(savedInstanceState);


    }


}

使用Appcompact扩展您的主要活动

答案 3 :(得分:0)

As you are running linux the issue might because Permissions try to provide Read-write permission to your aapt. Try below steps.

  1. Open Terminal
  2. chmod +777 "/volume1/Android Studio/android-sdk-linux/build-tools/23.0.2/aapt"
  3. Enter.

Try to rebuild the project now.