Updated app with launcher activity changed causing crash - android

I have updated my app with change of launcher activity class. User reporting issue about their app icon and shortcut are not working. I want to know is it an OS specific Issue ???
Error they are getting "Linker not available"

Yep, if you have changed the class name for the Activity that used to be an intent launcher, or removed it from being a launcher then peoples current shortcuts won't work.
Simplest answer is to tell them to remove the shortcut and re-add it.
Long solution is to programatically do this yourself (latest Android API's only I believe)

Register the new launcher class in your manifest file.

Related

Avoid Android APK to run multiple instances

In our AndroidManifest.xml, we added android:launchMode="singleInstance" to avoid multiple instances running at the same time.
However, the App now runs in 2 instances at the same time.
This issue only appears when we installed via APK using signed production keystore; when we run in Eclipse, the same issue does not happen at all.
Where else I overlooked ?
p.s. we tried singleTop and singleTask too.
Update: When I click App Icon, it runs. Then, click Home button, it runs again (starts from beginning).
here is your answer. It is long-standing nasty Android bug .This bug happened when your app is launched from other apps (for example, opening from apk installer)
Your problem can be solved by detect when Android has launched a second instance of your root activity into an existing task.
Try this one on your first activity's onCreate:
if(!isTaskRoot()) {
finish();
return;
}
I believe you need to put
<activity
android:launchMode="singleInstance"
/activity>
in the manifest file.

Android Application Installation

I am new in android and I have develop an application in android but the issue is when i install it on my device it shows me 2 icons one is working and other one says that receipt organizer has been stopped unexpectedly.Kindly let me know how i can get out of this rid ?Is it some kind of code error or problem in the manifest or properties ?Also one more question now my api level is set to 18 if i set it to previous version then the functionality will not get disturbed right ?So let me know if any one can help.
Look at your manifest file. Your manifest file should have only one activity that has the LAUNCHER in the intent filter.
Choose your main activity (which should have this intent filter), and delete the intent filters from the other activity. after that, you should see only one application icon.

Why does the new update for my app remove it from the launcher?

I placed a shortcut to my app on the main Android screen, the one you see after unlocking the phone. I then installed my latest update over the top. The app then disappeared from the launcher (but was still in the main list of apps).
I have released many updates where this hasn't happened. However it has happened before, when I replaced our main activity with a new class. That was understandable as maybe the launcher was holding a reference to the class name (rather than the application identifier?).
However this time, that hasn't happened. I have changed the base activity code, and added some new classes to its jar (that then links, and always has linked, with the main eclipse project, rather than be part of it). I've also added some stuff to our manifest:
support-screens now contains android:resizable="true"
have upped the minSdkVersion from 8 to 10
have added a bunch of permissions, including CD2_MESSAGE and WAKE_LOCK
have added a new activity, reciever and service
Any ideas?

android activity class does not exists?

I have been developing a project in eclipse for an android app. An error which i frequently get is that of- activity class does not exist. But when i just save the manifest file once again the error vanishes and the program runs correctly. Why then do i get the same error again and again. ?
Console error:
[2011-11-18 15:08:38 - link] Starting activity acb.abc.LinkActivity on device emulator-5554
[2011-11-18 15:08:40 - link] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=acb.abc/.LinkActivity }
[2011-11-18 15:08:40 - link] New package not yet registered with the system. Waiting 3 seconds before next attempt.
[2011-11-18 15:08:40 - link] ActivityManager: Error: Activity class {acb.abc/acb.abc.LinkActivity} does not exist.
every time a new activity is added in the application, it needs to be added in the manifest file as well with a new tag.
Make sure that u r doing this otherwise the new activity will not be considered.
For reference see This
I got this problem today.
Attention that: "class {acb.abc/acb.abc.LinkActivity}",you should modify the AndroidManifest.xml, change acb.abc.LinkActivity to ".LinkActivity". Then will be OK.
You are not declairing your package name correctly in your manifest, thats what I guess. Either post your manifest or go through this discussion.
http://groups.google.com/group/android-developers/browse_thread/thread/ce62996fde2d4727
Cheers.....!!!!!!
In may case, in Android Studio, I changed AndroidManifest.xml like this: change main Activity on my custom Activity. Then I start my app on emulation device, I get:
"Error type 3 Error: Activity class {...} does not exist.",
and may app failed.
I was forced delete my app on virtual device (use Application Manager in device) and restarted app in Android Studio. This solution helped me.
I saw this error because I had installed my app as a built-in app, then disabled it to removed it. I thought I had removed it when I tried to run my app in eclipse as a "normal" app. I discovered that my app was still in system/app.
Once I removed it, I didn't see this error when running my app in Eclipse.
i had this problem too and it was because i had a second tag in my AndroidManifest.xml
on android studio <= 0.8.6 it was no problem
i'm not sure yet how to handle this if one needs two application's defined here
my use case was related to saving the application state in a separate activity
e.g.
http://blog.tomgibara.com/post/126377651/global-application-state-in-android
Error: Activity class {com.myapplication5.myapplication/com.myapplication5.myapplication.MainActivity} does not exist.
answer:
file-projectstructur-flavors-minsdk version =4
ok

Android: security exception with launchMode="singleTask"

I have declared the launch mode of my activity to be singleTask. If I
launch my application, press the home button, go to an email client
(gmail in this case) & preview an attachment using my application, I
am experiencing a security exception on Android versions 2.3 & later,
which says that I do not have the permissions to access gmail
attachments. The exception does not occur on prior versions & if I do
not use singleTask as the launchMode.
The exception occurs on this line-
mContext.getContentResolver().openInputStream(intent.getData());
where mContext is the activity context.
Is this a known issue?
Any help will be really appreciated.
Thanks,
Akshay
I had posted this on Android-developers and got this response from Dianne Hackborn-
"Sorry, this is probably a bug in 2.3 with trying to grant a URI permission to an activity instance that is already running. I'll look in to this. In the mean-time, the only solution may be to not use singleTask for the activity being launched to a preview an attachment. This is actually the preferred thing to do, since your preview activity should be running as its own instance as part of the gmail task."
The problem might happen because the called intent's activity in the 2.3 implementation does not fit the launchMode:"standard" or launchMode:"singleTop" requirement stated in the android:launchMode description.
But it would be also useful to take a look at this issue: Behaviour of launchMode=“singleTask” not as described. It is scary, hopefully your problem isn't rooted there, and can be solved within the current versions.

Categories

Resources