Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

android

apk

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.

like image 479
phatez Avatar asked Feb 23 '12 09:02

phatez


People also ask

How can I run Android apps instead of emulator?

In the Android Studio toolbar, select your app from the run configurations drop-down menu. From the target device drop-down menu, select the device that you want to run your app on. Select Run ▷. This will launch the app on your connected device.

How do I bypass emulator detection in Android Apps?

In general there are three ways to bypass an emulator check: Modify the app and remove the emulator check. Modify the emulator so that it pretends to be a real device. Modify the system calls the app does for detecting it is running on an emulator.

Why my app is not opening in Android Studio?

Unplug your device from the USB port on the computer. Restart the device by powering off and back on. Verify that Settings => Developer options => USB Debugging is enabled. Quit and re-launch Android Studio.


2 Answers

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.

like image 136
phatez Avatar answered Oct 29 '22 00:10

phatez


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"

like image 32
Suman Avatar answered Oct 29 '22 01:10

Suman