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

查看:33
本文介绍了程序类型已经存在: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

这是我的项目 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 中:Navigation -> class;现在出现一个搜索框并勾选包含非项目项目";粘贴整个类名创建错误并立即搜索;找出具有此依赖项的类并手动删除!).请检查您的文件中是否有任何仍然使用非 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天全站免登陆