8

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.

phatez
  • 199
  • 1
  • 3
  • 13

10 Answers10

6

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.

phatez
  • 199
  • 1
  • 3
  • 13
2

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"

Suman
  • 4,221
  • 7
  • 44
  • 64
  • All the previous apps i installed use the same api version and they are able to work. Therefore i don't think that's the issue here. – phatez Feb 23 '12 at 09:45
  • Is it possible to paste the LogCat dump here? – Suman Feb 23 '12 at 09:51
  • May i know where do i get the LogCat dump? The only issue is i export the app to apk and put in my phone, then i install it, but unable to open. Thus i am not sure where to find the dump from the phone – phatez Feb 23 '12 at 09:56
  • Connect your phone in USB-Debugging mode with your pc, open ddms (in eclipse) or logcat and watch the logs. then try to open your app by choosing its icon and wait for the error... or is your icon not shown also? – herom Feb 23 '12 at 10:05
  • Here's the message: `02-23 18:11:21.780: WARN/ActivityManager(147): Permission denied: checkComponentPermission() reqUid=10044 02-23 18:11:21.780: WARN/ActivityManager(147): Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=location.traffic/.LocationTrafficActivity } from ProcessRecord{40926bb0 225:android.process.acore/10101} (pid=225, uid=10101) requires null` – phatez Feb 23 '12 at 10:13
  • google that and found the solution. http://stackoverflow.com/questions/4162447/android-java-lang-securityexception-permission-denial-start-intent – phatez Feb 23 '12 at 10:43
0

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.

0

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" />
Josue Morales
  • 711
  • 7
  • 6
0

android:theme="@style/AppTheme.NoActionBar">

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
0

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

Braian Coronel
  • 22,105
  • 4
  • 57
  • 62
0

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>
0

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!

Solo4
  • 39
  • 3
0

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.

chinna_82
  • 6,353
  • 17
  • 79
  • 134
  • Checked this before too. If it's problem with manifest, it should be the app force close after open. However i couldn't even open it. No force close or anything shown. – phatez Feb 23 '12 at 09:47
-1

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.

Naman Jain
  • 321
  • 5
  • 21