Getting error: package android.views does not exist

ChrisMcBride.2625ChrisMcBride.2625 USUniversity ✭✭

Recently upgrade to Visual Studio 15.7.2 and I started getting a bunch of javac errors, most of them:
error: package android.views does not exist
There are a couple other packages missing, and then some items that are missing because I think others are failing.
Problem is I don't know what these packages are, or where they are supposed to be/

A couple of blogs/stackoverflow answers suggested deleting .../appdata/local/xamarin/xamarin.* (or android.*)
I don't know if 2017 uses these files anymore.
I've also tried to uninstall and reinstall.

The code should be fine, as it builds on my dev machine. But it fails on the build machine. (On my dev machine, I removed the aforementioned files in the xamarin directory, and they don't come back. Which leads me to believe they are no longer used)

We normally use msbuild to build, but it fails under visual studio as well.
We build by first copying the code down from our source control, so there are no build files lying around, so a clean and/or restarting visual studios won't help. And the nuget packages are also fresh.

The SDK of the build machine is very similar to the SDK on my dev machine (a few of the minor versions are different)
These branches also used to build on the build machine as well.

We are building against Oreo 8.0, using Xamarin Forms 2.5 (this all started when I tried to upgrade to 3.0, but I've since backed out the 3.0 changes)
JDK 1.8.0_161

there has to be something missing or corrupt on my build machine, I just can't figure out what it is.

I tried to reinstall VS 15.6.7 (this is the latest I could rollback to)
This time a the files in ../appdata/local/xamarin were restored. But it didn't help. I'm still getting the same errors.

Answers

  • ChrisMcBride.2625ChrisMcBride.2625 USUniversity ✭✭

    I'm having this issue with android.views and android.graphics.drawables
    On my dev machine these are actually android.view and android.graphics.drawable
    It looks like Android.Views is being converted to android.views instead of android.view
    What converts these to Java, and is there a mistake in how they are being converted?

  • zahikramerzahikramer ILMember ✭✭✭

    Same Problem on 15.7.4

  • ChrisMcBride.2625ChrisMcBride.2625 USUniversity ✭✭

    I should have followed up.
    The issue had to do with upgrading to the latest Visual Studio.
    VS 2017 uses a different directory for the TargetFramework than 2015.
    On our build machine we have an explicit environment variable pointing at the TargetFramework directory.
    When the new Visual Studio is installed VS placed VS stuff in the old directory (pointed at by the environment variable) but the Xamarin Framework stuff was placed in the new directory.
    Since the file is actually missing at build time (the build was using the old directory) it ends up trying to just convert the xamarin name.

    I ended up pointing the environment variable at the new directory and reinstalled.
    The new directory is at C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\
    The old directory was something like C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\

  • Howwwww to solve this problem ???!!!!!!!!!!!!!!!!!!!!!1

Sign In or Register to comment.