Bug 59917 - AppLinks package causes unhandled exception in release build only
Summary: AppLinks package causes unhandled exception in release build only
Status: CONFIRMED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android (show other bugs)
Version: 2.4.0
Hardware: Macintosh Mac OS
: Normal major
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-10-03 13:59 UTC by Alex Vilens
Modified: 2017-10-25 18:42 UTC (History)
3 users (show)

See Also:
Tags: applinks, release, ac
Is this bug a regression?: ---
Last known good build:


Attachments
logcat fragment shows the exception (5.80 KB, text/plain)
2017-10-03 13:59 UTC, Alex Vilens
Details
Get-Package list (11.28 KB, text/plain)
2017-10-07 17:23 UTC, Alex Vilens
Details

Description Alex Vilens 2017-10-03 13:59:42 UTC
Created attachment 25072 [details]
logcat fragment shows the exception

Hello,

This call:  

Application.Current.AppLinks.RegisterLink(_appLink);

causes this exception, but only in build "Release" mode:

I/MonoDroid(24606): UNHANDLED EXCEPTION:
I/MonoDroid(24606): Java.Lang.LinkageError: no non-static method "Lcom/google/android/gms/internal/zzkk;.start(Lcom/google/android/gms/common/api/GoogleApiClient;Lcom/google/android/gms/appindexing/Action;)Lcom/google/android/gms/common/api/PendingResult;"

I'm getting the same exception with:

Xamarin.Forms.AppLinks 2.3.4.247 and with 2.4.0.282.
Xamarin.GooglePlayServices.AppIndexing 29.0.0.1 and 29.0.0.2.
Xamarin.GooglePlayServices.Base 29.0.0.1 and 29.0.0.2.
Xamarin.GooglePlayServices.Basement 29.0.0.1 and 29.0.0.2.

While running in Debug mode, AppLinks package does not fail and produces expected results.

Thank you,
Alex.
Comment 1 Paul DiPietro [MSFT] 2017-10-06 16:28:24 UTC
Can you upload a reproduction? Have you checked for all of your packages versions being aligned correctly, proper SDKs installed, clean/rebuild and delete bin/obj folders, etc.?
Comment 2 Alex Vilens 2017-10-06 18:03:37 UTC
Hello Paul,

I can reliably reproduce the issue on a Genymotion VM, and on a physical Nexus 6 phone. I did check packages and their versions -- everything looks ok to me.  

I did do clean/rebuild and delete bin/obj folders.

How can I export my packages and their versions information, so you can take a look at it?

Thank you,
Alex.
Comment 3 Alex Vilens 2017-10-07 02:25:45 UTC
The problem persists in release build regardless of any "Enable ProGuard" and "Linking" settings combination.
Comment 4 Alex Vilens 2017-10-07 17:23:40 UTC
Created attachment 25207 [details]
Get-Package list
Comment 5 Paul DiPietro [MSFT] 2017-10-09 14:35:38 UTC
An actual reproduction might be helpful since the DeepLinking sample project using AppLinks looks to build in release mode.
Comment 6 Alex Vilens 2017-10-09 14:37:05 UTC
It does build in release mode without an issue, but did you try to run the app?
Comment 7 Alex Vilens 2017-10-09 17:06:59 UTC
The DeepLinking sample project does build in Release mode, and executes fine.

I've compared both solutions, and unfortunately, cannot find a significant difference, in my opinion.

It must be a way to find a missing package/module from a final release build/assembly.
Comment 8 Alex Vilens 2017-10-10 03:57:25 UTC
The key difference between DeepLinking sample project and mine, is that my project contains a single view only.
Comment 9 Alex Vilens 2017-10-11 05:21:24 UTC
I've changed my project to contain a few views -- the problem persists still
Comment 10 Alex Vilens 2017-10-12 17:27:26 UTC
Hello,

Is there a way to trace inside at Xamarin.Forms.Platform.Android.AppLinks.AndroidAppLinks+<IndexItemAsync>d__18.MoveNext () [0x000ed] in <ddbe9b44ecfb428fadb780af03610517>:0 ::




[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] Java.Lang.LinkageError: no non-static method 
"Lcom/google/android/gms/internal/zzkk;
.start(
Lcom/google/android/gms/common/api/GoogleApiClient;
Lcom/google/android/gms/appindexing/Action;
)Lcom/google/android/gms/common/api/PendingResult;"

[MonoDroid]   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <8bab1611ba0842d7a549ec2c857b9b53>:0 
[MonoDroid]   at Java.Interop.JniEnvironment+InstanceMethods.GetMethodID (Java.Interop.JniObjectReference type, System.String name, System.String signature) [0x0005b] in <ceb27acf152849e8bffea5f45514f8dc>:0 
[MonoDroid]   at Android.Runtime.JNIEnv.GetMethodID (System.IntPtr kls, System.String name, System.String signature) [0x00007] in <fc826073f42849489baf2aad09eabdcd>:0 
[MonoDroid]   at Android.Gms.AppIndexing.IAppIndexApiInvoker.Start (Android.Gms.Common.Apis.GoogleApiClient apiClient, Android.Gms.AppIndexing.Action action) [0x00015] in <03fa45696f5a4991b15147af9a872bd4>:0 
[MonoDroid]   at Android.Gms.AppIndexing.IAppIndexApiExtensions+<StartAsync>c__async1.MoveNext () [0x00021] in <03fa45696f5a4991b15147af9a872bd4>:0 
[MonoDroid] --- End of stack trace from previous location where exception was thrown ---
[MonoDroid]   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <8bab1611ba0842d7a549ec2c857b9b53>:0 
[MonoDroid]   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <8bab1611ba0842d7a549ec2c857b9b53>:0 
[MonoDroid]   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <8bab1611ba0842d7a549ec2c857b9b53>:0 
[MonoDroid]   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <8bab1611ba0842d7a549ec2c857b9b53>:0 
[MonoDroid]   at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <8bab1611ba0842d7a549ec2c857b9b53>:0 
[MonoDroid]   at Xamarin.Forms.Platform.Android.AppLinks.AndroidAppLinks+<IndexItemAsync>d__18.MoveNext () [0x000ed] in <ddbe9b44ecfb428fadb780af03610517>:0 
[MonoDroid] --- End of stack trace from previous location where exception was thrown ---
[MonoDroid]   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <8bab1611ba0842d7a549ec2c857b9b53>:0 
[MonoDroid]   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <8bab1611ba0842d7a549ec2c857b9b53>:0 
[MonoDroid]   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <8bab1611ba0842d7a549ec2c857b9b53>:0 
[MonoDroid]   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <8bab1611ba0842d7a549ec2c857b9b53>:0 
[MonoDroid]   at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <8bab1611ba0842d7a549ec2c857b9b53>:0 

[MonoDroid]   at Xamarin.Forms.Platform.Android.AppLinks.AndroidAppLinks+<RegisterLink>d__14.MoveNext () [0x00066] in <ddbe9b44ecfb428fadb780af03610517>:0 

[MonoDroid] --- End of stack trace from previous location where exception was thrown ---

Note You need to log in before you can comment on or make changes to this bug.