Bug 25862 - [TRIAL] Activity isn't packed into .apk if implementing TextureView.ISurfaceTextureListener
Summary: [TRIAL] Activity isn't packed into .apk if implementing TextureView.ISurfaceT...
Status: RESOLVED INVALID
Alias: None
Product: Android
Classification: Xamarin
Component: Mono runtime / AOT Compiler ()
Version: 5.1
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2015-01-09 04:54 UTC by Alex
Modified: 2017-08-08 17:43 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Test Case (12.56 KB, application/octet-stream)
2015-01-12 03:42 UTC, Alex
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description Alex 2015-01-09 04:54:53 UTC
When building an pp with Xamarin Android in trial mode and the main launcher activity inherits from TextureView.ISurfaceTextureListener, the runtime can't find the callable wrapper and throws this exception:

>[AndroidRuntime] FATAL EXCEPTION: Timer-0
>[AndroidRuntime] java.lang.NoClassDefFoundError: gkl.android.scannerapp.ScanActivity
>[AndroidRuntime] 	at gkl.android.scanner.TrialSplashScreen$1.run(TrialSplashScreen.java:35)
>[AndroidRuntime] 	at java.util.Timer$TimerImpl.run(Timer.java:284)


>[Activity (Label = "BaseActivity")]			
>public class BaseActivity : FragmentActivity , TextureView.ISurfaceTextureListener
>{
>
>}
Comment 1 Naqeeb 2015-01-09 14:45:14 UTC
I have tried to reproduce to this issue but I am not able to reproduce this behavior.

Could you please provide sample project,environment info and logs(IDE + Output)? So that we can reproduce this issue at our end.

You can get environment info form here:
Microsoft Visual Studio => Help => About Microsoft Visual Studio => Copy Info

You can get IDE logs from here:
Microsoft Visual Studio => Help => Zip Xamarin Logs (attached zipped logs)

You can get Application output from here:
Microsoft Visual Studio => view => output (copy and attached the output)

Environment Info : 
=== Xamarin Studio ===

Version 5.7 (build 661)
Installation UUID: b6495454-eed9-49ee-a97b-abf8a686d664
Runtime:
 Microsoft .NET 4.0.30319.34003
 GTK+ 2.24.22 (MS-Windows theme)
 GTK# 2.12.26

=== Xamarin.Android ===

Version: 4.20.0 (Trial Edition)
Android SDK: D:\SDK\AndroidSDK
 Supported Android versions:
  1.6    (API level 4)
  2.1    (API level 7)
  2.2    (API level 8)
  2.3    (API level 10)
  3.1    (API level 12)
  4.0    (API level 14)
  4.0.3  (API level 15)
  4.1    (API level 16)
  4.2    (API level 17)
  4.3    (API level 18)
  4.4    (API level 19)
  4.4.87 (API level 20)
  5.0    (API level 21)
Java SDK: C:\Program Files (x86)\Java\jdk1.7.0_71
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) Client VM (build 24.71-b01, mixed mode)

=== Build Information ===

Release ID: 507000661
Git revision: b70bab61da996da29045ea8ee8aed1a6faedbe78
Build date: 2015-01-05 11:27:37-05
Xamarin addins: 82f6c71490562d6cd125a09287f441902fdac3d7

=== Operating System ===

Windows 6.2.9200.0 (64-bit)
Comment 2 Alex 2015-01-12 03:42:06 UTC
Created attachment 9316 [details]
Test Case
Comment 3 Alex 2015-01-12 03:42:49 UTC
I attached a test case project, below the environment info:

=== Xamarin Studio ===

Version 5.5.4 (build 15)
Installation UUID: 6462d445-676f-48dc-8d02-deb35154603b
Runtime:
	Microsoft .NET 4.0.30319.18444
	GTK+ 2.24.22 (MS-Windows theme)
	GTK# 2.12.25

=== Xamarin.Android ===

Version: 4.20.0 (Trial Edition)
Android SDK: C:\Users\aschonefeld\AppData\Local\Android\android-sdk
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
Java SDK: C:\Program Files (x86)\Java\jdk1.7.0_71
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) Client VM (build 24.71-b01, mixed mode, sharing)

=== Build Information ===

Release ID: 505040015
Git revision: f93940a35458a18052f1a25e106e62ca970d9c40
Build date: 2014-11-19 13:26:21-05
Xamarin addins: dc23cbd91a3a0e1d326328e1229e86c942a49ec8

=== Operating System ===

Windows 6.1.7601.65536 (64-bit)
Comment 4 Alex 2015-01-12 03:44:45 UTC
And logs:

