xunit / devices.xunit

xUnit.net Runners for Devices
Other
73 stars 36 forks source link

Latest versions depend on newer Xamarin.Forms, which break builds #37

Closed AArnott closed 8 years ago

AArnott commented 8 years ago

After upgrading to 1.2.3-build0010 from the CI, I eventually discovered my Android test project stopped building with errors such as those mentioned in this xamarin forum post:

11>\Trunk\MobileUI\Android\Resources\Resource.designer.cs(329,137,329,165): error CS0117: 'Resource.Color' does not contain a definition for 'abc_color_highlight_material'
11>\Trunk\MobileUI\Android\Resources\Resource.designer.cs(529,146,529,177): error CS0117: 'Resource.Drawable' does not contain a definition for 'abc_control_background_material'
11>\Trunk\MobileUI\Android\Resources\Resource.designer.cs(846,133,846,157): error CS0117: 'Resource.Style' does not contain a definition for 'Base_V23_Theme_AppCompat'
11>\Trunk\MobileUI\Android\Resources\Resource.designer.cs(847,139,847,169): error CS0117: 'Resource.Style' does not contain a definition for 'Base_V23_Theme_AppCompat_Light'

The advice in the post is to upgrade to SDK 23. While I can certainly do that, and am working to do so now, it requires I install the SDK 23 and takes a while. Did this devices runner package need to depend on a newer Xamarin.Forms, or would it be OK to refer to the one previously used?

clairernovotny commented 8 years ago

There was no over-arching need other than keeping up with the latest. I really hate how heavy-weight Xam Forms is.

I can revert this back to 1.5 but any thoughts as to how often to update? Also some Xam Forms versions seem to require an Android update while others don't :(

AArnott commented 8 years ago

I'd say update only when absolutely necessary.

In fact, even after installing SDK 23, the build still breaks, and I haven't been able to figure out why or how to fix:

C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(339,2): error XA5207: Please install package: 'Xamarin.Android.Support.v7.MediaRouter' available in SDK installer. Java library file C:\Users\andarno\AppData\Local\Xamarin\Android.Support.v7.MediaRouter\23.0.1.3\embedded\classes.jar doesn't exist. [C:\Users\andarno\git\PCLCrypto\src\PCLCrypto.Tests.Android\PCLCrypto.Tests.Android.csproj]
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(339,2): error XA5207: Please install package: 'Xamarin.Android.Support.v7.MediaRouter' available in SDK installer. Java library file C:\Users\andarno\AppData\Local\Xamarin\Android.Support.v7.MediaRouter\23.0.1.3\embedded\libs/internal_impl-23.0.1.jar doesn't exist. [C:\Users\andarno\git\PCLCrypto\src\PCLCrypto.Tests.Android\PCLCrypto.Tests.Android.csproj]
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(339,2): error XA5206: Please install package: 'Xamarin.Android.Support.v7.MediaRouter' available in SDK installer. Android resource directory C:\Users\andarno\AppData\Local\Xamarin\Android.Support.v7.MediaRouter\23.0.1.3\embedded\./ doesn't exist. [C:\Users\andarno\git\PCLCrypto\src\PCLCrypto.Tests.Android\PCLCrypto.Tests.Android.csproj]

Adding the nuget package with the name mentioned doesn't help. And the SDK Manager doesn't offer it, despite the claims that seem to suggest it would be there.

AArnott commented 8 years ago

It's also strange that my AppVeyor CI build succeeds, although my local build fails.

clairernovotny commented 8 years ago

One reason for updating it is to catch/deal with conflicts if other people want to use this to test a project that contains Xamarin forms stuff. I'm not super-convinced that a lib compiled with an older version, say 1.5, would work if they ultimately want to use 2.0 in their app.

Guess it's testable but lord knows what :dragon: awaits

ghost commented 8 years ago

I would prefer to use Xam Forms 2. I just updated the dependency on my droid.test project to 2.0 and it 's broken. Looks like you are working on 2.0 now.

Hope to see a nuget update soon to use 2.0.

Personally I try to be on the latest of everything, unless something breaks and I can't easily fix it.

clairernovotny commented 8 years ago

Heres my suggestion: A 1.3 version with Xam 1.5 with an immediate 2.0 version with forms 2. That will let the current fixes be avail to ppl in the interim.

AArnott commented 8 years ago

sounds good. @robertbaker If you know how to overcome the most recent error I reported above, I'd be obliged. :)

ghost commented 8 years ago

@AArnott Did it install the app compat libs?

@onovotny any ETA on the 2.0 release with forms 2?

Right now it this works. My project is Forms 2, no conflicts.

AArnott commented 8 years ago

@robertbaker I don't see anything with a name that includes "app compat" or similar. Maybe I'm just not seeing it since there is no search feature. Can you tell me where you see it in the hierarchy and what it's exactly called, please?

ghost commented 8 years ago

Xamarin.Android.Support.v7.AppCompat.23.0.1.1

Xamarin Forms 2 installs a bunch of Xamarin.Android.Support.* libs

clairernovotny commented 8 years ago

@robertbaker when you use project.json, you don't need to install each dependent package, they're brought in transitively, which is awesome.

ghost commented 8 years ago

@onovotny I noticed that. How could I switch to using project.json in my xamarin solution? Is that possible?

AArnott commented 8 years ago

@robertbaker If you're using Xamarin Studio, there is no IDE support for it. You'd have to use nuget.exe from the command line anytime you changed project.json files. But yes, I've been doing it for weeks with great results.

Your Xamarin.Android.Support.v7.AppCompat package doesn't look like one I'd find in the SDK Manager. Is this a NuGet package you're referring to? Because I added the package the error message asks for and it doesn't help. The error indicates the build is looking for files in my Android SDK directory under localappdata, which nuget doesn't help with.

ghost commented 8 years ago

@AArnott Apologies for not being clear. Forms 2.0 adds Xamarin.Android.Support.* nuget packages.

As for the SDK. You just need the latest SDK Tools and 5.0 SDK platform. I also have sources, but not sure if that's needed.

I'm not using the master branch, so I'm not heling if that's the case. I'm using the stable nuget of devices.xunit.

When I tried to nuget update my test project to Forms 2. It broke.

Have you tried cleaning the solution? When I receieved an issue with resources designer, it wouldn't regenerate correctly until I cleaned it.

@onovotny I'm using VS 15 Pro.

clairernovotny commented 8 years ago

Okay, @AArnott 1.3.1 with Xamarin 1.5 refs was just pushed to nuget.org with the latest fixes. @robertbaker 2.0.0-build0002 with the xam forms 2.0 ref is on the CI MyGet feed. It'll be a bit longer for 2.0 to hit the main NuGet as there's a few other things I'd like to include in it too.

AArnott commented 8 years ago

Thank you.

ghost commented 8 years ago

@onovotny What is there left to do before support for Forms 2 is on Nuget?

clairernovotny commented 8 years ago

@robertbaker I've just pushed 2.0.0-build0007 to NuGet.org.