Cannot design axml, Tasky not working

JasonGoemaatJasonGoemaat USMember
edited June 2013 in Xamarin.Android

I downloaded the "Tasky" sample from somewhere but the only button, 'Add Task', doesn't work. Debugging I see that taskListView never gets set as FindViewById returns null. I try to open the TaskDetails axml (I'm really new to android) and it has just the gray rectangle with a message "The Android SDK could not be found. Make sure the path to the SDK ...". That seems strange since it finds the SDK in the options and the app compiles and runs in the emulator just fine.

Posts

  • LluisSanchezLluisSanchez ESXamarin Team Xamurai

    Are you using Windows or Mac?

  • TomasVymazalTomasVymazal USMember

    I can confirm this behavior on Mac. Except the part with TaskDetails.axml. I am able to view it and have no problems with Android SDK. But TaskyAndroid crashes immediately after launch, just as JasonGoemaat wrote. Exception is thrown on 57 line in HomeScreen.cs. I have not modified this solution or code in any way. Running on OS X 10.8.3, Xamarin Studio 4.0.3 (build 13), trial Android licence. Does anybody know the solution?

  • JonathanPryorJonathanPryor USXamarin Team Xamurai

    @TomasVymazal: What's the exception + full stack trace you get?

  • TomasVymazalTomasVymazal USMember

    StackTrace:

    System.NullReferenceException: Object reference not set to an instance of an object at TaskyAndroid.Screens.HomeScreen.OnResume () [0x00023] in /Users/tomas/Projects/Tasky/Android/TaskyAndroid/Screens/HomeScreen.cs:57 at Android.App.Activity.n_OnResume (intptr,intptr) [0x00008] in /Users/builder/data/lanes/monodroid-lion-bigsplash/0e0e51f9/source/monodroid/src/Mono.Android/platforms/android-10/src/generated/Android.App.Activity.cs:2501 at at (wrapper dynamic-method) object.707f5893-fd64-4968-8956-b750bef0f6a8 (intptr,intptr) <IL 0x00011, 0x0003b> at

    It is NullReferenceException. Debugging shows that

    taskListView = FindViewById<ListView> (Resource.Id.lstTasks);

    on line 27 results in null stored in taskListView which results in exception in OnResume().

  • NickMcKinneyNickMcKinney USMember

    I was seeing the same thing where taskListView ended up being null because that's what FindByViewId returned. Doing a Clean All and a rebuild fixed the problem, but I'm getting an exception thrown in TableQuery:

    System.NotSupportedException: Cannot compile: Parameter

    at at Tasky.Core.SQLite.TableQuery1<Tasky.Core.Task>.CompileExpr (System.Linq.Expressions.Expression,System.Collections.Generic.List1) <0x04618>

    at at Tasky.Core.SQLite.TableQuery1<Tasky.Core.Task>.CompileExpr (System.Linq.Expressions.Expression,System.Collections.Generic.List1) <0x02ca7>

    at at Tasky.Core.SQLite.TableQuery1<Tasky.Core.Task>.CompileExpr (System.Linq.Expressions.Expression,System.Collections.Generic.List1) <0x0332f>

    at at Tasky.Core.SQLite.TableQuery1<Tasky.Core.Task>.CompileExpr (System.Linq.Expressions.Expression,System.Collections.Generic.List1) <0x003b3>

    at at Tasky.Core.SQLite.TableQuery`1<Tasky.Core.Task>.GenerateCommand (string) <0x0048b>

    at at Tasky.Core.SQLite.TableQuery`1<Tasky.Core.Task>.GetEnumerator () <0x000df>

    at at System.Collections.Generic.List1<Tasky.Core.Task>.AddEnumerable (System.Collections.Generic.IEnumerable1<Tasky.Core.Task>) <0x00083>

    at at System.Collections.Generic.List1<Tasky.Core.Task>..ctor (System.Collections.Generic.IEnumerable1<Tasky.Core.Task>) <0x001bf>

    at at System.Linq.Enumerable.ToList<Tasky.Core.Task> (System.Collections.Generic.IEnumerable`1<Tasky.Core.Task>) <0x00097>

    at at Tasky.Core.SQLite.TableQuery`1<Tasky.Core.Task>.FirstOrDefault () <0x000c3>

    at at Tasky.Core.TaskDatabase.GetItem<Tasky.Core.Task> (int) <0x00383>

    at Tasky.Core.TaskRepository.GetTask (int) [0x00001] in c:\Users\Administrator\Downloads\Tasky\Android\Tasky.Core\TaskRepository.cs:54

    at Tasky.Core.TaskManager.GetTask (int) [0x00001] in c:\Users\Administrator\Downloads\Tasky\Android\Tasky.Core\TaskManager.cs:15

    at TaskyAndroid.Screens.TaskDetailsScreen.OnCreate (Android.OS.Bundle) [0x00027] in c:\Users\Administrator\Downloads\Tasky\Android\TaskyAndroid\Screens\TaskDetailsScreen.cs:25

    at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) [0x00010] in /Users/builder/data/lanes/monodroid-lion-bigsplash/0e0e51f9/source/monodroid/src/Mono.Android/platforms/android-10/src/generated/Android.App.Activity.cs:1490

    at at (wrapper dynamic-method) object.bce532f1-efc0-4008-b6ab-5f421ea9a6e4 (intptr,intptr,intptr)

    at

    I'm using Xamarin Studio 4.0.3 build 13 on Windows 7 with the trial Android license. I'm getting this exception when I try to run in the emulator.

  • TomasVymazalTomasVymazal USMember

    I can confirm that Clean All and than Rebuild all fixes the problem. At least for me. I had no more problems with this sample project. I did not encounter error NickMcKinney describes. Anyway, this is strange behaviour and imho certainly not the expected one.

  • BrendanLawlorBrendanLawlor USMember

    I'm also getting the error reported by Nick McKinney and cleaning/rebuilding does not clear it.

  • BrendanLawlorBrendanLawlor USMember

    Just to be more specific, I'm using Xamarin Studio and the stack trace, which happens when I select a newly created task is:

    object.1dd2d154-4dbd-4816-9049-1dcd05e5f9a0 (Parameters=) in
    Tasky.Core.SQLite.TableQuery<Tasky.Core.Task>.CompileExpr (Parameters=) in c:\Users\blawlor\dev\xamarin-workspace\Android_PaidEdition\Tasky.Core\SQLite.cs:2463
    Tasky.Core.SQLite.TableQuery<Tasky.Core.Task>.CompileExpr (Parameters=) in c:\Users\blawlor\dev\xamarin-workspace\Android_PaidEdition\Tasky.Core\SQLite.cs:2376
    Tasky.Core.SQLite.TableQuery<Tasky.Core.Task>.CompileExpr (Parameters=) in c:\Users\blawlor\dev\xamarin-workspace\Android_PaidEdition\Tasky.Core\SQLite.cs:2394
    Tasky.Core.SQLite.TableQuery<Tasky.Core.Task>.CompileExpr (Parameters=) in c:\Users\blawlor\dev\xamarin-workspace\Android_PaidEdition\Tasky.Core\SQLite.cs:2314
    Tasky.Core.SQLite.TableQuery<Tasky.Core.Task>.GenerateCommand (Parameters=) in c:\Users\blawlor\dev\xamarin-workspace\Android_PaidEdition\Tasky.Core\SQLite.cs:2280
    Tasky.Core.SQLite.TableQuery<Tasky.Core.Task>.GetEnumerator (Parameters=) in c:\Users\blawlor\dev\xamarin-workspace\Android_PaidEdition\Tasky.Core\SQLite.cs:2527
    System.Collections.Generic.List<Tasky.Core.Task>.AddEnumerable (Parameters=) in
    System.Collections.Generic.List<Tasky.Core.Task>..ctor (Parameters=) in
    System.Linq.Enumerable.ToList (Parameters=) in
    Tasky.Core.SQLite.TableQuery<Tasky.Core.Task>.FirstOrDefault (Parameters=) in c:\Users\blawlor\dev\xamarin-workspace\Android_PaidEdition\Tasky.Core\SQLite.cs:2546
    Tasky.Core.TaskDatabase.GetItem (Parameters=) in c:\Users\blawlor\dev\xamarin-workspace\Android_PaidEdition\Tasky.Core\TaskDatabase.cs:38
    Tasky.Core.TaskRepository.GetTask (Parameters=) in c:\Users\blawlor\dev\xamarin-workspace\Android_PaidEdition\Tasky.Core\TaskRepository.cs:54
    Tasky.Core.TaskManager.GetTask (Parameters=) in c:\Users\blawlor\dev\xamarin-workspace\Android_PaidEdition\Tasky.Core\TaskManager.cs:15
    TaskyAndroid.Screens.TaskDetailsScreen.OnCreate (Parameters=) in c:\Users\blawlor\dev\xamarin-workspace\Android_PaidEdition\TaskyAndroid\Screens\TaskDetailsScreen.cs:25
    Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (Parameters=) in /Users/builder/data/lanes/monodroid-lion-bs1/0cc7ae3b/source/monodroid/src/Mono.Android/platforms/android-10/src/generated/Android.App.Activity.cs:1490
    object.1dd2d154-4dbd-4816-9049-1dcd05e5f9a0 (Parameters=) in

  • JeffreyStedfastJeffreyStedfast USXamarin Team Xamurai

    Moving to the Android forum as this isn't really related to the Xamarin Studio IDE.

  • BrendanLawlorBrendanLawlor USMember

    I'm going to create a separate thread as the title of this one is not suitable.

Sign In or Register to comment.