Ang*_*l R 7 android android-manifest build.gradle android-gradle-plugin
因此,所有的好,但我想添加这个库 https://github.com/wdullaer/MaterialDateTimePicker本
implementation 'com.wdullaer:materialdatetimepicker:4.0.1'
Run Code Online (Sandbox Code Playgroud)
当我同步我的Graddle时,突然出现了这个错误
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.
Run Code Online (Sandbox Code Playgroud)
即使我在清单中添加了该建议
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/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...
Run Code Online (Sandbox Code Playgroud)
我无法完成它,因为现在我收到此错误
Manifest merger failed with multiple errors, see logs
Run Code Online (Sandbox Code Playgroud)
这是我的完整清单
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'}
Run Code Online (Sandbox Code Playgroud)
有什么建议吗?我已经进行了一项研究,试图围绕包括configureall和其他模块的代码进行工作,但没有成功。我卡住了
甚至对带有材料设计的DatePicker库的另一推荐也将不胜感激
编辑-解决方案:感谢所有顺便说一句,降级的库是可以的,但是随后它给了我这个错误
关于不同版本支持的错误(由于级别原因,我无法直接将其放置,抱歉)
然后我进行了研究并添加了这两个新的实现
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'}
Run Code Online (Sandbox Code Playgroud)
然后我可以使用该库而不会出现错误
再次感谢所有人!
小智 5
您会收到此错误,因为您要导入的库基于androidx,这是对您所使用的支持库的重大改进。
现在,您提供三种解决方案:
使用另一个基于先前支持版本的日期选择器库(推荐和最佳方式)。
将您的支持库更改为androix。(推荐但很困难)
添加忽略工具(轻松出路)
这是我找到的链接: 日期选择器
implementation 'com.github.Kunzisoft:Android-SwitchDateTimePicker:2.0'
Run Code Online (Sandbox Code Playgroud)
日期选择器具有androidx依赖项。降级到版本3.6.4将使其android.support再次依赖- 或升级您的应用程序以使用androidx. 见第 543 期。
// https://mvnrepository.com/artifact/com.wdullaer/materialdatetimepicker
implementation "com.wdullaer:materialdatetimepicker:3.6.4"
Run Code Online (Sandbox Code Playgroud)
^ 这将是修复相互冲突的依赖关系的最简单方法。
| 归档时间: |
|
| 查看次数: |
5384 次 |
| 最近记录: |