Forwarding debugger port 8828
Detecting existing process
Loaded assembly: InterfaceInheritanceFailure.dll
Loaded assembly: Mono.Android.dll [External]
[monodroid-debug] Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=127.0.0.1:8828,server=y,embedding=1
[Mono] Image addref mscorlib[0x1dba28] -> mscorlib.dll[0x1ed6b0]: 1
[Mono] AOT module 'mscorlib.dll.so' not found: Cannot load library: load_library[1104]: Library '/data/data/InterfaceInheritanceFailure.InterfaceInheritanceFailure/lib/mscorlib.dll.so' not found
[Mono] Assembly mscorlib[0x1dba28] added to domain RootDomain, ref_count=1
[Mono] Image addref InterfaceInheritanceFailure[0x22af60] -> InterfaceInheritanceFailure.dll[0x22a398]: 1
[Mono] Assembly InterfaceInheritanceFailure[0x22af60] added to domain RootDomain, ref_count=1
[Mono] AOT module 'InterfaceInheritanceFailure.dll.so' not found: Cannot load library: load_library[1104]: Library '/data/data/InterfaceInheritanceFailure.InterfaceInheritanceFailure/lib/InterfaceInheritanceFailure.dll.so' not found
[monodroid-gc] GREF GC Threshold: 46800
[Mono] Image addref Mono.Android[0x230308] -> Mono.Android.dll[0x22f6d8]: 1
[Mono] Assembly Mono.Android[0x230308] added to domain RootDomain, ref_count=1
[Mono] AOT module 'Mono.Android.dll.so' not found: Cannot load library: load_library[1104]: Library '/data/data/InterfaceInheritanceFailure.InterfaceInheritanceFailure/lib/Mono.Android.dll.so' not found
[Mono] Assembly Ref addref Mono.Android[0x230308] -> mscorlib[0x1dba28]: 2
[monodroid] Xamarin/Android Trial Mode Active
[AndroidRuntime] FATAL EXCEPTION: Timer-0
[AndroidRuntime] java.lang.NoClassDefFoundError: interfaceinheritancefailure.MainActivity
[AndroidRuntime] 	at interfaceinheritancefailure.interfaceinheritancefailure.TrialSplashScreen$1.run(TrialSplashScreen.java:35)
[AndroidRuntime] 	at java.util.Timer$TimerImpl.run(Timer.java:284)
Comment 5 Naqeeb 2015-01-12 08:29:17 UTC
Thank you very much Alex for providing the test case and environment info.

We have tried to reproduce this issue with attached test case provided in Comment 2  but not able to reproduce this behavior, application is running successfully on device/emulator without any error.

Screencast: http://www.screencast.com/t/hdnmhVhP

Could you please provide adb logcat, So that developer can figure out what's going on from the stack trace. 

You can get adb logcat via 'Go to location platform-tools under Android Sdk via command prompt and run the command adb logcat'.

Thanks!

Environment info:
XS 5.5.4(build 15) and XS 5.7(build 661)
Xamarin 3.8.150 and Xamarin 3.9.235
Windows 8
Device info: Samsung S5 4.4.2
Comment 6 Alex 2015-01-12 09:02:54 UTC
Output from adb logcat:

D/AndroidRuntime(26592): Calling main entry com.android.commands.am.Am

I/ActivityManager( 1303): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=InterfaceInheritanceFailure.InterfaceInheritanceFailure/interfaceinheritancefailure.interfaceinheritancefailure.TrialSplashScreen } from pid 26592

D/AndroidRuntime(26592): Shutting down VM

I/ActivityManager( 1303): Start proc InterfaceInheritanceFailure.InterfaceInheritanceFailure for activity InterfaceInheritanceFailure.InterfaceInheritanceFailure/interfaceinheritancefailure.interfaceinheritancefailure.TrialSplashScreen: pid=26600 uid=10042 gids={1006, 3003}

D/dalvikvm(26592): GC_CONCURRENT freed 102K, 69% free 319K/1024K, external 0K/0K, paused 1ms+1ms

D/jdwp    (26592): adbd disconnected

I/AndroidRuntime(26592): NOTE: attach of thread 'Binder Thread #3' failed

I/ActivityThread(26600): Pub InterfaceInheritanceFailure.InterfaceInheritanceFailure.mono.MonoRuntimeProvider.__mono_init__: mono.MonoRuntimeProvider

D/dalvikvm(26600): Trying to load lib /data/data/InterfaceInheritanceFailure.InterfaceInheritanceFailure/lib/libmonodroid.so 0x405166e0

D/dalvikvm(26600): Added shared lib /data/data/InterfaceInheritanceFailure.InterfaceInheritanceFailure/lib/libmonodroid.so 0x405166e0

W/monodroid-debug(26600): Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=127.0.0.1:8821,server=y,embedding=1

D/Mono    (26600): Image addref mscorlib[0x1dba18] -> mscorlib.dll[0x1ed698]: 1

