I have configured one of my activities in my app to be be opened using a deep link like so:
<activity
android:name=".ui.barcodescanner.BarcodeScannerActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="com.company"
android:scheme="http"
android:pathPrefix="/myapp"/>
</intent-filter>
</activity>
This works as expected (my app launches with the correct activity) when chrome redirects to http://com.mycompany/myap on an API 27 Pixel 2 XL emulator. But I get the following error when I run it on my API 29 OnePlus 6:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.company.android.myapp/com.company.android.myapp.ui.login.IONLoginActivity}: android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3037)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3172)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1906)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6863)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
at android.app.ContextImpl.startActivity(ContextImpl.java:915)
at android.app.ContextImpl.startActivity(ContextImpl.java:891)
at android.content.ContextWrapper.startActivity(ContextWrapper.java:379)
at com.infor.authentication.AuthenticationManager.loadWebView(AuthenticationManager.java:712)
at com.infor.authentication.AuthenticationManager.showAuthenticationDialog(AuthenticationManager.java:1810)
at com.infor.authentication.AuthenticationManager.validateValuesAndStoreValues(AuthenticationManager.java:512)
at com.infor.authentication.AuthenticationManager.initiateAuthentication(AuthenticationManager.java:460)
at com.company.android.myapp.ui.login.IONLoginViewModel.authenticateWithION(IONLoginViewModel.java:26)
at com.company.android.myapp.ui.login.IONLoginActivity.onCreate(IONLoginActivity.java:36)
at android.app.Activity.performCreate(Activity.java:7149)
at android.app.Activity.performCreate(Activity.java:7140)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1288)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3017)
Why is this?
Related
I'd like to disable android.nfc.action.TECH_DISCOVERED IntentFilter depending on users' settings choice,
to avoid the choosing app dialog shows up.
In order to do this, I've created an activity-alias in my Android Manifest file and change its state through PackageManager:
Anroid Manifest File
<activity
android:name=".activities.ActivitySplash"
android:configChanges="orientation"
android:label="#string/app_name"
android:launchMode="singleTask"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity-alias
android:name=".AliasActivitySplash"
android:targetActivity=".activities.ActivitySplash"
android:exported="true"
android:enabled="true">
<intent-filter>
<action android:name="android.nfc.action.TECH_DISCOVERED"/>
</intent-filter>
<meta-data
android:name="android.nfc.action.TECH_DISCOVERED"
android:resource="#xml/techlist"/>
</activity-alias>
Activity Alias State Management:
public void enableAlias() {
int newState = PackageManager.COMPONENT_ENABLED_STATE_ENABLED;
_packageManager.setComponentEnabledSetting(new ComponentName(_packageName, _packageName + "." +
"AliasActivitySplash"), newState, PackageManager.DONT_KILL_APP);
}
public void disableAlias() {
int newState = PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
_packageManager.setComponentEnabledSetting(new ComponentName(_packageName, _packageName + "." +
"AliasActivitySplash"), newState, PackageManager.DONT_KILL_APP);
}
I get a java.lang.SecurityException everytime i try to change the alias state. I've read installing the app as a system app should solve the issue.
Exception caught:
java.lang.SecurityException: Attempt to change component state; pid=10766, uid=10329, component=packagename/packagename.AliasActivitySplash
at android.os.Parcel.createException(Parcel.java:2071)
at android.os.Parcel.readException(Parcel.java:2039)
at android.os.Parcel.readException(Parcel.java:1987)
at android.content.pm.IPackageManager$Stub$Proxy.setComponentEnabledSetting(IPackageManager.java:7336)
at android.app.ApplicationPackageManager.setComponentEnabledSetting(ApplicationPackageManager.java:2554)
at packagename.activities.alias.ActivitySplashAliasManager.disableAlias(ActivitySplashAliasManager.java:27)
at packagename.fragments.FragmentPreferences.onPreferenceChange(FragmentPreferences.java:83)
at androidx.preference.Preference.callChangeListener(Preference.java:1118)
at androidx.preference.TwoStatePreference.onClick(TwoStatePreference.java:67)
at androidx.preference.Preference.performClick(Preference.java:1182)
at androidx.preference.Preference.performClick(Preference.java:1166)
at androidx.preference.SwitchPreferenceCompat.performClick(SwitchPreferenceCompat.java:193)
at androidx.preference.Preference$1.onClick(Preference.java:181)
at android.view.View.performClick(View.java:7140)
at android.view.View.performClickInternal(View.java:7117)
at android.view.View.access$3500(View.java:801)
at android.view.View$PerformClick.run(View.java:27351)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
2019-10-24 09:21:43.863 10766-10766/packagename E/Test: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: android.os.RemoteException: Remote stack trace:
at com.android.server.pm.PackageManagerService.setEnabledSetting(PackageManagerService.java:21250)
at com.android.server.pm.PackageManagerService.setComponentEnabledSetting(PackageManagerService.java:21184)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:3473)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4015)
at android.os.Binder.execTransactInternal(Binder.java:1021)
Am I doing something wrong or is there any other way to do this?
I've finally solved it. The problem was the way I was getting the packagename. My app has multiple flavor configuration and i was trying to disable/enable a component from the other flavor installed on my device
I have a SplashScreen with 3 Intent-filters defined in Manifest like this -
<activity
android:name=".SplashScreen"
android:screenOrientation="portrait"
android:theme="#style/SplashTheme"
android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="kljb"
android:scheme="http" />
<data
android:host="kljb"
android:scheme="https" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->
<data
android:host="xyz"
android:scheme="abc" />
</intent-filter>
</activity>
I want to disable this one -
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->
<data
android:host="xyz"
android:scheme="abc" />
</intent-filter>
And After some user Action, I want to Enable it.
I have tried using -
PackageManager pm = getApplicationContext().getPackageManager();
ComponentName compName =
new ComponentName(getPackageName(), ".SplashScreen");
pm.setComponentEnabledSetting(
compName,
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
PackageManager.DONT_KILL_APP);
I don't know exactly where to write this above code. I set this code in the oncreate of the SplashScreen but getting the error -
Unable to start activity ComponentInfo
java.lang.SecurityException: Attempt to change component state;
I know this question has been asked a number of times on SO but none of them is about where to write this code.
After Commonsware Suggestion:
I made an alias -
<activity-alias
android:name=".SplashScreen"
android:screenOrientation="portrait"
android:targetActivity=".SplashScreen"
android:theme="#style/SplashTheme"
android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->
<data
android:host="xyz"
android:scheme="abc" />
</intent-filter>
</activity-alias>
So I am calling the code in the oncreate() of the MainActivity which opens after the SplashScreen -
2019-10-06 04:49:52.578 23014-23014/com.khaalijeb.inkdrops.debug
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.khaalijeb.inkdrops.debug, PID: 23014
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.khaalijeb.inkdrops.debug/com.khaalijeb.inkdrops.MainActivity}:
java.lang.SecurityException: Attempt to change component state;
pid=23014, uid=10262, component=com.khaalijeb.inkdrops/.SplashScreen
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: java.lang.SecurityException: Attempt to change component state; pid=23014, uid=10262,
component=com.khaalijeb.inkdrops/.SplashScreen
at android.os.Parcel.createException(Parcel.java:2071)
at android.os.Parcel.readException(Parcel.java:2039)
at android.os.Parcel.readException(Parcel.java:1987)
at android.content.pm.IPackageManager$Stub$Proxy.setComponentEnabledSetting(IPackageManager.java:7336)
at android.app.ApplicationPackageManager.setComponentEnabledSetting(ApplicationPackageManager.java:2554)
at com.khaalijeb.inkdrops.MainActivity.onCreate(MainActivity.java:1604)
at android.app.Activity.performCreate(Activity.java:7802)
at android.app.Activity.performCreate(Activity.java:7791)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1306)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: android.os.RemoteException: Remote stack trace:
at com.android.server.pm.PackageManagerService.setEnabledSetting(PackageManagerService.java:21250)
at com.android.server.pm.PackageManagerService.setComponentEnabledSetting(PackageManagerService.java:21184)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:3473)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4015)
at android.os.Binder.execTransactInternal(Binder.java:1021)
This is the same error I was getting.
So, I came to realize after a day of debugging and looking into the Android Developers' Documentation about the ComponentName.
I was implementing it in the debug mode and my packageName is - applicationId + suffix.
as you can see yours in build.gradle.
Previously, I was doing something like
PackageManager pm = getPackageManager();
ComponentName compName =
new ComponentName(this, getPackageName() + ".AliasSplashScreen");
pm.setComponentEnabledSetting(
compName,
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
PackageManager.DONT_KILL_APP);
Now you see that I was using get package name() which is different for each build but My Class name has no effect due to this.
My class Name is and will always be originalpackagename.classname or more clearly applicationid.className. no matter the build variant(debug or release).
The Correct way is -
PackageManager pm = getPackageManager();
ComponentName compName =
new ComponentName(this, applicationid + ".AliasSplashScreen");
pm.setComponentEnabledSetting(
compName,
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
PackageManager.DONT_KILL_APP);
And as CommonsWare pointed out you have to create an activity-alias in Android Manifest keeping the original one and targetActivity should be the one whose alias you are creating with the desired intent-filter inside that and use the above code to disable it in the onCreate() of the Next Activity and to enable it use PackageManager.COMPONENT_ENABLED_STATE_ENABLED
I implemented a TTS service for Android which works as expected. I can also manage its settings via the Text To Speech section of the Android Settings app.
However, on a Pixel tablet running Android 8.1, the settings app crashes for my TTS implementation with the following exception:
2019-02-25 10:45:46.396 5816-5816/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.android.settings, PID: 5816
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Intent.migrateExtraStreamToClipData()' on a null object reference
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1742)
at android.app.Activity.startActivityForResult(Activity.java:5168)
at android.app.Activity.startActivityFromFragment(Activity.java:5144)
at android.app.Activity$HostCallbacks.onStartActivityFromFragment(Activity.java:7690)
at android.app.Fragment.startActivity(Fragment.java:1075)
at android.app.Fragment.startActivity(Fragment.java:1054)
at com.android.settings.tts.TextToSpeechSettings.onGearClick(TextToSpeechSettings.java:780)
at com.android.settings.widget.GearPreference.onClick(GearPreference.java:71)
at android.view.View.performClick(View.java:6294)
at android.view.View$PerformClick.run(View.java:24770)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
I could not find any docs of what setting implementation I am required to implement for the Service. Any hint?
What I was missing is a metadata which points to the settings activity of my service (a class that extends PreferenceActivity, EngineSettings here):
In AndroidManifest.xml:
<service
android:name=".MyTtsService"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.TTS_SERVICE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="android.speech.tts" android:resource="#xml/tts_engine" />
</service>
And tts_engine.xml:
<?xml version="1.0" encoding="utf-8"?>
<tts-engine xmlns:android="http://schemas.android.com/apk/res/android"
android:settingsActivity="com.mytts.EngineSettings" />
I'm developing an App that can be Screen Pinned aka Corporate Owned Single Use aka Lock Task Mode.
If I pin it and then:
I close it (killing it) and then I launch it again
or after some code modification in android studio and then perform Run
restart after pin and unpin
I get the following error:
[homtom-ht3_pro-0123456789ABCDEF]: E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.xx.yyy, PID: 7928
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xx.yyy/com.xx.yyy.activities.LauncherActivity}: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.xx.yyy/com.xx.yy.activities.StartActivity}; have you declared this activity in your AndroidManifest.xml?
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2534)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2614)
at android.app.ActivityThread.access$800(ActivityThread.java:178)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5643)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.xx.yyy/com.xx.yyy.activities.StartActivity}; have you declared this activity in your AndroidManifest.xml?
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1788)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1512)
at android.app.Activity.startActivityForResult(Activity.java:3809)
at android.support.v4.app.BaseFragmentActivityJB.startActivityForResult(BaseFragmentActivityJB.java:50)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:79)
at android.app.Activity.startActivityForResult(Activity.java:3760)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:859)
at android.app.Activity.startActivity(Activity.java:4090)
at android.app.Activity.startActivity(Activity.java:4058)
at com.xx.yyy.activities.LauncherActivity.onCreate(LauncherActivity.java:16)
at android.app.Activity.performCreate(Activity.java:6099)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1112)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2481)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2614)
at android.app.ActivityThread.access$800(ActivityThread.java:178)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5643)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
This is my Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xx.yyy">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<receiver
android:name=".receivers.DeviceAdminReceiver"
android:description="#string/app_name"
android:label="#string/app_name"
android:permission="android.permission.BIND_DEVICE_ADMIN">
<meta-data
android:name="android.app.device_admin"
android:resource="#xml/device_admin_receiver" />
<intent-filter>
<action android:name="android.intent.action.DEVICE_ADMIN_ENABLED" />
<action android:name="android.intent.action.PROFILE_PROVISIONING_COMPLETE" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<activity android:name=".activities.LauncherActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activities.StartActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
If I don't ever pin the app I can restart/upgrade&run it many times I want.
The nice thing is that is not even possible to uninstall the app because it has been configured as Device Owner, and so, it cannot be uninstalled unless a factory reset.
I dont understand how is possible that my activity disappears after an app restart. Can be something related to the intent category or action?
If anyone else encountered this behavior can tell me I will submit an issue to the bug report site.
Thanks.
EDIT 18/3
I think maybe this is happening because at a certain point, I kill the home category activity that in my case is the missing StartActivity in question, and it is not restarted even if I restart the app.
Found the solution in my COSU disable pinning implementation, I was doing:
PackageManager mPackageManager = getApplicationContext().getPackageManager();;
mPackageManager.setComponentEnabledSetting(
new ComponentName(getApplicationContext(), StartActivity.class),
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
PackageManager.DONT_KILL_APP);
to disable the pinning on device boot, but this actually disable the specified component.
The correct implementation would be:
PackageManager mPackageManager = getApplicationContext().getPackageManager();;
mPackageManager.setComponentEnabledSetting(
new ComponentName(getApplicationContext(), StartActivity.class),
PackageManager.COMPONENT_ENABLED_STATE_DEFAULT,
PackageManager.DONT_KILL_APP);
My application was working ok, but after i added the push notifications from parse server, i started getting an error when the app is launched (see message below), while the app open and work ok, when i close the app the same is not doing the background search and notification.
09-30 17:22:12.006 10338-10349/br.com.inconnet.inbeacon E/Parcel: Class not found when unmarshalling: org.altbeacon.beacon.service.StartRMData
java.lang.ClassNotFoundException: org.altbeacon.beacon.service.StartRMData
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:324)
at android.os.Parcel.readParcelableCreator(Parcel.java:2404)
at android.os.Parcel.readParcelable(Parcel.java:2358)
at android.os.Message.readFromParcel(Message.java:571)
at android.os.Message.-wrap0(Message.java)
at android.os.Message$1.createFromParcel(Message.java:527)
at android.os.Message$1.createFromParcel(Message.java:525)
at android.os.IMessenger$Stub.onTransact(IMessenger.java:51)
at android.os.Binder.execTransact(Binder.java:453)
Caused by: java.lang.ClassNotFoundException: org.altbeacon.beacon.service.StartRMData
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:324)
at android.os.Parcel.readParcelableCreator(Parcel.java:2404)
at android.os.Parcel.readParcelable(Parcel.java:2358)
at android.os.Message.readFromParcel(Message.java:571)
at android.os.Message.-wrap0(Message.java)
at android.os.Message$1.createFromParcel(Message.java:527)
at android.os.Message$1.createFromParcel(Message.java:525)
at android.os.IMessenger$Stub.onTransact(IMessenger.java:51)
at android.os.Binder.execTransact(Binder.java:453)
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
if i remove the following information from my AndroidManifest.xml, the app works ok again.
<meta-data android:name="com.parse.push.gcm_sender_id"
android:value="id:xxxxxx" />
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="br.com.inconnet.inbeacon" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.ParsePushBroadcastReceiver" android:exported="false">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.OPEN" />
<action android:name="com.parse.push.intent.DELETE" />
</intent-filter>
</receiver>
How can i make both work thogeter?
A similar problem has been reported by folks who are bundling their apps with certain other services and the Android Beacon Library. There is no known fix or even a fully understood cause. You can read more about the issue here:
https://github.com/AltBeacon/android-beacon-library/issues/306
One theory is that bundling some services with your app somehow forces other services in the app to run in a separate process, something the Android Beacon Library does not support.
If you have proguard settings enabled, you may want to try disabling them to see if this makes the problem go away.