0
我試圖使用這個目錄選擇器:Android-DirectoryChooser。 我試圖按照指示加入從Maven的中央,但得到這個錯誤:如何在android studio中導入Android-DirectoryChooser
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute [email protected] value=(@style/MyMaterialTheme.Base) from AndroidManifest.xml:15:5-48
is also present at [net.rdrei.android.dirchooser:library:3.2] AndroidManifest.xml:9:18-62 value=(@style/DirectoryChooserTheme).
Suggestion: add 'tools:replace="android:theme"' to <application> element at AndroidManifest.xml:9:1-40:15 to override.
的AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.audiorecorder.wel.voicerecorder">
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:launchMode="singleTop"
android:theme="@style/MyMaterialTheme.Base"
android:hardwareAccelerated="false"
android:largeHeap="true">
<activity android:name="voicerecorder.wel.audiorecorder.com.voicerecorder.MainActivity" android:windowSoftInputMode="adjustPan"> >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
</application>
</manifest>
的build.gradle(項目):
// 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.2.3'
classpath 'commons-io:commons-io:2.5'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
repositories {
mavenLocal()
}
構建。 gradle(模塊):
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.audiorecorder.wel.voicerecorder"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.2.0'
testCompile 'junit:junit:4.12'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:design:25.1.0'
compile "commons-io:commons-io:+"
compile 'net.rdrei.android.dirchooser:library:[email protected]'
}
如何解決此錯誤?我的項目和圖書館的主題存在問題。任何幫助,將不勝感激。