D/Mono    (26600): AOT module 'mscorlib.dll.so' not found: Cannot load library: load_library[1104]: Library '/data/data/InterfaceInheritanceFailure.InterfaceInheritanceFailure/lib/mscorlib.dll.so' not found

D/Mono    (26600): Assembly mscorlib[0x1dba18] added to domain RootDomain, ref_count=1

D/Mono    (26600): Image addref InterfaceInheritanceFailure[0x22af08] -> InterfaceInheritanceFailure.dll[0x22a340]: 1

D/Mono    (26600): Assembly InterfaceInheritanceFailure[0x22af08] added to domain RootDomain, ref_count=1

D/Mono    (26600): AOT module 'InterfaceInheritanceFailure.dll.so' not found: Cannot load library: load_library[1104]: Library '/data/data/InterfaceInheritanceFailure.InterfaceInheritanceFailure/lib/InterfaceInheritanceFailure.dll.so' not found

W/monodroid-gc(26600): GREF GC Threshold: 46800

D/Mono    (26600): Image addref Mono.Android[0x2302b0] -> Mono.Android.dll[0x22f680]: 1

D/Mono    (26600): Assembly Mono.Android[0x2302b0] added to domain RootDomain, ref_count=1

D/Mono    (26600): AOT module 'Mono.Android.dll.so' not found: Cannot load library: load_library[1104]: Library '/data/data/InterfaceInheritanceFailure.InterfaceInheritanceFailure/lib/Mono.Android.dll.so' not found

D/Mono    (26600): Assembly Ref addref Mono.Android[0x2302b0] -> mscorlib[0x1dba18]: 2

W/monodroid(26600): Xamarin/Android Trial Mode Active

D/dalvikvm(26600): GC_EXTERNAL_ALLOC freed 60K, 50% free 2713K/5379K, external 712K/1038K, paused 37ms

I/dalvikvm(26600): Failed resolving Linterfaceinheritancefailure/MainActivity; interface 207 'Landroid/view/TextureView$SurfaceTextureListener;'

W/dalvikvm(26600): Link of class 'Linterfaceinheritancefailure/MainActivity;' failed

E/dalvikvm(26600): Could not find class 'interfaceinheritancefailure.MainActivity', referenced from method interfaceinheritancefailure.interfaceinheritancefailure.TrialSplashScreen$1.run

W/dalvikvm(26600): VFY: unable to resolve const-class 305 (Linterfaceinheritancefailure/MainActivity;) in Linterfaceinheritancefailure/interfaceinheritancefailure/TrialSplashScreen$1;

D/dalvikvm(26600): VFY: replacing opcode 0x1c at 0x0009

D/dalvikvm(26600): VFY: dead code 0x000b-0018 in Linterfaceinheritancefailure/interfaceinheritancefailure/TrialSplashScreen$1;.run ()V

I/ActivityManager( 1303): Displayed InterfaceInheritanceFailure.InterfaceInheritanceFailure/interfaceinheritancefailure.interfaceinheritancefailure.TrialSplashScreen: +1s26ms

W/dalvikvm(26600): threadid=11: thread exiting with uncaught exception (group=0x40015560)

E/AndroidRuntime(26600): FATAL EXCEPTION: Timer-0

E/AndroidRuntime(26600): java.lang.NoClassDefFoundError: interfaceinheritancefailure.MainActivity

E/AndroidRuntime(26600): 	at interfaceinheritancefailure.interfaceinheritancefailure.TrialSplashScreen$1.run(TrialSplashScreen.java:35)

E/AndroidRuntime(26600): 	at java.util.Timer$TimerImpl.run(Timer.java:284)

I/cpufreqd( 1100): cpufreqd_loop            : New Rule ("Screen On with input"), applying.

I/cpufreqd( 1100): cpufreqd_set_profile     : Profile "On Demand Higher" set for CPU0

I/Process (26600): Sending signal. PID: 26600 SIG: 9

I/ActivityManager( 1303): Process InterfaceInheritanceFailure.InterfaceInheritanceFailure (pid 26600) has died.

W/InputManagerService( 1303): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@407661b8

D/dalvikvm( 1754): GC_EXPLICIT freed 16K, 50% free 2707K/5379K, external 712K/1038K, paused 39ms

I/cpufreqd( 1100): cpufreqd_loop            : New Rule ("Screen On"), applying.

I/cpufreqd( 1100): cpufreqd_set_profile     : Profile "On Demand Default" set for CPU0
Comment 7 Jon Douglas [MSFT] 2017-08-08 17:43:54 UTC
I do not believe this is relevant anymore given Xamarin for all:

Thank you for taking the time to submit this report. After reviewing the description of this bug, we believe it no longer affects the current version of Xamarin.Android. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.