Unable to start receiver com.parse.ParseBroadcastReceiver on Trigger.io Android app - android

I've an Android app built with trigger.io, using Parse push notifications.
App is deployed to google play and push notifications have been working fine. Recently re-built and deployed to google play a new version of the app, with Forge platform version 1.4.29.
Since then I have been receiving the following crash reports through Google Play:
java.lang.RuntimeException: Unable to start receiver com.parse.ParseBroadcastReceiver: android.content.ReceiverCallNotAllowedException: IntentReceiver components are not allowed to register to receive intents
at android.app.ActivityThread.handleReceiver(ActivityThread.java:2236)
at android.app.ActivityThread.access$1500(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1271)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.content.ReceiverCallNotAllowedException: IntentReceiver components are not allowed to register to receive intents
at android.app.ReceiverRestrictedContext.registerReceiver(ContextImpl.java:125)
at android.app.ReceiverRestrictedContext.registerReceiver(ContextImpl.java:119)
at com.parse.ParseCommandCache.<init>(ParseCommandCache.java:132)
at com.parse.Parse.getCommandCache(Parse.java:450)
at com.parse.ParseObject.saveEventually(ParseObject.java:1022)
at com.parse.ParseInstallation.saveEventually(ParseInstallation.java:170)
at com.parse.ParsePushRouter.saveEventually(ParsePushRouter.java:92)
at com.parse.ParsePushRouter.ensureStateIsLoaded(ParsePushRouter.java:208)
at com.parse.ParsePushRouter.hasRoutes(ParsePushRouter.java:122)
at com.parse.PushService.startServiceIfRequired(PushService.java:129)
at com.parse.ParseBroadcastReceiver.onReceive(ParseBroadcastReceiver.java:19)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:2229)
... 10 more
I have tested the app thoroughly on the following Android handsets and not been able to replicate the bug myself.
Samsung Galaxy Nexus
Samsung Galaxy S2
Samsung Galaxy S
Can someone suggest what is going wrong here and how I can fix it with Trigger.io?

This issue was fixed in Forge v1.4.37, which included an update to the Parse Android SDK v1.2.3.
Trigger.io release ntes
Bug report on Parse Q&A

Recently I had this problem and nothing to do with Parse version. Issue was the initializing of Parse was done on Activity instead of Application. The Broadcast Receiver can start before the Activity and writing a custom Application class and initializing Parse in onCreate of that helps.
public class MyApplication extends Application {
#Override
public void onCreate() {
super.onCreate();
//Initialize Parse here
}
}
<application
android:name=".MyApplication"
...>
.
.
.
</application>

This problem is resolved in Forge v1.4.32:
http://docs.trigger.io/en/v1.4/release-notes.html#v1-4-32

Related

Android SipDemo app. SipException: Failed to create SipSession; network unavailable

I have downloaded SipDemo app from official repository. I ran the app and made SIP calls from my phone. But I want to integrate SIP calls into my own app. I copied code from SipDemo app into my own project, ran a project. When I want to make a SIP call I get an error:
21319-21319/com.app.myapplication I/WalkieTalkieActivity/InitiateCall﹕ Error when trying to close manager.
android.net.sip.SipException: Failed to create SipSession; network unavailable?
at android.net.sip.SipManager.createSipSession(SipManager.java:555)
at android.net.sip.SipManager.makeAudioCall(SipManager.java:328)
at android.net.sip.SipManager.makeAudioCall(SipManager.java:359)
at com.tickets.myapplication.WalkieTalkieActivity.initiateCall(WalkieTalkieActivity.java:221)
at com.tickets.myapplication.WalkieTalkieActivity$5.onClick(WalkieTalkieActivity.java:332)
at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:167)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:174)
at android.app.ActivityThread.main(ActivityThread.java:4952)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
at dalvik.system.NativeStart.main(Native Method)
I don't know why this error happens and how to fix it. Does someone know what is the reason of this error?
EDIT
Finally I have found problem. SipDemo app uses targetSdkVersion 9 in my project I use latest android version. Seems problem in the newest version of android.net.sip.SipManager.
My solution is to create library project with targetSdkVersion 9 and add dependency to working project. Now it works ok for me.

Is adding a libjitsi dependency to an Android project feasible?

