Version: 9.1.8.0 (Visual Studio Community)
Supported Android versions:
6.0 (API level 23)
7.1 (API level 25)
8.0 (API level 26)
8.1 (API level 27)
10.14.2
70.1501.0-preview2
Error (24512) / AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.iid.FirebaseInstanceId.getInstanceId()' on a null object reference
Use FirebaseInstanceId in your code
Similar to
https://github.com/xamarin/GooglePlayServicesComponents/issues/134
Error (24512) / AndroidRuntime: java.lang.RuntimeException: An error occurred while executing doInBackground()
Error (24512) / AndroidRuntime: at android.os.AsyncTask$3.done(AsyncTask.java:353)
Error (24512) / AndroidRuntime: at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
Error (24512) / AndroidRuntime: at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
Error (24512) / AndroidRuntime: at java.util.concurrent.FutureTask.run(FutureTask.java:271)
Error (24512) / AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
Error (24512) / AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
Error (24512) / AndroidRuntime: at java.lang.Thread.run(Thread.java:764)
Error (24512) / AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.iid.FirebaseInstanceId.getInstanceId()' on a null object reference
Error (24512) / AndroidRuntime: at android.support.v4.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:391)
Error (24512) / AndroidRuntime: at android.support.v4.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:382)
Error (24512) / AndroidRuntime: at android.os.AsyncTask$2.call(AsyncTask.java:333)
Error (24512) / AndroidRuntime: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
Error (24512) / AndroidRuntime: ... 3 more
VS bug #835462
=== Visual Studio Community 2017 for Mac ===
Version 7.8.3 (build 2)
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 5.0.0.0 ( / b40230c0)
Package version: 516010000
=== Mono Framework MDK ===
Runtime:
Mono 5.16.1.0 (2018-06/a76b50e5faa) (64-bit)
Package version: 516010000
=== NuGet ===
Version: 4.8.2.5835
=== .NET Core ===
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
2.1.9
2.1.8
2.1.7
2.1.2
2.0.5
2.0.0
SDK: /usr/local/share/dotnet/sdk/2.1.505/Sdks
SDK Versions:
2.1.505
2.1.504
2.1.503
2.1.302
2.1.4
2.0.0
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.16.1/lib/mono/msbuild/15.0/bin/Sdks
=== Xamarin.Profiler ===
Version: 1.6.4
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
=== Updater ===
Version: 11
=== Apple Developer Tools ===
Xcode 10.1 (14460.46)
Build 10B61
=== Xamarin.Mac ===
Version: 5.2.1.16 (Visual Studio Community)
Hash: 2dc06c71
Branch:
Build date: 2019-02-12 23:09:50-0500
=== Xamarin.Android ===
SDK Tools Version: 26.1.1
SDK Platform Tools Version: 28.0.1
SDK Build Tools Version: 28.0.3
=== Microsoft Mobile OpenJDK ===
Java SDK: /Users/Can/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL
=== Android Device Manager ===
Version: 7.8.1.0
Hash: 8924ea4a
=== Xamarin Inspector ===
Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1
=== Xamarin.iOS ===
Version: 12.2.1.15 (Visual Studio Community)
Hash: d60abd198
Branch: d15-9
Build date: 2019-02-01 12:23:29-0500
=== Build Information ===
Release ID: 708030002
Git revision: fd02e670fdd6b101bc9c08b1cc5b7710d9f58cd8
Build date: 2019-03-08 10:30:21+00
Build branch: release-7.8
Xamarin extensions: 1f72f0a3737128552336f27e189d3c4f0cdebd00
=== Operating System ===
Mac OS X 10.14.2
Darwin 18.2.0 Darwin Kernel Version 18.2.0
Mon Nov 12 20:24:46 PST 2018
root:xnu-4903.231.4~2/RELEASE_X86_64 x86_64
It looks like sometimes a full clean and rebuild is required after adding the google-services.json file and setting it as a GoogleServicesJson build action. Please try this and try again, I can't reproduce this error locally, it's working correctly for me when everything is properly setup.
I wish it was that easy..when you say you can't reproduce, are you using the same set up as me?
"FirebaseInstanceId.Instance.Token" Are you getting an instance of the FirebaseInstanceId in your code?
These are the packages I'm using. Please try with exact Visual Studio Community 2017 for Mac version 7.8.3 (build 2), OS target 8.1(Oreo), and packages attached below.
This issue is fixed by targeting framework 9.0(API 28), and retargeting the packages, although there is another Firebase related issue which is tracked separately here:
https://github.com/xamarin/xamarin-android/issues/2921
Not closing this issue in case a fix is planned for API level 27.
Sorry, but you'll need to target API 28 to use these packages going forward, and use Android Support 28.x. I expect Google will start switching newer versions of Google Play Services over to use AndroidX which is API28+ as well in the near future.
HI:
the problem still exists
Any news? I also have this problem using the latest library and targeting api 28
The raised exception is the same as per #191
This happened after updating the google libraries from v60 to v71. I tried both with all support packages v28 and after migrating to androidX, same output
same here :/
I'm having this issue too
try adding manifestMerger support to the app:
<PropertyGroup>
<AndroidManifestMerger>manifestmerger.jar</AndroidManifestMerger>
</PropertyGroup>
And please provide feedback.
Adding the manifest merger package fixed the problem, thanks!
@EmmanueleVilla Thanks a lot for your feedback. Appreciated.
closing this one
Most helpful comment
HI:
the problem still exists