所以很好,但我正在嘗試添加這個(gè)庫 這個(gè)https://github.com/wdullaer/MaterialDateTimePicker
implementation 'com.wdullaer:materialdatetimepicker:4.0.1'
突然,當(dāng)我同步我的Graddle時(shí),它給了我這個(gè)錯(cuò)誤
Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:10:5-53:19 to override.
即使我在我的Manifest中添加了這個(gè)建議
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas./apk/res/android"
xmlns:tools="http://schemas./tools"
package="com.itt.ceatm">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:replace="android:appComponentFactory"> // HERE
<activity...
我無法完成它,因?yàn)楝F(xiàn)在我收到了這個(gè)錯(cuò)誤
Manifest merger failed with multiple errors, see logs
這是我的完整清單
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.itt.ceatm"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
android.defaultConfig.vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.mikhaellopez:circularimageview:3.2.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
implementation 'com.github.ganfra:material-spinner:2.0.0'
implementation 'com.wdullaer:materialdatetimepicker:4.0.1' //NEW LIBRARY
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-
core:3.0.2'}
有什么建議嗎?我已經(jīng)做了一項(xiàng)研究,試圖完成包括configureall和其他的塊代碼在內(nèi)的工作,但沒有成功.我卡住了
或者甚至可以贊賞具有材料設(shè)計(jì)的DatePicker庫的另一個(gè)推薦
編輯 – 解決方案: 感謝所有btw 所以降級庫是好的,但后來它給了我這個(gè)錯(cuò)誤
Error about different versions support(由于我的水平我不能直接說,對不起)
然后我做了一個(gè)研究,并添加了這兩個(gè)新的實(shí)現(xiàn)
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.android.support:support-v13:28.0.0' //THIS
implementation 'com.android.support:support-media-compat:28.0.0' //AND THIS
implementation 'com.mikhaellopez:circularimageview:3.2.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
implementation 'com.github.ganfra:material-spinner:2.0.0'
implementation "com.wdullaer:materialdatetimepicker:3.6.4"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-
core:3.0.2'}
然后我就可以毫無錯(cuò)誤地使用該庫
再次感謝所有人! 解決方法: 日期選擇器將androidx作為依賴項(xiàng).降級到版本3.6.4將使它再次依賴于android.support – 或升級您的應(yīng)用程序以使用androidx.見issue 543.
// https:///artifact/com.wdullaer/materialdatetimepicker
implementation "com.wdullaer:materialdatetimepicker:3.6.4"
^這將是修復(fù)沖突依賴項(xiàng)的最簡單方法. 來源:http://www./content-1-228651.html
|