0

I'm using react native version 0.49 and I when I run my app in react-native in android emulator, I don't see app on the device. the app is run fine but when I close the app and try to find the app into the emulator again i don't see that. but when i open new project I see the app. maybe I changed something into the project.what it can be?

I add some files from android folder AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.glassify"
android:versionCode="1"
android:versionName="1.0">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.RECORD_VIDEO"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <!-- Approximate location - If you want to use promptLocation for letting OneSignal know the user location. -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH"/>         <!-- for Device Name -->
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>  <!-- for Phone Number -->
<uses-permission android:name="android.permission.NFC" />



<uses-sdk
    android:minSdkVersion="16"
    android:targetSdkVersion="22" />

<application
  android:name=".MainApplication"
  android:allowBackup="true"
  android:label="@string/app_name"
  android:icon="@mipmap/ic_launcher"
  android:theme="@style/AppTheme">
  <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>

  <activity
    android:name=".MainActivity"
    android:label="@string/app_name"
    android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
    android:windowSoftInputMode="adjustResize"
    android:launchMode="singleTask"
    android:screenOrientation="portrait"
    >
    <!-- android:launchMode="singleTop" -->
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
        <data android:scheme="glassify" android:host="open" />
        <action android:name="android.intent.action.VIEW" />
        <!-- <category android:name="android.intent.category.DEFAULT" /> -->
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="@string/fb_login_protocol_scheme" />

    </intent-filter>
  </activity>
  <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<receiver android:name="io.branch.referral.InstallListener" android:exported="true">
<intent-filter>
    <action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<meta-data android:name="io.branch.sdk.BranchKey" android:value="key_live_onzHkTB1E4aeo2HI8qsnFmfaBupEXGtN"/>

</application>

strings.xml

<resources>
<string name="app_name">test app</string>
<string name="facebook_app_id">xxxxxx</string>
<string name="fb_login_protocol_scheme">xxxxxxx</string>

Manspof
  • 598
  • 26
  • 81
  • 173
  • Could you share the content of your android/app/src/main/res/values/string.xml file and your android/app/src/main/AndroidManifest.xml file ? App names are usually managed there. Another problem might be that you deleted the icon files in the android/app/src/main/res/mipmap-* folders. – Gaëllan Nov 20 '17 at 16:55
  • 1
    I edited my post you can see – Manspof Nov 20 '17 at 17:31
  • the app opens and work but when i close it I don't see anymore in the emulator so i need to compile everytime – Manspof Nov 20 '17 at 18:04

1 Answers1

3

Check this answer here. You need to separate your MainActivity actions into their own <intent-filter> tags like below:

    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    <intent-filter>
        <data android:scheme="glassify" android:host="open" />
        <action android:name="android.intent.action.VIEW" />
        <!-- <category android:name="android.intent.category.DEFAULT" /> -->
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="@string/fb_login_protocol_scheme" />
    </intent-filter>
Jono
  • 627
  • 4
  • 8