"xamarin 'Forms' does not exist in the namespace" in App.xaml.g.cs file

KW28KW28 ILMember

Hi, I'm new to Xamarin.
Just added a Xamarin.Forms (Cross Platform App) project into my solution (VS2017), With Master Detail, and PCL.
Unfortunately, as I try to build the solution I get this annoying error in App.xaml.g.cs file
Nuget is updated, version 2.3.3.193 Xamarin.Forms.
This didn't work on other computers as well, even with VS2015, on both win7 and win10.
Also tried to make a blank app, or with shared project, and still same error.
It doesn't make sense that just adding a project template would not build.
What should I do to fix this?

Here are photos of the errors - http://oi67.tinypic.com/2yw7a7l.jpg , http://oi66.tinypic.com/eb4djc.jpg

Best Answers

Answers

  • KW28KW28 ILMember

    Ok, that solves the compile errors. But now I get a warning message that doesn't let me run the app.

    The $(TargetFrameworkVersion) for Xamarin.Forms.Platform.Android.dll (v7.0) is greater than the $(TargetFrameworkVersion) for your project (v6.0).
    You need to increase the $(TargetFrameworkVersion) for your project. MyIMDB.Xamarin3.Android

    Current is at "Use Latest platform (Android 6 (Marshmallow))"
    Minimum is at "Android 4.0.3"
    Target is at "Use compile SDK version"

  • KW28KW28 ILMember
    edited April 2017

    This solved it! Thank you.
    I followed the instructions here - https://developer.xamarin.com/guides/android/getting_started/installation/windows/manual_installation/
    Very simple and well written, with pictures.

    Edit:
    Apparently it did not solve everything though, I'm experiencing an error saying :
    "Warning IDE0006 Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled."
    After some research I managed to get a more clear error from the .designtime.log in
    'C:\Users[user_name]\AppData\Local\Temp'
    that said error MSB4018: The "ResolveLibraryProjectImports" task failed unexpectedly.
    Which led me to this thread - https://forums.xamarin.com/discussion/70591/build-error-resolvelibraryprojectimport-task-failed-unexpectedly-access-denied/p1
    And apparently there isn't a solid solution for this issue there.
    Do you happen to have any advises regarding this issue?

    Full error from '.designtime.log':
    error MSB4018: The "ResolveLibraryProjectImports" task failed unexpectedly.
    error MSB4018: System.IO.FileNotFoundException: Could not load assembly 'MyIMDB.Xamarin4, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
    error MSB4018: File name: 'MyIMDB.Xamarin4.dll'
    error MSB4018: at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
    error MSB4018: at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(String fullName, ReaderParameters parameters)
    error MSB4018: at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(String fullName)
    error MSB4018: at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.GetAssembly(String fileName)
    error MSB4018: at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Extract(DirectoryAssemblyResolver res, ICollection1 jars, ICollection1 resolvedResourceDirectories, ICollection1 resolvedAssetDirectories, ICollection1 resolvedEnvironments)
    error MSB4018: at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Execute()
    error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
    error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()

  • KW28KW28 ILMember

    Apparently this solved one issue and presented another.

    I now get an error/warning that says:
    ' IDE0006 Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled. '

    after some digging, I found in '.designtime.log' this error:

    The "ResolveLibraryProjectImports" task failed unexpectedly.
    System.IO.FileNotFoundException: Could not load assembly 'MyIMDB.Xamarin4, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
    File name: 'MyIMDB.Xamarin4.dll'
    at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
    at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(String fullName, ReaderParameters parameters)
    at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(String fullName)
    at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.GetAssembly(String fileName)
    at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Extract(DirectoryAssemblyResolver res, ICollection1 jars, ICollection1 resolvedResourceDirectories, ICollection1 resolvedAssetDirectories, ICollection1 resolvedEnvironments)
    at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Execute()
    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
    at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()

    Any advice?

Sign In or Register to comment.