I am actually working on an Android VOIP application that let user create conference with other users. My constraints are to avoid any use of a server like SIP servers to realise it and if I have to use a external library, it should be under LGPL license. I have succesfully done it in a peer-to-peer fashion using the AudioGroup and AudioStream classes of the android RTP stack.
My problem occurs in a 3-peers conference. Using AudioGroup, I have enabled the MODE_ECHO_SUPPRESSION but the results are very poor and I can hear my echo after 3 seconds. I came to conclusion that the Android RTP stack was not a good solution to my problem beacause using AudioGroup make impossible to tweek the sound and echo suppression seems to function badly.
By testing VOIP applications, I discovered a lot that were working pretty weel and more precisely Jitsi (homepage) which use a java library based on native code for the RTP stuff under the LGPL licence. I tried to follow this tutorial to use libjitsi but unfortunatly it gives me an error... At this time, I'm not sure that it is possible to use Libjitsi on an android project as it is normally used in Java projects.
Steps I went trough to get the error (using Android Studio)
I have compiled libjitsi from the build.xml contained in the sources and putted the resulting jar directly in the lib/ folder of my project.
I have added a dependency to libjitsi.jar in my build.gradle file
Called the static method Libjitsi.start() in the onCreate method of an activity
Error log
01-02 17:06:48.304 1523-1523/com.test.example I/LibJitsi﹕
Failed to initialize LibJitsi backend
org.jitsi.impl.libjitsi.LibJitsiOSGiImpl. (Exception stack trace
follows.) Will try an alternative.
java.lang.NoClassDefFoundError: org.osgi.framework.FrameworkUtil
at org.jitsi.impl.libjitsi.LibJitsiOSGiImpl.(LibJitsiOSGiImpl.java:34)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1319)
at org.jitsi.service.libjitsi.LibJitsi.start(LibJitsi.java:227)
at org.jitsi.service.libjitsi.LibJitsi.start(LibJitsi.java:171)
at com.test.example.ui.createconf.CreateConfActivity.onCreate(CreateConfActivity.java:76)
at android.app.Activity.performCreate(Activity.java:4465)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4441)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native
Now if anyone already tried to use libjitsi on an AndroidProject or if you know it's not feasible, I would really be gratefull if you share your experience with me.
Thanks
Yes libjitsi dependency can be added to android, you can try jitsi-android which is an Android port of the Jitsi project . I have tried to run their sample app and it compiled fine.
However , I have shared 5 different libraries for VOIP calling on android in another answer you can have a look and try them.
Njoy!

Android Security Exception

I have been struggling with an issue for a while now and decided to post it here in the hope that someone can guide me in the right direction.
Situation
I have two separate applications:
Alpha (com.droidbender.alpha)
Beta (com.droidbender.beta)
Application Beta use an external advertisement SDK (provider Yume). This is a simple .jar library included in the building path and is located ./libs/YumeSDK.jar.
Occuring error
Several cases of a Security Exception have been reported on the PlayStore for the application Alpha
java.lang.SecurityException: Not allowed to start service Intent {
cmp=com.droidbender.beta/com.yume.android.bsp.YuMeUUIDService }
without permission not exported from uid 10041
The complete stack trace can be found below. It goes to the Yume SDK. The Yume SDK is not public and proguarded.
Problem
As you can see, the component name of the Intent that is fired from Alpha is actually targetting Beta.
Alpha does NOT have the Yume SDK implemented, has not included it in the project or isn't referencing to a Yume-related project whatsoever.
Question
I honestly have no idea why application Alpha fires the above Intent. The most answered I found which are related to Security were solved with the android:exported parameter but this didn't fix my issue. Does anyone have an idea? :)
Clean and Build does not help, in case you wondered.
My Thoughts
Application Alpha used to have the Yume SDK implemented but I took it out. I am 100% sure that there is nothing in code related to Yume anymore. Could it be that Eclipse magically keeps a reference to something magical in the magical building process?
Extra information
In the Manifest.xml of Beta we have the declaration of the Yume Service that listens to the appropriate action. This Service is started from inside the Yume SDK.
<service
android:name="com.yume.android.bsp.YuMeUUIDService"
android:exported="true" >
<intent-filter>
<action android:name="com.yume.uuid.GETDEVICEUUID" />
</intent-filter>
</service>
Full stacktrace of the Security Exception shown by application Alpha:
java.lang.SecurityException: Not allowed to start service Intent {
cmp=com.droidbender.beta/com.yume.android.bsp.YuMeUUIDService } without permission not exported from uid 10041
at android.app.ContextImpl.startServiceAsUser(ContextImpl.java:1443)
at android.app.ContextImpl.startService(ContextImpl.java:1425)
at android.content.ContextWrapper.startService(ContextWrapper.java:450)
at com.yume.android.bsp.r.e(Unknown Source)
at com.yume.android.bsp.r.onServiceConnected(Unknown Source)
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1131)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1148)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:5299)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)

