0

Hi there i have searched google many times for this issue !! error: targetapi valid instructions are: REMOVE,REPLACE,STRICT

This is my gradle:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.google.firebase:firebase-analytics:17.2.2'
    implementation 'com.google.firebase:firebase-auth:19.2.0'
    implementation 'com.google.firebase:firebase-firestore:21.3.1'

and here i got the error firebase manifest:

    <?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.google.firebase"
    android:versionName="19.3.0">

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="28"/>

    <application>

        <provider
            android:name="com.google.firebase.provider.FirebaseInitProvider"
            android:authorities="com.mycompany.myapp.firebaseinitprovider"
            android:exported="false"
            android:initOrder="100"/>

        <service
            android:name="com.google.firebase.components.ComponentDiscoveryService"
            android:directBootAware="true"
            android:exported="false"
            tools:targetApi="n"/>

    </application>

</manifest>

2 Answers2

1

I solves it with changing the firebase versions

compile 'com.google.firebase:firebase-core:12.+'
compile 'com.google.firebase:firebase-auth:16.0.4'
0

The problem you are having is because of the minimumSdkVersion for your application.

<uses-sdk
    android:minSdkVersion="14". <----- Here
    android:targetSdkVersion="28"/>

Firebase needs at least version 16.

You can see it in the documentation here.

Excerpt from the documentation, linked above:

Prerequisites Install or update Android Studio to its latest version. Make sure that your app meets the following requirements:

Targets API level 16 (Jelly Bean) or later Uses Gradle 4.1 or later Set up a device or emulator for running your app. Emulators must use an emulator image with Google Play. Sign into Firebase using your Google account.

tomerpacific
  • 4,704
  • 13
  • 34
  • 52