Is it always such a struggle to get .Android projects building?

NicolevonLorneNicolevonLorne USMember
edited January 2017 in Xamarin.Forms

We are considering using Xamarin.Forms for our new mobile object but I can't even get the sample apps to build.

I'm using a completely fresh install, and the only solution to the errors that I can find:

  • Delete all from C:\Users\AppData\Local\xamarin and rebuild
  • Close visual studio and rebuild
  • Redownload xyz
  • Check target, compile etc match (they do)

And various combinations of the steps above none of which are quick. Especially since our internet connection is not warp speed.
It's coming close to 3 days now and my question is - is this an abnormal amount of struggling? Because at this point I'm about to give up on Xamarin for good.

Tagged:

Posts

  • NMackayNMackay mod GBInsider, University mod

    @NicolevonLorne

    Not in my experience. Android is usually the least painful to get up and running.

    It's worth checking the Android SDK manager to ensure you have the latest updates and the latest SDK, You should be building against Android 7.0.

    try the following:

    • Create a black PCL app (from the cross platform option)
    • Use package manage to get the latest version of Forms (Forms only, do not update the Android dependencies)
    • Clean the solution
    • Rebuild the PCL (it should build fine)
    • Try deploying to a sim or a physical device

    I've copied in one of Xamarin team, maybe they'll be able to assist further but I wouldn't give up yet :smile:

    @JohnMiller

  • ClintStLaurentClintStLaurent ✭✭✭✭✭ USUniversity ✭✭✭✭✭

    @NMackay Is right. The Android platform is always the 'baseline' platform I tell people to develop in because its generally the LEAST troublesome. Then when the time comes you can adjust a bit to the left for iOS and a bit to the right for UWP.

    I do a walk-thru of getting set up along these lines on my blog. Maybe it can help.
    www.RedPillXamarin.com

  • NicolevonLorneNicolevonLorne USMember
    edited January 2017

    Thanks @NMackay and @ClintStLaurent that gives me some hope. It is exactly why I chose Android to start. Now if I could just actually get to some development it would be great.

    Action: New project - Cross platform -> Blank App (I actually tried all base app options)

    • I have Android 7.0 SDK installed
    • Xamarin.Forms version 2.3.3.180 (latest stable at time of post) no need to upgrade
    • Compile using: latest platform(Android 7.9)
    • Min: android 4.0.3 (SDK is installed)
    • Target: Use Compile using SDK version

    Action: Build solution

    Result: various - error XA5207: Please install package: 'Xamarin.Android.Support.v4' available in SDK installer

    Now I have Googled, I have deleted everything in the Xamarin appdata folder I have manually downloaded zips from somewhere (I seem to have closed the tab again). I have reinstalled Xamarin. I have cleaned and built and again. Any other ideas??

    Edit to add: I'm going to start working through the RedPill series now and see if something pops up

  • JulienRosenJulienRosen ✭✭✭✭ CAMember ✭✭✭✭

    Sounds like you need to run the Android SDK manager and install/update all the components.

  • NicolevonLorneNicolevonLorne USMember

    @JulienRosen said:
    Sounds like you need to run the Android SDK manager and install/update all the components.

    Look that's A LOT of components and our internet is shared and slow. I have run the updates and the SDK's for 7.0, 6.0 ++ are installed as well as all the latest Android SDK Tools, Platform Tools and Build-tools. Is there something more specific than all the components you could recommend I look for?

  • NMackayNMackay mod GBInsider, University mod
    edited January 2017

    I think part of the issue is your slow connection (like ours is today), when compiling Visual Studio (via the Xamarin pluggin I think) will attempt to download the libs (about 200MB I think), it may well be timing out but you get no indication via the VS UI what's going on in the background.

    The issue is discussed on this thread.

    https://forums.xamarin.com/discussion/42982/android-build-failure-unzipping-failed

    Apart from that I can only think you have the wrong java sdk installed!

  • JohnMillerJohnMiller Xamurai USForum Administrator, Xamarin Team Xamurai

    @NicolevonLorne,

    Unfortunately, this issue can creep up on slow connections. We are investigating better ways to handle this scenario.

    In the meantime, the only other thing I can think of that was not mentioned on this thread already is to make sure you have the Support Library installed. It's an option in the Android SDK Manager at the very bottom in the "Extras" section.

    Let me know if you further issues and we can connect to get it resolved. Make sure to ping me with @johnmiller so I get a notification.

  • NicolevonLorneNicolevonLorne USMember

    Thanks @JohnMiller, I've relocated home where the internet is far stable and fast and on first go got the same errors but I tried again and it worked! Now it's not very practical if every time we try to set up a dev environment we struggle so much. If I give my Xamarin folder to someone else can they use it? Alternatively is there a place to download it seperately and just place it there?

    I'm now getting a Java error! But at least it's progress!
    java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0

  • JohnMillerJohnMiller Xamurai USForum Administrator, Xamarin Team Xamurai

    @NicolevonLorne,

    Excellent!

    java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0

    This error is because of the installed Java JDK version. Install version 1.8 and remove any other versions (1.7, 1.6, etc). The 1.8 update can be downloaded here: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

  • NicolevonLorneNicolevonLorne USMember

    Thank you everyone for your help. I was finally able to actually run the base app on an emulator!

    @JohnMiller is there any answer to my question above about whether all this can be downloaded separately? We will run into this issue everytime there is an update and once we are more devs than just me it's not practical.

    Very excited to start playing now!

  • JohnMillerJohnMiller Xamurai USForum Administrator, Xamarin Team Xamurai

    @NicolevonLorne,

    It's possible that this gist by Jon Douglas could help work around the issue. The top sections are a lengthy manual work around. The bottom "New" fix may work out faster.

    I'll poke around and see what details I can get on what other solutions we might have available and what's being done for future, more robust, solutions.

  • NicolevonLorneNicolevonLorne USMember

    Thanks @JohnMiller I'll check it out :)

Sign In or Register to comment.