avishayil / react-native-restart

React Native Package With One Purpose: To Restart Your React Native Project
MIT License
926 stars 145 forks source link

Unable to determine default activity for com.testapp #273

Open jnjdev42 opened 3 months ago

jnjdev42 commented 3 months ago

Description

Is this a bug report or a feature request?

Library Version:

React Native Version:

Platform(s):

Description:

Got an error when calling restart() function :

"Unable to determine default activity for com.testapp. Does an activity specify the DEFAULT category in its intent filter?"

Steps to Reproduce (for bugs)

  1. install package
  2. call restart function

Expected Behavior:

App should restart.

Actual Behavior:

Got an error on phone.

Reproducible Demo (for bugs)

import RNRestart from 'react-native-restart';

const VerificationCodeScreen = ({ navigation }: VerificationCodeScreenProps) => {

  const { updateAuth0Config } = useAuth0Config();

  const verifyCode = async () => {
    await updateAuth0Config('hey', 'yo');
    RNRestart.restart();
  }
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

    <uses-permission android:name="android.permission.INTERNET" />
    <application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:allowBackup="false"
      android:theme="@style/AppTheme">
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
        android:launchMode="singleTask"
        android:windowSoftInputMode="adjustResize"
        android:exported="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
            <data
                    android:scheme="scheme"
                    android:host="host"
                    android:pathPrefix="/android/com.testapp/callback"/>
        </intent-filter>
      </activity>
    </application>
</manifest>

Your Environment

Windows.

VIsual Studio Code

Node version v20.13.1

npm v8.6.0

GorArestakesyan commented 3 months ago

is your app crashing when call restart?