package android.support.v4.app does not exist

hello. i want to look at default sample for android.support.v4. but when i build project and it give me a lot of errors like that:

Error 1 package android.support.v4.app does not exist
extends android.support.v4.app.FragmentActivity

what must i do for this ?

Answers

  • ASPMakerASPMaker USMember

    when i do code analysis, it gives me this report

    CA0055 Error Running Code Analysis

    CA0055 : Could not load C:\Users\a\s\d\Components\xamandroidsupportv4-18-19.1.0\samples\AndroidSupportSample\AndroidSupportSample\bin\Debug\AndroidSupportSample.dll. The following error was encountered while reading module 'Xamarin.Android.Support.v4': Could not resolve type reference: [Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065]Java.Util.Concurrent.ICallable. [Errors and Warnings] (Global)

  • StephenGrayStephenGray USUniversity ✭✭

    Hi ASPMaker, I think I've come across that one. If I remember I removed the V4 Support Component reference and added android-support-v4.jar as ReferenceJar to the Binding project. I hope it helps!

  • XamarinciXamarinci USMember

    Hello Stephen, i try your method for my solution of project. But there are a lot of v4.jar which one of we must include in our project ? thank you.

  • StephenGrayStephenGray USUniversity ✭✭

    This is the version I'm using
    https://dropbox.com/sh/zmwgvfr2nc2whj2/AABIy8oHAgU6IcqJGS7J0ID_a

    I hope it helps!

  • BrendanZagaeskiBrendanZagaeski USForum Administrator, Xamarin Team Xamurai
    edited May 2014

    At the moment, using the "Android Support Library v4" component in binding projects is a little more complicated than ideal.

    Stephen's exactly right that you'll need to reference android-support-v4.jar in your binding project as a Reference JAR. But you'll also want to keep the "Android Support Library v4" component. That will provide the bound C# types from the support library in case the library you're binding needs them. The complication is that binding projects are currently missing a little bit of extra build logic that the app projects have that allows them to find the android-support-v4.jar within the component.

    After you've added the component to your binding project and attempted to build once, the component will download the android-support-v4.jar file into:

    Components\xamandroidsupportv4*\lib\android*\content\support\v4\android-support-v4.jar

    You can then add that JAR to your binding project, and set it to use the "ReferenceJar" Build Action.

  • BrendanZagaeskiBrendanZagaeski USForum Administrator, Xamarin Team Xamurai
    edited May 2014

    One little correction to my previous post: in fact the current build process will only download the JAR when building an app project that includes the component. So you can either build your main app project, or create a temporary app project, add the component, and build that. Building the binding project by itself will not download the JAR.

  • BrendanZagaeskiBrendanZagaeski USForum Administrator, Xamarin Team Xamurai

    Starting with Xamarin 3.0, the .jar file is now downloaded to a different, shared location for all projects:

    On Windows:

    C:\Users\%USERNAME%\AppData\Local\Xamarin\Android.Support.v4\19.1.0\content\support\v4\android-support-v4.jar

    On Mac:

    ~/.local/share/Xamarin/Android.Support.v4/19.1.0/content/support/v4/android-support-v4.jar

  • AhmedTarikAhmedTarik USMember

    after added android-support-v4.jar as reference
    the error is: "At least one input jar must be specified." what should I do?

  • BrendanZagaeskiBrendanZagaeski USForum Administrator, Xamarin Team Xamurai

    @AhmedTarik, you won't need to create a binding for the "Android Support Library v4" itself since that binding is contained in the "Android Support Library v4" component. Instead, you'll want to add the .jar from the other Java library that you wish to bind, most likely using the "EmbeddedJar" build action.

    See the documentation on binding Java libraries for more details.

  • yash777yash777 INMember ✭✭

    @BrendanZagaeski the path to zip is showing wrong to me when I try build using jenkins + msbuild -
    "C:\windows\system32\config\systemprofile\AppData\Local\Xamarin\Android.Support.v4\22.2.1"
    where as its actually in "C:\Users\Username\AppData\Local\Xamarin\Android.Support.v4\22.2.1"

    From where I can change this path ?? ...

  • dillongraydillongray ZAMember ✭✭

    Delete the updated packages and add the support packages again. That worked for me

  • MostafaYasinMostafaYasin USMember

    That problem faced me before and when clean solution and rebuild it, the problem solved.

  • anveanve DEMember ✭✭✭
    edited December 2018

    @yash777: I'm facing the same problem. Did you found a solution?

    Don't know where I should delete and install the support packages again ... In Android SDK Manager the Android Support Library doesn't appear on the machine ...

Sign In or Register to comment.