Xamarin Android Push Notifications not working

I'm trying to get Urban Airship to work with my Android Xamarin app. I was able to successfully get iOS running easily, by following the instructions here: https://components.xamarin.com/gettingstarted/urbanairship

For android, I did not get any push notifications no matter what I did. I referenced the manifest config from this sample projecthttps://github.com/xamarin/monodroid-samples/tree/master/UrbanAirship but it looks a little outdated for the latest Xamarin bindings.

I tried adding an IntentReceiver in my app as well, and none of my methods are being called.

Didn't find what you were looking for?

New post

Comments

31 comments

  • Hi Phil!

    I would avoid using the sample from the github repo you linked. As you only saw, it's quite old.

    Instead, you'll want to follow the instructions linked in our docs for setting up Android, which can be found here:

    Android Setup

     

    Also, if you have logs from logcat, that would be helpful to take a look at and see if there is anything in there that we can look at to see what the problem is. It sounds like it may be an IntentReceiver problem, but we'll take a look and see.

     

    0
  • Found some useful information in logcat. I've attached the logcat logs and my AndroidManifest.xml file. I'll see if I can make any headway with these errors until I hear back.

     

     

    0
  • I am also getting a ClassNotFoundException, but it looks like the class (IntentReceiver) is namespaced to the app in the exception stacktrace.

    0
  • I was able to resolve the ClassNotFoundException errors. Looks like my custom IntentReceiver methods are now being run. I'm still getting the error

    AndroidManifest.xml missing required receiver: com.urbanairship.push.GcmPushReceiver

    And push notifications are still not working, devices aren't being registered in Urban Airship.

    0
  • Looks like its an issue with the 2.0.0 version of the plugin. While we work on a fix, you can hopefully work around it by adding https://gist.github.com/rlepinski/bd5e8e8717c16c99f543 to your manifest.

     

    0
  • I was able to resolve all the logcat errors, but I am not getting any override methods triggered in my IntentReceiver. I've attached updated manifest and IntentReceiver below.

    0
  • So I am not sure how Xamarin treats receivers that are both defined in the C# file and in the Manifest. I would recommend removing the android manifest entry and instead define the entry at the top of the IntentReceiver.cs file. Here is an example - https://gist.github.com/rlepinski/3286cc833fe7be35593a

    0
  • Still working on narrowing down the root cause, but it appears like the problem is with the <uses-sdk /> element in my manifest. I created a new app to test out UA, and push notifications worked. The only difference in the manifest is that the new app has <uses-sdk android:minSdkVersion="16" />. I noticed that LogCat has 'Google Play Store available. Setting platform to Android` on first launch of app IF the push notifications are going to work.

     

    I removed my IntentReceiver.cs file while trying to narrow this problem down, will add it back in and see if I can intercept the messages.

    0
  • I had to clear out all visual studio temp folders (bin & obj) once I added the <uses-sdk android:minSdkVersion="16" /> element, but I was able to get push notifications working. Thank you for your help!

    0
  • No problem!

    0
  • So push notifications work when I run in Debug mode, but when I try to do a Release build to generate an .APK file, I get the following error. I confirmed that the com.sample namespace matches my app:

     

    02-19 16:36:01.174 E/Sample App - UALib(23300): Failed to insert in UrbanAirshipProvider.
    02-19 16:36:01.174 E/Sample App - UALib(23300): java.lang.IllegalArgumentException: Unknown URL content://com.sample.urbanairship.provider/preferences
    02-19 16:36:01.174 E/Sample App - UALib(23300): at android.content.ContentResolver.insert(ContentResolver.java:1213)
    02-19 16:36:01.174 E/Sample App - UALib(23300): at com.urbanairship.UrbanAirshipResolver.insert(UrbanAirshipResolver.java:77)
    02-19 16:36:01.174 E/Sample App - UALib(23300): at com.urbanairship.PreferenceDataStore$Preference.writeValue(PreferenceDataStore.java:447)
    02-19 16:36:01.174 E/Sample App - UALib(23300): at com.urbanairship.PreferenceDataStore$Preference.access$000(PreferenceDataStore.java:355)
    02-19 16:36:01.174 E/Sample App - UALib(23300): at com.urbanairship.PreferenceDataStore$Preference$1.run(PreferenceDataStore.java:387)
    02-19 16:36:01.174 E/Sample App - UALib(23300): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
    02-19 16:36:01.174 E/Sample App - UALib(23300): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
    02-19 16:36:01.174 E/Sample App - UALib(23300): at java.lang.Thread.run(Thread.java:818)

    0
  • Turns out apparently the Xamarin SDK doesn't insert the necessary properties into the manifest file if you have the linker set to SDK Assemblies or SDK & User Assemblies. It only inserts the correct manifest settings if you aren't using the linker. Is there any estimate how long it would take to fix this?

    0
  • Thanks for figuring this out. We are looking into this problem. Hopefully we have a solution for you sometime next week. I believe we need to just add another attribute to the top of our components that are only referenced in the manifest - https://developer.xamarin.com/guides/android/advanced_topics/linking/ but we will need to do some extra testing. For now disabling the linker is probably the only workaround.

    0
  • Hi, I'm using 2.2.0 but no luck. Please need backup, followed instructions but no luck. On iOS, instead, all system go.

    0
  • Hi Mike,

    Thanks for the response. Is the issue you are having the same as what Phil was running into?

    If not, please go ahead and create a new thread and we can help you in that thread.

    0
  • Hi Michael. 
    The error is the same, I am using sample project from Component Store in Xamarin. iOS one goes without problems. No way with Android. I can paste you a dump of my logcat if you want

    0
  • Mike,

    If you could attach the logcat, that would be fantastic!

    0
  • Ok, got the solution: By default, Installing by component manager in Xamarin Studio installs v2.1.0. After closing and reopening Xamarin Studio, it brings me an update to 2.2.0. 

    After updating, finally no errors in "Event Services" in logcat and notification instantly works!

    Now I have another problem: when I use the Android Sample project, all system goes. 
    When I start a project from zero, no way: I ever got a "Development Key cannot be null" Exception when launching the app. 

    1) The name of the file is right: airshipconfig.properties (under Assets, generated as AndroidAsset
    2) I've copied exactly from the sample and obviously changed my keys and senderID. No luck

    0
  • (If I must open another thread just tell me! Thank you!)

    0
  • Could you paste your takeOff section of your application and logs?

     

    0
  • ---- MainApp.cs ----

    using System;
    using Android.App;
    using UrbanAirship;
    using UrbanAirship.Push;
    using UrbanAirship.Analytics;

    using Android.Runtime;

    [Application]
    public class MainApp : Application
    {
        public MainApp(IntPtr handle, JniHandleOwnership ownerShip) : base(handle, ownerShip)
        {
        }

        public override void OnCreate()
        {
            base.OnCreate();

            // Call takeOff
            UAirship.TakeOff(this, (UAirship airship) => {
                airship.PushManager.UserNotificationsEnabled = true;
                airship.PushManager.Tags = new String[]{ "android-xamarin" };
            });
        }
    }

    ---- /MainApp.cs ----

    ---- LOGS ----

    Forwarding debugger port 8860
    Detecting existing process
    Loaded assembly: /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/XamarinAPNSandroid.dll
    Loaded assembly: /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.Android.Support.v4.dll [External]
    Loaded assembly: /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.Android.Support.v7.CardView.dll [External]
    Loaded assembly: /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/AirshipBindings.dll [External]
    Loaded assembly: /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.GooglePlayServices.Basement.dll [External]
    Loaded assembly: /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.GooglePlayServices.Base.dll [External]
    [art] Late-enabling -Xcheck:jni
    [monodroid] Using override path: /data/data/com.devoloop.test.xamarinapns/files/.__override__
    [monodroid] Using override path: /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__
    [monodroid] Trying to load sgen from: /data/data/com.devoloop.test.xamarinapns/files/.__override__/libmonosgen-2.0.so
    [monodroid] Trying to load sgen from: /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/libmonosgen-2.0.so
    [monodroid] Trying to load sgen from: /data/app/com.devoloop.test.xamarinapns-1/lib/x86/libmonosgen-2.0.so
    [monodroid] Trying to load sgen from: /data/data/com.devoloop.test.xamarinapns/files/.__override__/links/libmonosgen-2.0.so
    [monodroid-debug] Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=127.0.0.1:8860,server=y,embedding=1
    [Mono] Assembly Loader probing location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/mscorlib.dll'.
    [Mono] Image addref mscorlib[0xb42df100] -> /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/mscorlib.dll[0xb403ce00]: 2
    [Mono] AOT module '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/mscorlib.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-mscorlib.dll.so" not found
    [Mono] AOT module '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/lib/mono/aot-cache/x86/mscorlib.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-mscorlib.dll.so" not found
    [Mono] Assembly Loader loaded assembly from location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/mscorlib.dll'.
    [Mono] Config attempting to parse: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/mscorlib.dll.config'.
    [Mono] Config attempting to parse: '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/etc/mono/assemblies/mscorlib/mscorlib.config'.
    [Mono] Assembly mscorlib[0xb42df100] added to domain RootDomain, ref_count=1
    [Mono] Assembly Loader probing location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/XamarinAPNSandroid.dll'.
    [Mono] Image addref XamarinAPNSandroid[0xb40f1f40] -> /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/XamarinAPNSandroid.dll[0xb403d800]: 2
    [Mono] Assembly XamarinAPNSandroid[0xb40f1f40] added to domain RootDomain, ref_count=1
    [Mono] AOT module '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/XamarinAPNSandroid.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-XamarinAPNSandroid.dll.so" not found
    [Mono] AOT module '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/lib/mono/aot-cache/x86/XamarinAPNSandroid.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-XamarinAPNSandroid.dll.so" not found
    [Mono] Assembly Loader loaded assembly from location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/XamarinAPNSandroid.dll'.
    [Mono] Config attempting to parse: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/XamarinAPNSandroid.dll.config'.
    [Mono] Config attempting to parse: '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/etc/mono/assemblies/XamarinAPNSandroid/XamarinAPNSandroid.config'.
    [Mono] Assembly Loader probing location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.Android.Support.v4.dll'.
    [Mono] Image addref Xamarin.Android.Support.v4[0xb40f1fa0] -> /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.Android.Support.v4.dll[0xb403dd00]: 2
    [Mono] Assembly Xamarin.Android.Support.v4[0xb40f1fa0] added to domain RootDomain, ref_count=1
    [Mono] AOT module '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.Android.Support.v4.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-Xamarin.Android.Support.v4.dll.so" not found
    [Mono] AOT module '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/lib/mono/aot-cache/x86/Xamarin.Android.Support.v4.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-Xamarin.Android.Support.v4.dll.so" not found
    [Mono] Assembly Loader loaded assembly from location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.Android.Support.v4.dll'.
    [Mono] Config attempting to parse: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.Android.Support.v4.dll.config'.
    [Mono] Config attempting to parse: '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/etc/mono/assemblies/Xamarin.Android.Support.v4/Xamarin.Android.Support.v4.config'.
    Loaded assembly: /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.GooglePlayServices.Measurement.dll [External]
    [Mono] Assembly Loader probing location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.Android.Support.v7.CardView.dll'.
    [Mono] Image addref Xamarin.Android.Support.v7.CardView[0xb42df1c0] -> /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.Android.Support.v7.CardView.dll[0xb403e200]: 2
    [Mono] Assembly Xamarin.Android.Support.v7.CardView[0xb42df1c0] added to domain RootDomain, ref_count=1
    [Mono] AOT module '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.Android.Support.v7.CardView.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-Xamarin.Android.Support.v7.CardView.dll.so" not found
    [Mono] AOT module '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/lib/mono/aot-cache/x86/Xamarin.Android.Support.v7.CardView.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-Xamarin.Android.Support.v7.CardView.dll.so" not found
    [Mono] Assembly Loader loaded assembly from location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.Android.Support.v7.CardView.dll'.
    [Mono] Config attempting to parse: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.Android.Support.v7.CardView.dll.config'.
    [Mono] Config attempting to parse: '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/etc/mono/assemblies/Xamarin.Android.Support.v7.CardView/Xamarin.Android.Support.v7.CardView.config'.
    [Mono] Assembly Loader probing location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/AirshipBindings.dll'.
    [Mono] Image addref AirshipBindings[0xb42df400] -> /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/AirshipBindings.dll[0xb403e700]: 2
    [Mono] Assembly AirshipBindings[0xb42df400] added to domain RootDomain, ref_count=1
    [Mono] AOT module '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/AirshipBindings.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-AirshipBindings.dll.so" not found
    [Mono] AOT module '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/lib/mono/aot-cache/x86/AirshipBindings.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-AirshipBindings.dll.so" not found
    [Mono] Assembly Loader loaded assembly from location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/AirshipBindings.dll'.
    [Mono] Config attempting to parse: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/AirshipBindings.dll.config'.
    [Mono] Config attempting to parse: '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/etc/mono/assemblies/AirshipBindings/AirshipBindings.config'.
    [Mono] Assembly Loader probing location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.GooglePlayServices.Basement.dll'.
    [Mono] Image addref Xamarin.GooglePlayServices.Basement[0xb42df4c0] -> /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.GooglePlayServices.Basement.dll[0xb403f100]: 2
    [Mono] Assembly Xamarin.GooglePlayServices.Basement[0xb42df4c0] added to domain RootDomain, ref_count=1
    [Mono] AOT module '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.GooglePlayServices.Basement.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-Xamarin.GooglePlayServices.Basement.dll.so" not found
    [Mono] AOT module '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/lib/mono/aot-cache/x86/Xamarin.GooglePlayServices.Basement.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-Xamarin.GooglePlayServices.Basement.dll.so" not found
    [Mono] Assembly Loader loaded assembly from location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.GooglePlayServices.Basement.dll'.
    [Mono] Config attempting to parse: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.GooglePlayServices.Basement.dll.config'.
    [Mono] Config attempting to parse: '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/etc/mono/assemblies/Xamarin.GooglePlayServices.Basement/Xamarin.GooglePlayServices.Basement.config'.
    [Mono] Assembly Loader probing location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.GooglePlayServices.Base.dll'.
    [Mono] Image addref Xamarin.GooglePlayServices.Base[0xb42df700] -> /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.GooglePlayServices.Base.dll[0xb403f600]: 2
    [Mono] Assembly Xamarin.GooglePlayServices.Base[0xb42df700] added to domain RootDomain, ref_count=1
    [Mono] AOT module '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.GooglePlayServices.Base.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-Xamarin.GooglePlayServices.Base.dll.so" not found
    [Mono] AOT module '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/lib/mono/aot-cache/x86/Xamarin.GooglePlayServices.Base.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-Xamarin.GooglePlayServices.Base.dll.so" not found
    [Mono] Assembly Loader loaded assembly from location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.GooglePlayServices.Base.dll'.
    [Mono] Config attempting to parse: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.GooglePlayServices.Base.dll.config'.
    [Mono] Config attempting to parse: '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/etc/mono/assemblies/Xamarin.GooglePlayServices.Base/Xamarin.GooglePlayServices.Base.config'.
    [Mono] Assembly Loader probing location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.GooglePlayServices.Measurement.dll'.
    Loaded assembly: /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.GooglePlayServices.Gcm.dll [External]
    [Mono] Image addref Xamarin.GooglePlayServices.Measurement[0xb42df7c0] -> /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.GooglePlayServices.Measurement.dll[0xb403fb00]: 2
    [Mono] Assembly Xamarin.GooglePlayServices.Measurement[0xb42df7c0] added to domain RootDomain, ref_count=1
    [Mono] AOT module '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.GooglePlayServices.Measurement.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-Xamarin.GooglePlayServices.Measurement.dll.so" not found
    [Mono] AOT module '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/lib/mono/aot-cache/x86/Xamarin.GooglePlayServices.Measurement.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-Xamarin.GooglePlayServices.Measurement.dll.so" not found
    [Mono] Assembly Loader loaded assembly from location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.GooglePlayServices.Measurement.dll'.
    [Mono] Config attempting to parse: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.GooglePlayServices.Measurement.dll.config'.
    [Mono] Config attempting to parse: '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/etc/mono/assemblies/Xamarin.GooglePlayServices.Measurement/Xamarin.GooglePlayServices.Measurement.config'.
    [Mono] Assembly Loader probing location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.GooglePlayServices.Gcm.dll'.
    [Mono] Image addref Xamarin.GooglePlayServices.Gcm[0xb42df880] -> /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.GooglePlayServices.Gcm.dll[0xb4040500]: 2
    [Mono] Assembly Xamarin.GooglePlayServices.Gcm[0xb42df880] added to domain RootDomain, ref_count=1
    [Mono] AOT module '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.GooglePlayServices.Gcm.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-Xamarin.GooglePlayServices.Gcm.dll.so" not found
    [Mono] AOT module '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/lib/mono/aot-cache/x86/Xamarin.GooglePlayServices.Gcm.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-Xamarin.GooglePlayServices.Gcm.dll.so" not found
    [Mono] Assembly Loader loaded assembly from location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.GooglePlayServices.Gcm.dll'.
    [Mono] Config attempting to parse: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Xamarin.GooglePlayServices.Gcm.dll.config'.
    [Mono] Config attempting to parse: '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/etc/mono/assemblies/Xamarin.GooglePlayServices.Gcm/Xamarin.GooglePlayServices.Gcm.config'.
    [Mono] Assembly Loader probing location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/System.ServiceModel.Internals.dll'.
    [Mono] Image addref System.ServiceModel.Internals[0xb42df940] -> /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/System.ServiceModel.Internals.dll[0xb4040a00]: 2
    [Mono] Assembly System.ServiceModel.Internals[0xb42df940] added to domain RootDomain, ref_count=1
    [Mono] AOT module '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/System.ServiceModel.Internals.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-System.ServiceModel.Internals.dll.so" not found
    [Mono] AOT module '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/lib/mono/aot-cache/x86/System.ServiceModel.Internals.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-System.ServiceModel.Internals.dll.so" not found
    [Mono] Assembly Loader loaded assembly from location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/System.ServiceModel.Internals.dll'.
    [Mono] Config attempting to parse: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/System.ServiceModel.Internals.dll.config'.
    [Mono] Config attempting to parse: '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/etc/mono/assemblies/System.ServiceModel.Internals/System.ServiceModel.Internals.config'.
    [monodroid-gc] GREF GC Threshold: 46080
    [Mono] Assembly Loader probing location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Mono.Android.dll'.
    [Mono] Image addref Mono.Android[0xb42dfa00] -> /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Mono.Android.dll[0xb4040f00]: 2
    [Mono] Assembly Mono.Android[0xb42dfa00] added to domain RootDomain, ref_count=1
    [Mono] AOT module '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Mono.Android.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-Mono.Android.dll.so" not found
    [Mono] AOT module '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/lib/mono/aot-cache/x86/Mono.Android.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-Mono.Android.dll.so" not found
    [Mono] Assembly Loader loaded assembly from location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Mono.Android.dll'.
    [Mono] Config attempting to parse: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Mono.Android.dll.config'.
    [Mono] Config attempting to parse: '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/etc/mono/assemblies/Mono.Android/Mono.Android.config'.
    [Mono] Assembly Ref addref Mono.Android[0xb42dfa00] -> mscorlib[0xb42df100]: 2
    Loaded assembly: /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/System.ServiceModel.Internals.dll [External]
    Loaded assembly: /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/Mono.Android.dll [External]
    [Mono] DllImport attempting to load: '__Internal'.
    [Mono] DllImport loaded library '(null)'.
    [Mono] DllImport searching in: '__Internal' ('(null)').
    [Mono] Searching for '_monodroid_lref_log_new'.
    [Mono] Probing '_monodroid_lref_log_new'.
    [Mono] Found as '_monodroid_lref_log_new'.
    [Mono] DllImport searching in: '__Internal' ('(null)').
    [Mono] Searching for '_monodroid_lref_log_delete'.
    [Mono] Probing '_monodroid_lref_log_delete'.
    [Mono] Found as '_monodroid_lref_log_delete'.
    [Mono] DllImport searching in: '__Internal' ('(null)').
    [Mono] Searching for '_monodroid_gref_log_new'.
    [Mono] Probing '_monodroid_gref_log_new'.
    [Mono] Found as '_monodroid_gref_log_new'.
    [Mono] DllImport searching in: '__Internal' ('(null)').
    [Mono] Searching for '_monodroid_get_identity_hash_code'.
    [Mono] Probing '_monodroid_get_identity_hash_code'.
    [Mono] Found as '_monodroid_get_identity_hash_code'.
    [Mono] DllImport searching in: '__Internal' ('(null)').
    [Mono] Searching for 'monodroid_typemap_java_to_managed'.
    [Mono] Probing 'monodroid_typemap_java_to_managed'.
    [Mono] Found as 'monodroid_typemap_java_to_managed'.
    [Mono] DllImport searching in: '__Internal' ('(null)').
    [Mono] Searching for '_monodroid_gref_log'.
    [Mono] Probing '_monodroid_gref_log'.
    [Mono] Found as '_monodroid_gref_log'.
    [Mono] DllImport searching in: '__Internal' ('(null)').
    [Mono] Searching for 'monodroid_typemap_managed_to_java'.
    [Mono] Probing 'monodroid_typemap_managed_to_java'.
    [Mono] Found as 'monodroid_typemap_managed_to_java'.
    [Mono] Assembly Loader probing location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/System.Core.dll'.
    [Mono] Image addref System.Core[0xb42dfe80] -> /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/System.Core.dll[0xb4042d00]: 2
    [Mono] Assembly System.Core[0xb42dfe80] added to domain RootDomain, ref_count=1
    [Mono] AOT module '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/System.Core.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-System.Core.dll.so" not found
    [Mono] AOT module '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/lib/mono/aot-cache/x86/System.Core.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-System.Core.dll.so" not found
    [Mono] Assembly Loader loaded assembly from location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/System.Core.dll'.
    [Mono] Config attempting to parse: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/System.Core.dll.config'.
    [Mono] Config attempting to parse: '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/etc/mono/assemblies/System.Core/System.Core.config'.
    [Mono] Assembly Ref addref Mono.Android[0xb42dfa00] -> System.Core[0xb42dfe80]: 2
    [Mono] Assembly Ref addref System.Core[0xb42dfe80] -> mscorlib[0xb42df100]: 3
    Loaded assembly: /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/System.Core.dll [External]
    [Mono] DllImport searching in: '__Internal' ('(null)').
    [Mono] Searching for '_monodroid_gref_log_delete'.
    [Mono] Probing '_monodroid_gref_log_delete'.
    [Mono] Found as '_monodroid_gref_log_delete'.
    [Mono] DllImport searching in: '__Internal' ('(null)').
    [Mono] Searching for '_monodroid_gc_wait_for_bridge_processing'.
    [Mono] Probing '_monodroid_gc_wait_for_bridge_processing'.
    [Mono] Found as '_monodroid_gc_wait_for_bridge_processing'.
    [Mono] Assembly Ref addref Xamarin.Android.Support.v4[0xb40f1fa0] -> mscorlib[0xb42df100]: 4
    [Mono] Assembly Ref addref Xamarin.Android.Support.v4[0xb40f1fa0] -> Mono.Android[0xb42dfa00]: 2
    [Mono] Assembly Ref addref Xamarin.Android.Support.v7.CardView[0xb42df1c0] -> mscorlib[0xb42df100]: 5
    [Mono] Assembly Ref addref Xamarin.Android.Support.v7.CardView[0xb42df1c0] -> Mono.Android[0xb42dfa00]: 3
    [Mono] Assembly Ref addref AirshipBindings[0xb42df400] -> mscorlib[0xb42df100]: 6
    [Mono] Assembly Ref addref AirshipBindings[0xb42df400] -> Mono.Android[0xb42dfa00]: 4
    [Mono] Assembly Ref addref Xamarin.GooglePlayServices.Basement[0xb42df4c0] -> mscorlib[0xb42df100]: 7
    [Mono] Assembly Ref addref Xamarin.GooglePlayServices.Basement[0xb42df4c0] -> Mono.Android[0xb42dfa00]: 5
    [Mono] Assembly Ref addref Xamarin.GooglePlayServices.Base[0xb42df700] -> mscorlib[0xb42df100]: 8
    [Mono] Assembly Ref addref Xamarin.GooglePlayServices.Base[0xb42df700] -> Mono.Android[0xb42dfa00]: 6
    [Mono] Assembly Ref addref Xamarin.GooglePlayServices.Measurement[0xb42df7c0] -> mscorlib[0xb42df100]: 9
    [Mono] Assembly Ref addref Xamarin.GooglePlayServices.Measurement[0xb42df7c0] -> Mono.Android[0xb42dfa00]: 7
    [Mono] Assembly Ref addref Xamarin.GooglePlayServices.Gcm[0xb42df880] -> mscorlib[0xb42df100]: 10
    [Mono] Assembly Ref addref Xamarin.GooglePlayServices.Gcm[0xb42df880] -> Mono.Android[0xb42dfa00]: 8
    [GMPM] App measurement is starting up, version: 8487
    [GMPM] To enable debug logging run: adb shell setprop log.tag.GMPM VERBOSE
    [GMPM] GoogleService failed to initialize, status: 10, Missing an expected resource: 'R.string.google_app_id' for initializing Google services. Possible causes are missing google-services.json or com.google.gms.google-services gradle plugin.
    [GMPM] Scheduler not set. Not logging error/warn.
    [Mono] Assembly Ref addref XamarinAPNSandroid[0xb40f1f40] -> Mono.Android[0xb42dfa00]: 9
    [GMPM] Uploading is not possible. App measurement disabled
    [Mono] Assembly Ref addref XamarinAPNSandroid[0xb40f1f40] -> mscorlib[0xb42df100]: 11
    [Mono] Assembly Ref addref XamarinAPNSandroid[0xb40f1f40] -> AirshipBindings[0xb42df400]: 2
    Loaded assembly: MonoDroidConstructors [External]
    Thread started: #2
    [Mono] DllImport attempting to load: '/system/lib/libc.so'.
    [Mono] DllImport loaded library '/system/lib/libc.so'.
    [Mono] DllImport searching in: '/system/lib/libc.so' ('/system/lib/libc.so').
    [Mono] Searching for 'gettid'.
    [Mono] Probing 'gettid'.
    [Mono] Found as 'gettid'.
    [Mono] Assembly Ref addref XamarinAPNSandroid[0xb40f1f40] -> Xamarin.Android.Support.v4[0xb40f1fa0]: 2
    [Mono] Assembly Loader probing location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/System.Runtime.Serialization.dll'.
    [Mono] Image addref System.Runtime.Serialization[0xaec34ca0] -> /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/System.Runtime.Serialization.dll[0xaecec100]: 2
    [Mono] Assembly System.Runtime.Serialization[0xaec34ca0] added to domain RootDomain, ref_count=1
    [Mono] AOT module '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/System.Runtime.Serialization.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-System.Runtime.Serialization.dll.so" not found
    [Mono] AOT module '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/lib/mono/aot-cache/x86/System.Runtime.Serialization.dll.so' not found: dlopen failed: library "/data/app/com.devoloop.test.xamarinapns-1/lib/x86/libaot-System.Runtime.Serialization.dll.so" not found
    [Mono] Assembly Loader loaded assembly from location: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/System.Runtime.Serialization.dll'.
    [Mono] Config attempting to parse: '/storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/System.Runtime.Serialization.dll.config'.
    [Mono] Config attempting to parse: '/Users/builder/data/lanes/3236/ee215fc9/source/monodroid/builds/install/mono-x86/etc/mono/assemblies/System.Runtime.Serialization/System.Runtime.Serialization.config'.
    [Mono] Assembly Ref addref Mono.Android[0xb42dfa00] -> System.Runtime.Serialization[0xaec34ca0]: 2
    [Mono] Assembly Ref addref System.Runtime.Serialization[0xaec34ca0] -> mscorlib[0xb42df100]: 12
    Loaded assembly: /storage/emulated/0/Android/data/com.devoloop.test.xamarinapns/files/.__override__/System.Runtime.Serialization.dll [External]

    ---- /LOGS ----

    0
  • Takeoff code looks fine. I don't see anything about take off in the logs you sent. You could try manually building the airship config options to see if that fixes your issue:

                AirshipConfigOptions options = new AirshipConfigOptions.Builder ()
                    .SetDevelopmentAppKey ("Dev app key")
                    .SetDevelopmentAppSecret ("Dev app secret")
                    .SetInProduction (false)
                    .Build ();

                UAirship.TakeOff(this, options, (UAirship airship) => {
                    airship.PushManager.UserNotificationsEnabled = true;
                    airship.PushManager.Tags = new String[]{ "android-xamarin" };
                });


    If this works, then the problem is probably with either the location of airshipconfig.properties file or maybe we need to set some flag on the file to include in xamarin.




    0
  • Ryan, it works now. But location is right.. what do you need to check this? 

    Thank you!

     

    0
  • Looks like the build action on airshipconfig.properties file in the sample is `AndroidAsset`. Maybe check that? 

    0
  • Yes, it's AndroidAsset on my  project, too.. really dunno.. 

    Maybe you could reproduce the error? Xamarin Studio 5.10.3 on a Mac Pro late 2013. UrbanAirship v2.2.0

    0
  • I just created a brand new Xamarin.Android project from zero, but no luck. 
    Gone fine with AirshipConfigOptions passed directly in the constructor, like before. 

    Really a jigsaw!

    0
  • (I meant into the TakeOff(), sorry)

    0
  • Can you take a screen shot of the `airshipconfig.properties` file properties (File -> Properties) ? Ill try to reproduce.

    0
  • Sure.

     

    0
  • I was unable to reproduce it using Xamarin Studio 5.10.3, Urban Airship v2.2.0, on OS X El Capitan. The only difference I can see is you have "Copy if newer" while the sample's/default is "Do not copy". I also tried using that setting in a new app and was still unable to reproduce.  Not sure whats going on here.

    If you want to move your configuration to a resource file, we also support loading from xml. Create a new xml file in Resources -> xml:

     <AirshipConfigOptions
        notificationIcon = "@drawable/ic_notification"
        notificationAccentColor = "@color/color_accent"
        inProduction = "false"
        productionAppKey = "Your Production App Key"
        productionAppSecret = "Your Production App Secret"
        productionLogLevel = "NONE"
        developmentAppKey = "Your Development App Key"
        developmentAppSecret = "Your Development App Secret"
        developmentLogLevel = "VERBOSE"
        gcmSender = "Your GCM sender ID is your Google API project number (required for GCM)" />
     

     


    Then create the airship config with:

                AirshipConfigOptions options = new AirshipConfigOptions.Builder ()
                    .ApplyConfig (this, Resource.Xml.airship_config)
                    .Build ();

    Docs: http://docs.urbanairship.com/reference/libraries/android/latest/reference/com/urbanairship/AirshipConfigOptions.Builder.html#applyConfig(android.content.Context, int)

    0

Please sign in to leave a comment.