когда я запускаю его, показывает следующую ошибку - PullRequest
0 голосов
/ 26 октября 2019

Я получаю сообщение об ошибке при работе над проектом Android на основе голосового помощника

Ошибка: сбой слияния манифеста: Атрибут application @ appComponentFactory value = (android.support.v4.app.CoreComponentFactory) от [com.android.support: support-compat: 28.0.0] AndroidManifest.xml: 22: 18-91 также присутствует в [androidx.core: core: 1.0.0] AndroidManifest.xml: 22: 18-86 значение = (androidx.core.app.CoreComponentFactory). Предложение: добавьте 'tools: replace = "android: appComponentFactory"' к элементу в AndroidManifest.xml: 8: 5-31: 19, чтобы переопределить.

Манифест

`<?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
 package="com.example.rohit.myapplication">
 <uses-permission android:name="android.permission.CAMERA"></uses-
  permission>
 <uses-permission android:name="android.permission.RECORD_AUDIO" />
  <uses-permission 
 android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
 <uses-permission android:name="android.permission.CALL_PHONE" />
 <application
     android:allowBackup="true"
    android:icon="@mipmap/op"
    android:label="Voice Assistant"
    android:roundIcon="@mipmap/op"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    tools:replace="android:appComponentFactory">
    <activity android:name=".SlashScreen">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".MainActivity" />

    <meta-data
        android:name="com.google.gms.vision.DEPENDENCIES"
        android:value="ocr" />

    <activity android:name=".display" />
    <activity android:name=".help" />
    <activity android:name=".OCRActivity"></activity>
   </application>

  </manifest>'

BUILD Gradle

   'apply plugin: 'com.android.application'

    android {
  compileSdkVersion 26
   defaultConfig {
     applicationId "com.example.rohit.myapplication"
    minSdkVersion 15
    //noinspection OldTargetApi
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"



testInstrumentationRunner"android.support.test.runner.AndroidJUnitRunner"
  }
  buildTypes {
     release {
         minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard 
 rules.pro'
     }
   }
   }

  dependencies {
  implementation fileTree(dir: 'libs', include: ['*.jar'])
  //noinspection GradleCompatible
  implementation 'com.android.support:appcompat-v7:28.0.0'
  implementation 'com.android.support.constraint:constraint-layout:1.1.3'
  testImplementation 'junit:junit:4.12'

  //noinspection GradleCompatible
  implementation 'com.google.android.gms:play-services-vision:19.0.0'

   implementation 'com.android.support:design:28.0.0'
  }'

Ошибка слияния манифеста

Приложение атрибута @ appComponentFactory value = (android.support.v4.app.CoreComponentFactory) из [com.android.support:support-compat:28.0.0]AndroidManifest.xml: 22: 18-91 также присутствует в [androidx.core: core: 1.0.0] AndroidManifest.xml: 22: 18-86 value = (androidx.core.app.CoreComponentFactory).

1 Ответ

0 голосов
/ 26 октября 2019

Вы используете com.google.android.gms: play-services-vision: 19.0.0, что зависит от версии AndroidX. Журнал изменений служб воспроизведения . Попробуйте использовать версию 17.0.0, это поможет решить проблему. Play Services Change Log

...