Thank you so much Sri. Indeed I have tried to do these steps before but it didn't work for me at all. I just hope that someone from Mono for Android team can see this issue and give feedback (where are you JP?).
I want to confirm that this issue is a bug before I go and report it. BTW, I have ported the code to java and it worked perfectly, so I think it is a bug with Mono for Android. Thanks, El-Sayed -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of SRI Sent: Sunday, 09 October, 2011 5:17 PM To: Discussions related to Mono for Android Subject: Re: [mono-android] Cant' deploy app Hi, CAUTION : What I am found out to deploy to Emulator/Device is a Hack and if this is a bug, then wait for Mono for Android to rectify it. Use this as a workaround only or till some other person gives a better suggestion. I have no experience in using AdapterView and what I found about is from the following tutorial http://blogs.sonyericsson.com/wp/2010/05/20/android-tutorial-making-your-own -3d-list-part-1/ **************************************************************************** ********************** This is what I found out, when I tried your suggestion (except you missed instructions on constructor?). I was able to compile, but when I tried to deploy to device, I had the same errors as reported by you. I browsed to the Java source file (available in obj\debug\android\src\... and found that the GetAdapter Method had not been implemnted in MyAdapter.java and the Return Type was Java.Lang.Object **************************************************************************** *********************** The tutorial link above gives the actual implementation and I changed the Java Source file as Below, Excluded the MyAdapter.cs, Included the MyAdapter.java as AndroidJavaSource and was able to compile and deploy. **************************************************************************** ************************** The changes done after copying the MyAdapter.java file are Change 1 ( __md_methods ) "n_getAdapter:()Landroid/widget/Adapter;:GetGetAdapterHandler\n" + "n_setAdapter:(I)Landroid/widget/Adapter;:GetSetAdapterHandler\n" + at the top in the __md_methods Change 2(changed the getAdapter/n_getAdapter declaration and added setAdapter method) @Override public android.widget.Adapter getAdapter () { return n_getAdapter; } @Override public void setAdapter(android.widget.Adapter adapter) { n_getAdapter = adapter; } private android.widget.Adapter n_getAdapter; **************************************************************************** ************************* This made me able to deploy the MyAdapter file. I have no idea whether it will work for your case and also please note that either the way we declare the AdapterView<IAdapter> is wrong or it is a bug in Mono for Android Java Source Generator. Hope this helps you in moving forward, but please treat this only as a work arround. Best Regards, Sridharan Srinivasan Alias Sri On Sun, Oct 9, 2011 at 5:14 AM, El-Sayed Mohamed <[email protected]> wrote: > I’m still unable to solve this problem. This is really a showstopper > issue, anyone there can help?. > > > > You can produce this bug simply by following these steps: > > 1- Open visual studio and create a new Mono for Android application. > > 2- Add a new class named ‘MyAdapter’. > > 3- Let the new class extend ‘AdapterView<IAdapter>’. > > 4- Implement the AdapterView<IAdapter> abstract class memebers. > (Adapter, SelectedView, SetSelection(int position)). > > 5- Just let the members throw NotImplementedException. > > 6- Build. > > 7- Deploy (project deploy will fail). > > > > Thanks, > > El-Sayed > > > > From: [email protected] > [mailto:[email protected]] On Behalf Of El-Sayed > Mohamed > Sent: Saturday, 08 October, 2011 5:22 AM > To: [email protected] > Subject: [mono-android] Cant' deploy app > > > > Hi There, > > > > I can’t deploy my application to the emulator. The app build right but > fail while trying to deploy with this error in the output build > windows in visual studio 2010: > > Mainly the error is due to missing method implementation. It is > complaining about getAdapter returning wrong type & setAdapter is not > implemented at all. > > Third error, I can’t figure what it talks about. > > > > Of course I have implemented the abstract Adapter property of the > AdapterView class. Actually the code won’t compile if it is missing. > > > > > > Thanks, > > El-Sayed > > > > > > ------ Build started: Project: PanoramaControl, Configuration: Debug > Any CPU > ------ > > PanoramaControl -> D:\PanoramaControl\bin\Debug\PanoramaControl.dll > > Microsoft (R) Build Engine Version 4.0.30319.1 > > [Microsoft .NET Framework, Version 4.0.30319.237] > > Copyright (C) Microsoft Corporation 2007. All rights reserved. > > > > Build started 8/10/2011 4:51:21 AM. > > Project "D:\PanoramaControl\PanoramaControl.csproj" on node 1 > (SignAndroidPackage target(s)). > > _GenerateAndroidAssetsDir: > > Skipping target "_GenerateAndroidAssetsDir" because it has no outputs. > > _ResolveMonoAndroidSdks: > > Looking for Android SDK.. > > Key HKCU\SOFTWARE\Android SDK Tools\Path not found. > > Key HKLM\SOFTWARE\Android SDK Tools\Path found: > > Path contains adb.exe in \platform-tools (C:\Android\android-sdk). > > Looking for Java 6 SDK.. > > Key HKLM\SOFTWARE\JavaSoft\Java Development Kit\CurrentVersion found. > > Key HKLM\SOFTWARE\JavaSoft\Java Development Kit\1.6\JavaHome found: > > Path contains jarsigner.exe in \bin (C:\Program > Files\Java\jdk1.6.0_26). > > MonoAndroid Tools: C:\Program Files\MSBuild\Novell\ > > MonoAndroid Framework: C:\Program Files\Reference > Assemblies\Microsoft\Framework\MonoAndroid\v2.2\;C:\Program > Files\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\ > > Android SDK: C:\Android\android-sdk\ > > Java SDK: C:\Program Files\Java\jdk1.6.0_26\ > > _ValidateAndroidPackageProperties: > > GetAndroidPackageName Task > > ManifestFile: > > AssemblyName: PanoramaControl > > PackageName: PanoramaControl.PanoramaControl > > _UpdateAndroidResgen: > > Skipping target "_UpdateAndroidResgen" because all output files are > up-to-date with respect to the input files. > > GenerateTargetFrameworkMonikerAttribute: > > Skipping target "GenerateTargetFrameworkMonikerAttribute" because all > output files are up-to-date with respect to the input files. > > CoreCompile: > > Skipping target "CoreCompile" because all output files are up-to-date > with respect to the input files. > > CopyFilesToOutputDirectory: > > PanoramaControl -> D:\PanoramaControl\bin\Debug\PanoramaControl.dll > > _ConvertDebuggingFiles: > > Skipping target "_ConvertDebuggingFiles" because all output files are > up-to-date with respect to the input files. > > _CompileAndroidPackage: > > Mandroid Task > > Assemblies: D:\PanoramaControl\bin\Debug\PanoramaControl.dll; > C:\Program Files\Reference > Assemblies\Microsoft\Framework\MonoAndroid\v2.2\Mono.Android.dll; > C:\Program Files\Reference > Assemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll; > C:\Program Files\Reference > Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Core.dll; > C:\Program Files\Reference > Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.dll; > C:\Program Files\Reference > Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Xml.dll; > C:\Program Files\Reference > Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Xml.Linq.dll > > I18nAssemblies: > > BuildDirectory: D:\PanoramaControl\obj\Debug\ > > ReferenceAssembliesDirectory: C:\Program Files\Reference > Assemblies\Microsoft\Framework\MonoAndroid\v2.2\;C:\Program > Files\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\;; > > AndroidSdkDirectory: C:\Android\android-sdk\ > > JavaSdkDirectory: C:\Program Files\Java\jdk1.6.0_26\ > > AssetDirectory: D:\PanoramaControl\obj\Debug\assets\ > > AndroidSdkPlatform: 8 > > MonoAndroidToolsDirectory: C:\Program Files\MSBuild\Novell\ > > ResourceDirectory: D:\PanoramaControl\obj\Debug\res\ > > ManifestTemplate: > > Package: PanoramaControl.PanoramaControl > > NativeLibrary: > > JavaSource: > > Debug: True > > UseSharedRuntime: True > > SupportedAbis: armeabi > > LinkMode: None > > ExtraArgs: > > C:\Program Files\MSBuild\Novell\mandroid.exe -v --nosign > --sdk-dir="C:\Android\android-sdk" > --builddir="D:\PanoramaControl\obj\Debug\android" > --framework-dir="C:\Program Files\Reference > Assemblies\Microsoft\Framework\MonoAndroid\v2.2" > --framework-dir="C:\Program Files\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0" > -S="D:\PanoramaControl\obj\Debug\res" > --package="PanoramaControl.PanoramaControl" --nolink --abi="armeabi" > --java-sdk-dir="C:\Program Files\Java\jdk1.6.0_26" --debug > --sdk-platform="8" "D:\PanoramaControl\bin\Debug\PanoramaControl.dll" > "C:\Program Files\Reference > Assemblies\Microsoft\Framework\MonoAndroid\v2.2\Mono.Android.dll" > "C:\Program Files\Reference > Assemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll" > "C:\Program Files\Reference > Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Core.dll" > "C:\Program Files\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.dll" > "C:\Program Files\Reference > Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Xml.dll" > "C:\Program Files\Reference > Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Xml.Linq.dll" > > MonoDroid.Utils.CommandFailedException: Operation is not valid due > to the current state of the object > > at > MonoDroid.Utils.ProcessRocks+<ReadStandardOutput>c__Iterator6.MoveNext > () [0x00000] in <filename unknown>:0 > > at Monodroid.Toolbox.InvokeCommand (IEnumerable`1 commandLine) > [0x00000] in <filename unknown>:0 > > at Monodroid.Toolbox.InvokeJavac (System.String src_path) > [0x00000] in <filename unknown>:0 > > at Monodroid.Droidinator.CreateDalvikBytecode > (System.Collections.Generic.List`1 javaTypes, > System.Collections.Generic.List`1 assemblies) [0x00000] in <filename > unknown>:0 > > at Monodroid.Droidinator.CreateApk () [0x00000] in <filename > unknown>:0 > > at Monodroid.MainClass.Main (System.String[] argv) [0x00000] in > <filename unknown>:0 > > D:\PanoramaControl\obj\Debug\android\src\panoramacontrol\controls\Panorama .java:4: > panoramacontrol.controls.Panorama is not abstract and does not > override abstract method setAdapter(android.widget.Adapter) in > android.widget.AdapterView > > public class Panorama > > ^ > > > D:\PanoramaControl\obj\Debug\android\src\panoramacontrol\controls\Panorama.j ava:111: > getAdapter() in panoramacontrol.controls.Panorama cannot override > getAdapter() in android.widget.AdapterView; attempting to use > incompatible return type > > found : java.lang.Object > > required: android.widget.Adapter > > public java.lang.Object getAdapter () > > ^ > > > D:\PanoramaControl\obj\Debug\android\src\panoramacontrol\controls\Panorama.j ava:110: > method does not override or implement a method from a supertype > > @Override > > ^ > > Note: Some input files use unchecked or unsafe operations. > > Note: Recompile with -Xlint:unchecked for details. > > 3 errors > > > > C:\Program Files\MSBuild\Novell\Novell.MonoDroid.Common.targets(399,2): > error MSB6006: "mandroid.exe" exited with code 1. > [D:\PanoramaControl\PanoramaControl.csproj] > > Done Building Project "D:\PanoramaControl\PanoramaControl.csproj" > (SignAndroidPackage target(s)) -- FAILED. > > > > Build FAILED. > > > > "D:\PanoramaControl\PanoramaControl.csproj" (SignAndroidPackage > target) (1) > -> > > (_CompileAndroidPackage target) -> > > C:\Program Files\MSBuild\Novell\Novell.MonoDroid.Common.targets(399,2): > error MSB6006: "mandroid.exe" exited with code 1. > [D:\PanoramaControl\PanoramaControl.csproj] > > > > 0 Warning(s) > > 1 Error(s) > > > > Time Elapsed 00:00:10.60 > > > > > > > > > > > > > > Error: Cancelled > > ========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped > ========== > > ========== Deploy: 0 succeeded, 1 failed, 0 skipped ========== > > > > _______________________________________________ > Monodroid mailing list > [email protected] > > UNSUBSCRIBE INFORMATION: > http://lists.ximian.com/mailman/listinfo/monodroid > > -- Sridharan Srinivasan Alias Sri Ph:(65)98255785/(65)63922439 www.arshu.com _______________________________________________ Monodroid mailing list [email protected] UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid _______________________________________________ Monodroid mailing list [email protected] UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
