Problem when building APK

1

Just make an application and try to generate the corresponding apk but it gives me this error. Can someone help me correct this error?

This in my gradle file

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "24.0.2"
defaultConfig {
    applicationId "com.example.kevtho.applicacion"
    minSdkVersion 19
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
productFlavors {
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile('com.android.support:appcompat-v7:23.4.0') { exclude module: 'support-v4' }
compile('com.android.support:design:23.4.0') { exclude module: 'support-v4' }
androidTestCompile 'com.android.support:support-v4:23.4.0'
compile('com.google.android.gms:play-services:9.4.0') { exclude module: 'support-v4' }
testCompile 'junit:junit:4.12'
}

and this is the manifest

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>

<uses-feature android:name="android.hardware.bluetooth_le" android:required="false"/>

<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>

<application
    android:allowBackup="true"
    android:icon="@drawable/movitaxi_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"
        android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
    <meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="AIzaSyABeOQ2-PL0Zx6GpjsX6VkFwMj4AZ-8e-c" />

</application>

    
asked by Kevtho 22.11.2016 в 21:25
source

1 answer

1

This error is generated by duplicate classes, it is different each case, in the error marks the class LogWriter that is contained within the "support library V4".

I see that you use the support library but also loads dependencies of /libs ,

compile fileTree(include: ['*.jar'], dir: 'libs')

Verify that you do not have /libs within android-support-v4.jar .

    
answered by 22.11.2016 в 21:32