添加库后出错';蓝牙:AndroidBluetoothLibrary:1.0.1-SNAPSHOT';
我已经添加了这个库,但是当我想要构建用于调试的项目时,它会显示如下错误添加库后出错';蓝牙:AndroidBluetoothLibrary:1.0.1-SNAPSHOT';,android,build,bluetooth,dependencies,android-support-library,Android,Build,Bluetooth,Dependencies,Android Support Library,我已经添加了这个库,但是当我想要构建用于调试的项目时,它会显示如下错误 Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.api.transform.TransformException:java.util.zip.ZipException: duplicate entry: android/support/v4/util/DebugUtils
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException:java.util.zip.ZipException: duplicate entry: android/support/v4/util/DebugUtils.class
我什么都试过了
multiDexEnabled true
或
或
但对我不起作用
这是我的build.gradle文件依赖项
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile ('com.journeyapps:zxing-android-embedded:3.2.0@aar') {
exclude group: 'com.android.support', module: 'support-v4'
}
compile ('com.google.zxing:core:3.2.1'){
exclude group: 'com.android.support', module: 'support-v4'
}
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile ('com.ramimartin.bluetooth:AndroidBluetoothLibrary:1.0.1-SNAPSHOT') {
exclude group: 'com.android.support', module: 'support-v4'
}
}
感谢您的建议。gradel
默认配置{
...
明斯克版本14
targetSdkVersion 21
// Enabling multidex support.
multiDexEnabled true
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
}
显示
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.multidex.myapplication">
<application
...
android:name="android.support.multidex.MultiDexApplication">
...
</application>
</manifest>
// Enabling multidex support.
multiDexEnabled true
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.multidex.myapplication">
<application
...
android:name="android.support.multidex.MultiDexApplication">
...
</application>
</manifest>