thecodingmachine / react-native-boilerplate

A React Native template for building solid applications πŸ™, using JavaScript πŸ’› or Typescript πŸ’™ (you choose).
https://thecodingmachine.github.io/react-native-boilerplate/
MIT License
4.75k stars 864 forks source link

[BUG]: New application set up from template won't start #374

Closed OultimoCoder closed 1 year ago

OultimoCoder commented 1 year ago

react-native environment setup

Description

I followed the react native setup tutorial from the website and I installed this project as per the instructions. I have tried with a virtual environment and also my own android phone but every time no matter what I do, I get this error:

BUILD SUCCESSFUL in 2m
213 actionable tasks: 208 executed, 5 up-to-date
info Connecting to the development server...
info Starting the app on "RFCT80RZZ6D"...
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.langki/.MainActivity }
Error type 3
Error: Activity class {com.langki/com.langki.MainActivity} does not exist.

I have followed a bunch of guides and done various things like deleting the build folder, uninstalling all with gradle, wiping user data, checking package names match etc but I can't get it to work no matter what I try.

Version

latest

On which OS this issue appear on?

Desktop OS

Ubuntu 22.0.4

OultimoCoder commented 1 year ago

I also just deleted the folder and reinstalled from template and got the same issue

AhmadAlz7 commented 1 year ago

Same issue here

AhmadAlz7 commented 1 year ago

if you want a walkaround solution: go to android > app > src > main > AndroidManifest.xml you will find 2 activites :

      <activity
        android:name=".SplashActivity"
        android:theme="@style/SplashTheme"
        android:label="@string/app_name"
        android:exported="true"
      >
        <intent-filter>
          <action android:name="android.intent.action.MAIN" />
          <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>

      <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" />
        </intent-filter>
      </activity>
        <category android:name="android.intent.category.LAUNCHER" />

Your new code should look like:

      <!-- <activity
        android:name=".SplashActivity"
        android:theme="@style/SplashTheme"
        android:label="@string/app_name"
        android:exported="true"
      >
        <intent-filter>
          <action android:name="android.intent.action.MAIN" />
        </intent-filter>
      </activity> -->

      <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" />
        </intent-filter>
      </activity>