Issue With Google Maps V2 Connectivity Issues

I have received a few crash reports and I am unsure what has cause them.
It is only in a recent update that this has started happening. This may mean that it just didn't happen before or I introduced it. The only thing to do with the network is register for a permission to check the network in the Android Manifest.
Anyway I hope you can point me in the direction. Here is the crash report.
java.lang.RuntimeException: Error receiving broadcast Intent { act=android.net.conn.CONNECTIVITY_CHANGE flg=0x10000000 (has extras) } in maps.z.bz#405d7d40
at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:722)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3691)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalArgumentException: Receiver not registered: maps.z.bz#405d7d40
at android.app.LoadedApk.forgetReceiverDispatcher(LoadedApk.java:610)
at android.app.ContextImpl.unregisterReceiver(ContextImpl.java:853)
at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:331)
at maps.z.bz.onReceive(Unknown Source)
at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:709)
... 9 more
This is happening if you're using the Maps V2 api with the old (revision 4) library and the new (3.0.25) version of the Google Play services.
It seems that Google broke the backward compatibility so if people upgrade their Google Play services the app released with the old library will be broken.
You have two possibilities at this point:
Release a new version of your app and update to the new library
Revert back to the old maps
I've raised a ticket and Google already acknowledged it:
http://code.google.com/p/gmaps-api-issues/issues/detail?id=5025&thanks=5025&ts=1362047877
Please star it to get a higher priority from Google.

Android to Unable to instantiate Application java.lang.ClassNotFoundException:

I am working on application which is host on android market. Sometimes (once a month ) I got a crash report:
Unable to instantiate application java.lang.ClassNotFoundException
App downloads are between 10,000-50,000. I don't know why this exceptions raise on some devices not all ( I tested it on 3 different devices & I couldn't re-produce it at my end).
I read articles/suggestions on different android forums regarding the issue but I didn't succeed in solving it. Does anyone face similar issue & suggest me what should I do?
Note:
I am extending application class like this
public class MyApplication extends Application {
}
I register it in the manifest.xml like this
<application android:icon="#drawable/app_icon"
android:label="#string/my_app_name" android:name="MyApplication">
Stack Trace :
java.lang.RuntimeException: Unable to instantiate application com.xyz.MyApplication java.lang.ClassNotFoundException: com.xyz.MyApplication in loader dalvik.system.PathClassLoader[/mnt/asec/com.xyz-1/pkg.apk]
at android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:650)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4238)
at android.app.ActivityThread.access$3000(ActivityThread.java:126)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2076)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4633)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.xyz.MyApplication in loader dalvik.system.PathClassLoader[/mnt/asec/com.xyz-1/pkg.apk]
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
at android.app.Instrumentation.newApplication(Instrumentation.java:942)
at android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:645)
I don't know why application crash on some devices not all.
Some other similar questions indicate that this can be a user error. "/mnt/asec/..." indicates that the app is running from the sdcard. If the sdcard is removed it could cause this error. 3rd party apps or rooted devices can probably move an app to the sdcard even if its not allowed by the manifest.
Similar Question
I think the problem is with getApplication() which I have used in 10 different place. So I have used singleton pattern to solve this.
public class MyApplication extends Application {
private static MyApplication me;
#Override
public void onCreate() {
super.onCreate();
me = this ;
}
public static MyApplication getInstance() {
return me;
}
}
Now I have used getApplication() like this
MyApplication application = MyApplication.getInstance();
insted of
MyApplication application = (MyApplication) getApplication();
I have uploaded the fixed version on the market & now waiting if there is anymore this kind of crash. If everything goes perfect ( if no more crash in 2 weeks) then I will close the question. In meanwhile anyone has better idea or know the solution , please share it. Thanks,
In my case, I was compiling and signing with Eclipse ADT (with File > Export > Export Android Application...) but missing some classes if I decompile my .apk.
To solve it I use "Export an unsigned APK" and sign it using jarsigner and zipalign.
android:name=".MyApplication"
also consider adding full package

Categories

Resources