Why are there two app icons after installing on the android? - android

My app shows two app icons after installing it on android with React Native. Why is this happening? Any idea?
I am only using one index.js. I do not have an index.android.js and my version of React Native is 0.50.3.

My fault :( I have two activity in AndroidManifest.xml with:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Remove one and perfect :)

Related

Problems when running or debugging application

Normally when I run or debugg my application, it unistalls the old version, installs new version and finally it runs the new application, same process when I debug. Some days ago my eclipse started to work in a different way, it installs my application but it does not get ran. Before intalling I get this LogCat:
No Launcher activity found!
The launch will only sync the application package on the device!
Here my Manifest:
<activity
android:name="com.company.app.activities.WelcomeActivity"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Can anybody help me with this? If I want to run the applications it's not a problem because I just have to do it manually but I can not debug.
Remove the follwing line from your manifest and try ,
<action android:name="android.intent.action.VIEW" />

Android Studio : its made 3 apps by one APK file on my device

I'm using Android studio for making android app.
but i have a problem that when i run the app , i found 3 apps on my device ,and all of them belonging to the same APK file.
also i'm sure that the mainfeest.xml has one <intent-filter>
<activity
android:name="com.amman.android.MainActivity"
android:label="#string/app_name"
android:theme="#android:style/Theme.Holo.Light.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
but i guess the problem from Build Veriants , but im not sure :(
what are the names of other apps? during the android studio build/gradle build there is a manifest merge which combines all the manifests in the library projects u included. I assume the 'other' apps are from them, try removing
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
from the all lib projects manifests

Eclipse installs my app twice on my android phone

I am having issues with Eclipse. I'm new to Android development so I wouldn't be surprised if I messed something up along the way.
My app installs twice on my phone. When I click 'Run', Eclipse does the usual with installation, but when it is finished, the app shows up twice (ie. two separate icons) on my phone. Any ideas what the problem is?
In your manifest:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name="com.myapp.FirstActivity"
android:theme="#style/Theme.Apptheme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.myapp.SecondActivity"/>
</application>
make sure only your first activity has an intent-filter.
Uninstall both programs from the emulator. If you change the name of the program and/or change some of the settings, then it can install as a different program. My guess is after you do the install, then run that you'll only have the one icon.
Did you run two different versions of this code?
If so it will not save over the old icon but make a new one.
If this is the case trying deleting boths apps from the emulator and re-running it cleanly.
In my case I had two activities with the following intent-filter
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>

APK not built properly

I tried installing my android application on an Android-powered phone. And I know that, as the APK is being installed in the device, automatically it creates a folder of that application. But my application doesn't create a folder, anyone who has an idea on how I resolve this?
If you by folder mean launcer icon to start the app from...
Have you added
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
to one of your activities in the manifest file?

Android app won't open after i install. But it can run in emulator

I have exported my app from eclipse and installed it on my phone. After installation, I click open from package installer, but the installer force close. Afterwards, when I tried to launch the app, nothing happen after I click it. I click the app in app drawer but it return to home screen instead.
I am able to run in emulator and in debug mode when I connect my device via usb, but not when I export the apk to install.
Note that this is not the first app that I exported to install. Previous apps are working fine.
I found the problem! I had declared the activity 2 times in the manifest with different properties, like:
<activity android:name=".myclass"></activity>
and
<activity android:name=".myclass" android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Remove the unwanted one from the manifest and it will work.
Check your android emulator version and the firmware version of the phone. If firmware version is not supported for that app you will be install from adb, but you cant start the app.
Check the settings to be able to install the unknown apps in
Settings->Applications and check box "Unknown Sources"
Try to check on permission in Android Manifest. I was having the same problem earlier when i install a NFC app. I forget to give permission for NFC. After i gave the permission it works fine for me. Please check your AndroidManifest.
I spent few days to identify the problem why it occurred .But I solved my problem this way- Modification in Android Manifest
<activity android:configChanges >
<intent-filter android:label="#string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<I removed my code here that i added for reference to google play store for reference >
Remove the unwanted one from the manifest and it will work.
Try to search errors in your Android manifest, i have the same problem and the problem was the 'R' in the category LAUNCHER are in lower case.
like this:
<category android:name="android.intent.category.LAUNCHEr" />
to solve it, simple:
<category android:name="android.intent.category.LAUNCHER" />
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Removing the configuration of all the modules that are not from the app worked for me. In other words, just leave the Project.app module and check its configuration.
Edit Run/Debug Configurations -> Android app -> app
GL
if you use splash in react native:
To avoid error: Binary XML file line #XXX: requires a valid src attribute
inside a layer-list, use:
<item android:drawable="#drawable/image" />
instead of:
<item>
<bitmap android:src="#drawable/image"/>
</item>
My solution is to add this flag in download manager when application is install
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
In my case - i had this flag -> intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
I replaced it with Intent.FLAG_ACTIVITY_NEW_TASK and everything worked!
My Manifest looked like this. Those that need help and have a similar manifest look bellow.
<activity android:name=".login.activities.SplashScreenActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:host="example.com"
android:scheme="https"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
You just need to remove the
< data>
element in the intent-filler and it should work.

Categories

Resources