程序类型已存在:android.support.v4.app.INotificationSideChannel $ Stub $ Proxy [英] Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy

查看:233
本文介绍了程序类型已存在:android.support.v4.app.INotificationSideChannel $ Stub $ Proxy的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道它可能看起来像问题,但是我无法通过提出的解决方案来解决它,也无法对此发表评论. 错误是:

I know it could look like This Question but I could not fix it with the solution proposed and I could not comment on it too. The Error is :

Program type already present: 
android.support.v4.app.INotificationSideChannel$Stub$Proxy
Message{kind=ERROR, text=Program type already present: 
android.support.v4.app.INotificationSideChannel$Stub$Proxy, sources=[Unknown 
source file], tool name=Optional.of(D8)}

我正在尝试使用Firebase创建一个应用程序,这是我的gradle文件

I'm trying to create an app using firebase there's is my gradle file

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
    minSdkVersion 27
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
aaptOptions {
    noCompress "tflite"
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.0.0-rc01'
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
implementation 'com.google.android.material:material:1.0.0-rc01'
implementation 'androidx.cardview:cardview:1.0.0-rc01'

// ML Kit dependencies
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-ml-vision:17.0.0'
}
apply plugin: 'com.google.gms.google-services'

我通过了每个文件以确保导入效果良好,我还添加了

I pass over every file to be sure the import was good, I Also add

android.useAndroidX = true
android.enableJetifier = false

有我的Project Gradle文件:

There's my Project Gradle file :

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

repositories {
    google()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.4'
    classpath 'com.google.gms:google-services:4.1.0'


    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
repositories {
    google()
    jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

我使用的是Android Studio 3.1.4

I use Android Studio 3.1.4

推荐答案

当我尝试迁移到Android X时,这发生在我身上.其原因是并非所有库都已迁移到Android X.

This happened to me when I tried to migrate to Android X.The reason behind is that not all libraries have been migrated to Android X.

  • 您可以手动删除依赖关系.:尝试查看所有依赖关系并找出有冲突的依赖关系.您可以在Android Studio中使用 Gradle View 插件,也可以从菜单中使用类导航. (在android Studio中:导航->类;现在出现一个搜索框,并勾选'包括非项目项';粘贴整个类名,创建错误并立即搜索;找出具有此依赖关系的类,并手动删除!). 请检查在仍然使用非AndoirdX依赖项的文件中是否还有任何导入语句.如果是,请也将其删除.
  • You may manually remove dependencies. : Try to see all dependencies and find out the conflicting one. You may use Gradle View plugin for Android Studio or use class navigation from menu. (In android Studio: Navigation -> class; Now a search box appears and tick 'include non project items'; paste the whole class name creating error and search now; Find out the class having this dependency and remove manually!). Please check if you have any import statements left in files which uses the non AndoirdX dependencies still. If yes, please remove them too.

  • 在Android Studio中, Refractor->迁移到AndroidX .

或(手动)

  • 将以下内容添加到 gradle.properties 中.
   android.useAndroidX=true
   android.enableJetifier=true

这使Android Studio可以迁移所有依赖项.有关更多信息,请在此处

This makes Android Studio to migrate all dependencies. For more info please check here

这篇关于程序类型已存在:android.support.v4.app.INotificationSideChannel $ Stub $ Proxy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