对于想了解清单合并失败:属性application@appComponentFactory更新Firebase库的读者,本文将是一篇不可错过的文章,我们将详细介绍清单合并与拆分,并且为您提供关于and
对于想了解清单合并失败:属性application @ appComponentFactory更新Firebase库的读者,本文将是一篇不可错过的文章,我们将详细介绍清单合并与拆分,并且为您提供关于android – NotificationCompat.Builder(getApplicationContext(),CHANNEL_ID)无法处理Oreo Firebase通知、AndroidStudio报错Manifest merger failed : Attribute application@appComponentFactory value=(android.sup、Application application_1512618719369_147804 failed 2 times due to ApplicationMaster for attempt app、Application Components(应用的构成)的有价值信息。
本文目录一览:- 清单合并失败:属性application @ appComponentFactory更新Firebase库(清单合并与拆分)
- android – NotificationCompat.Builder(getApplicationContext(),CHANNEL_ID)无法处理Oreo Firebase通知
- AndroidStudio报错Manifest merger failed : Attribute application@appComponentFactory value=(android.sup
- Application application_1512618719369_147804 failed 2 times due to ApplicationMaster for attempt app
- Application Components(应用的构成)
清单合并失败:属性application @ appComponentFactory更新Firebase库(清单合并与拆分)
我正在尝试在我的项目中添加Firebase,但是当我实现''com.google.firebase:firebase-messaging:19.0.0''
和时''com.google.firebase:firebase-core:17.0.0''
。
build.gradle
(这是错误)
apply plugin: ''com.android.application''apply plugin: ''com.google.gms.google-services''android { compileSdkVersion 28 defaultConfig { applicationId "com.example.user.mikripoli" minSdkVersion 15 targetSdkVersion 28 multiDexEnabled true versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile(''proguard-android.txt''), ''proguard-rules.pro'' } } dexOptions { javaMaxHeapSize "2g" }}dependencies { implementation ''com.roughike:bottom-bar:2.0'' implementation ''com.android.support:support-v4:28.0.0'' implementation ''com.android.support:exifinterface:28.0.0'' implementation ''com.android.support:animated-vector-drawable:28.0.0'' implementation ''com.flaviofaria:kenburnsview:1.0.7'' implementation fileTree(include: [''*.jar''], dir: ''libs'') implementation ''com.android.support:appcompat-v7:28.0.0'' implementation ''com.android.support.constraint:constraint-layout:1.1.3'' implementation ''com.android.support:design:28.0.0'' implementation ''com.github.chrisbanes:PhotoView:2.1.4'' implementation ''com.google.firebase:firebase-messaging:19.0.0'' implementation ''com.google.firebase:firebase-core:17.0.0'' 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'' implementation ''com.android.support:recyclerview-v7:28.0.0'' implementation ''com.android.support:cardview-v7:28.0.0'' implementation "com.google.android.gms:play-services-location:17.0.0" implementation ''com.google.android.gms:play-services-maps:17.0.0'' implementation ''com.google.android.gms:play-services-base:17.0.0'' implementation ''com.github.ahmedshaban1:EasySlider:1.0.0'' implementation ''com.liangfeizc:SlidePageIndicator:1.1.0@aar'' implementation ''me.relex:circleindicator:1.2.2@aar'' implementation ''com.github.bumptech.glide:glide:4.8.0'' annotationProcessor ''com.github.bumptech.glide:compiler:4.8.0''
}
另一个gradle文件:
buildscript { repositories { google() jcenter() } dependencies { classpath ''com.android.tools.build:gradle:3.4.1'' classpath ''com.google.gms:google-services:4.2.0'' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { google() mavenCentral() jcenter() maven { url "https://maven.google.com" } maven { url "https://jitpack.io" } } } task clean(type: Delete) { delete rootProject.buildDir }
显示的错误com.android.support:support-v4:28.0.0
:
不能合并使用groupId com.android.support和androidx。*的依赖关系,但发现IdeMavenCoordinates
{myGroupId =’com.android.support’,myArtifactId =’cardview-v7’,myVersion =
‘28 .0.0’,myPacking =’aar ‘,myClassifier =’null’}和IdeMavenCoordinates
{myGroupId =’androidx.coordinatorlayout’,myArtifactId
=’coordinatorlayout’,myVersion =‘1.0.0’,myPacking =’aar’,myClassifier
=’null’}不兼容的依赖项检查信息:库,工具和库的某些组合不兼容或可能导致错误。一种不兼容的情况是使用不是最新版本(或特别是低于targetSdkVersion的版本)的Android支持库版本进行编译。
另外, 当我构建apk时,它会显示此错误:
清单合并失败:[com.android.support:support-compat:28.0.0]的属性application @
appComponentFactory value
=(android.support.v4.app.CoreComponentFactory)来自AndroidManifest.xml:22:18-91
[androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value
=(androidx.core.app.CoreComponentFactory)。建议:在AndroidManifest.xml:13:5-354:19的元素上添加’tools:replace
=“ android:appComponentFactory”’以进行覆盖。添加工具:replace =“ android:appComponentFactory”无效
答案1
小编典典在新版本中,库从Android支持库迁移到Jetpack(AndroidX)库。
除非您在应用中进行以下更改,否则更新的库将无法工作:
将com.android.tools.build:gradle升级到v3.2.1或更高版本。
将compileSdkVersion升级到28或更高版本。
更新您的应用程序以使用Jetpack(AndroidX); 请按照迁移到AndroidX中的说明进行操作。
方法1:
将这两个添加到gradle.properties文件中,而不进行任何更新
android.useAndroidX=trueandroid.enableJetifier=true
方法2
如果Method-1不能解决您的问题,请执行一件事,如果您使用的是Android Studio 3.2或更高版本,请转到 Refactor >
Migrate to AndroidX …
android – NotificationCompat.Builder(getApplicationContext(),CHANNEL_ID)无法处理Oreo Firebase通知
NotificationCompat.Builder(这个,CHANNEL_ID),但它显示我像这个
我的build.gradle文件是
apply plugin: 'com.android.application' dependencies { compile project(':library') compile project(':camerafragment') compile 'com.google.android.gms:play-services:11.0.0' compile 'com.squareup.picasso:picasso:2.5.2' compile 'com.mcxiaoke.volley:library:1.0.17' compile 'com.android.support:appcompat-v7:26.0.0-alpha1' compile 'com.android.support.constraint:constraint-layout:1.0.2' compile 'com.android.support:recyclerview-v7:26.0.0-alpha1' compile 'com.android.support:cardview-v7:26.0.0-alpha1' compile 'com.google.firebase:firebase-messaging:11.0.0' compile 'com.google.android.gms:play-services-maps:11.0.0' compile 'com.facebook.android:facebook-android-sdk:[4,5)' compile 'com.android.support:design:26.0.0-alpha1' compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1' compile 'com.jakewharton:butterknife:7.0.1' compile 'com.google.android.gms:play-services-auth:11.0.0' compile 'net.gotev:uploadservice:2.1' compile 'com.google.firebase:firebase-auth:11.0.0' compile 'com.google.code.gson:gson:2.8.0' compile 'com.android.support:support-v4:26.0.0-alpha1' } android { compileSdkVersion 27 buildToolsversion "27.0.0" dexOptions { javaMaxHeapSize "4g" } defaultConfig { applicationId "com.trashmap" minSdkVersion 17 targetSdkVersion 27 // Enabling multidex support. multiDexEnabled true versionCode 17 versionName "1.16" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false // shrinkResources true//new add to reduce size proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro' } } sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] res.srcDirs = ['res'] } } } apply plugin: 'com.google.gms.google-services'
解决方法
NotificationCompat.Builder (Context context)
This constructor was deprecated in API level 26.1.0.
use
NotificationCompat.Builder(Context,String)
instead. All posted Notifications must specify a NotificationChannel Id.
你已经定义了编译’com.android.support:support-v4:26.0.0-alpha1’所以你必须改变你的支持库的版本号.
AndroidStudio报错Manifest merger failed : Attribute application@appComponentFactory value=(android.sup
在引入 库文件时候,AS报错,第一反应 抓狂,然而没用
- 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:5:5-20:19 to override.
各种 尝试后,发现 原来 AS早已经给出提示
果断 在清单文件 添加如下代码
- <application
- ...
- android:theme="@style/AppTheme"
- tools:replace="android:appComponentFactory">
竟然 还是报错了?
Manifest merger Failed with multiple errors, see logs
百度后 还是牛人多 ,再添加一行代码 就会
- android:appComponentFactory=""
- tools:replace="android:appComponentFactory"
Application application_1512618719369_147804 failed 2 times due to ApplicationMaster for attempt app
今天遇到一个特别怪的问题,之前etl中的hive任务一直报错,持续一上午,也没有查出原因,错误的任务的日志也找到,原本可以找到原因,但是打开日志,心里面一凉,什么报错也没有,不知所错。最后观察报错的节点,最终集中到两台机器,那就看看是不是这两台机器的hadoop的程序引起的吗?看看他们的程序都在,但是查看nodemanager的日志一直报错,并且查看cpu,nodemanager进程占用的cpu达1000%多,马上眼前一亮,知道cpu占用太多,导致ap不能联系,导致任务失败,最后把这两台机器的nodemanager重启一下,观察了一下,任务不在报错。继续努力.............
Application Components(应用的构成)
A view hierarchy is placed within an activity's window by the
method. The content view is the View object at the root of the hierarchy. (See the separate User Interface document for more information on views and the hierarchy.) Activity.setContentView()
The content view is the View object at the root of the hierarchy. 这句话如果是真的,比较重要。
broadcast receivers do not display a user interface. However,they may start an activity in response to the information they receive,or they may use the NotificationManager
to alert the user.
Notifications can get the user's attention in varIoUs ways — flashing the backlight,vibrating the device,playing a sound,and so on. They typically place a persistent icon in the status bar,which users can open to get the message.
收到消息有可能会用NotificationManager
去通知、提示使用者,或者像之前用的toast也可以。NotificationManager
可以有很多提示使用者的方法,看上面可以知道。
ContentProvider
base class to implement a standard set of methods that enable other applications to retrieve and store data of the type it controls. However,applications do not call these methods directly. Rather they use a
ContentResolver
object and call its methods instead. A ContentResolver can talk to any content provider; it cooperates with the provider to manage any interprocess communication that's involved.
provider管理的数据不只是在sqlite里面的,文件系统里面的也。应用要使用数据,要用ContentResolver
object ,进程间的,也用它,比如访问其他应用的数据。
今天关于清单合并失败:属性application @ appComponentFactory更新Firebase库和清单合并与拆分的介绍到此结束,谢谢您的阅读,有关android – NotificationCompat.Builder(getApplicationContext(),CHANNEL_ID)无法处理Oreo Firebase通知、AndroidStudio报错Manifest merger failed : Attribute application@appComponentFactory value=(android.sup、Application application_1512618719369_147804 failed 2 times due to ApplicationMaster for attempt app、Application Components(应用的构成)等更多相关知识的信息可以在本站进行查询。
本文标签: