1

I have created a SplashActivity class under main package

package com.mypackage;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;  // not found this library

public class SplashActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        Intent intent = new Intent(this, MainActivity.class);
        startActivity(intent);
        finish();
    }
}

The error show the v7 not exist when I compile this project. How can add it?

react-native version: 0.60.4.

ccd
  • 5,788
  • 10
  • 46
  • 96

1 Answers1

3

If you are using androidX, you will get this error. You can check it on

android/gradle.properties

AndroidX enable: android.useAndroidX=true android.enableJetifier=true

If androidX was enabled, you must change from android.support.v7.app to androidx.appcompat.app

You should check how to migrate to androidx: https://developer.android.com/jetpack/androidx/migrate

If androidx was disabled, I think you need to follow: How do I add a library (android-support-v7-appcompat) in IntelliJ IDEA

ChrisM
  • 505
  • 6
  • 18