Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Build Errors in Android Apps with Xamatin Forms Dependencies

$
0
0

Recently went through a bit of a struggle with building Xamarin Projects which resulted in two new personal best practices and thought they might be worth sharing in case anyone else runs into the same issues.
Any time an Xamarin Package updates close out of the IDE and reopen it.
Any Time an Xamarin Package Updates Go To Android SDK, Install anything that isnt and update anything that needs it.

Steps I went through (and error messge for keywords for Google search indexing)
1 Created a new Cross Platform Solution in Xamarin Studio.
2 Compile and Build(success).
3 Update NuGet Packages.
4 Compile and Build(Fail).
5 IDE Complains about 27 Compile Errors which look similar to

  Target _BuildAdditionalResourcesCache:

    C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(290,2): error XA5209: Unzipping failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r20.zip and extract it to the C:\Users\David\AppData\Local\Xamarin\Android.Support.Design\23.0.1\content directory.

    C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(290,2): error XA5209: Reason: C:\Users\David\AppData\Local\Xamarin\Android.Support.Design\23.0.1\android_m2repository_r20.zip is not a valid zip file

    C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(290,2): error XA5207: Please install package: 'Xamarin.Android.Support.Design' available in SDK installer. Java library file C:\Users\David\AppData\Local\Xamarin\Android.Support.Design\23.0.1\embedded\classes.jar doesn't exist.

    C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(290,2): error XA5209: Unzipping failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r20.zip and extract it to the C:\Users\David\AppData\Local\Xamarin\Android.Support.Design\23.0.1\content directory.

6 Close IDE and Reopen
7 IDE looks for new Nuget packages and find more updates
8 Compile and Build (Fail).
9 IDE Complains about 2 Compile Errors which look similar to

 Target _UpdateAndroidResgen:

      Processing: C:\Users\David\Documents\Projects\test9\Droid\obj\Debug\__library_projects__\Xamarin.Forms.Platform\library_project_imports\res\values\strings.xml

    C:\Users\David\AppData\Local\Android\android-sdk\build-tools\23.0.1\aapt.exe package -f -m -M C:\Users\David\AppData\Local\Temp\bu4pcmmt.utf\AndroidManifest.xml -J C:\Users\David\AppData\Local\Temp\bu4pcmmt.utf --custom-package com.indiponics.test9 -F C:\Users\David\AppData\Local\Temp\bu4pcmmt.utf\resources.apk.bk -S obj\Debug\res -S C:\Users\David\Documents\Projects\test9\Droid\obj\Debug\__library_projects__\Xamarin.Forms.Platform.Android\library_project_imports\res -S C:\Users\David\Documents\Projects\test9\Droid\obj\Debug\__library_projects__\Xamarin.Forms.Platform\library_project_imports\res -S C:\Users\David\Documents\Projects\test9\Droid\obj\Debug\resourcecache\232D8E3CFFAE6D38F683DEF47E6BF28A\res -j obj\Debug\__library_projects__\FormsViewGroup\library_project_imports\formsviewgroup.jar -I C:\Users\David\AppData\Local\Android\android-sdk\platforms\android-20\android.jar --auto-add-overlay 

    C:\Users\David\Documents\Projects\test9\Droid\obj\Debug\resourcecache\232D8E3CFFAE6D38F683DEF47E6BF28A\res\values\values.xml(57): error APT0000: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Light.ActionButton'.

    C:\Users\David\Documents\Projects\test9\Droid\obj\Debug\resourcecache\232D8E3CFFAE6D38F683DEF47E6BF28A\res\values\values.xml(65): error APT0000: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.ActionButton'.

9 Update Nuget Packages
10 Compile and Build (fail)
11 IDE Compilains about 97 Compile Errors
Target _UpdateAndroidResgen:

          Processing: C:\Users\David\Documents\Projects\test9\Droid\obj\Debug\__library_projects__\Xamarin.Forms.Platform\library_project_imports\res\values\strings.xml

        C:\Users\David\AppData\Local\Android\android-sdk\build-tools\23.0.1\aapt.exe package -f -m -M C:\Users\David\AppData\Local\Temp\fxteq5hb.ney\AndroidManifest.xml -J C:\Users\David\AppData\Local\Temp\fxteq5hb.ney --custom-package com.indiponics.test9 -F C:\Users\David\AppData\Local\Temp\fxteq5hb.ney\resources.apk.bk -S obj\Debug\res -S C:\Users\David\Documents\Projects\test9\Droid\obj\Debug\__library_projects__\Xamarin.Forms.Platform.Android\library_project_imports\res -S C:\Users\David\Documents\Projects\test9\Droid\obj\Debug\__library_projects__\Xamarin.Forms.Platform\library_project_imports\res -S C:\Users\David\Documents\Projects\test9\Droid\obj\Debug\resourcecache\92A76D6D294E46B5BE3F7FE55F4634DC\res -S C:\Users\David\Documents\Projects\test9\Droid\obj\Debug\resourcecache\4CCB59890831E0FA7449F0E26BEA039E\res -S C:\Users\David\Documents\Projects\test9\Droid\obj\Debug\resourcecache\10FB74E09673B90EDD443AEB96DED3BA\res -S C:\Users\David\Documents\Projects\test9\Droid\obj\Debug\resourcecache\91F9B5CDC717D2680F79D863FE04375C\res -S C:\Users\David\Documents\Projects\test9\Droid\obj\Debug\resourcecache\737EFACFA57F2304002DFE8EF2F1FF49\res -j obj\Debug\__library_projects__\FormsViewGroup\library_project_imports\formsviewgroup.jar -I C:\Users\David\AppData\Local\Android\android-sdk\platforms\android-20\android.jar --auto-add-overlay 

        C:\Users\David\Documents\Projects\test9\Droid\obj\Debug\resourcecache\10FB74E09673B90EDD443AEB96DED3BA\res\values-v21\values-v21.xml(16): error APT0000: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Inverse'.

        C:\Users\David\Documents\Projects\test9\Droid\obj\Debug\resourcecache\10FB74E09673B90EDD443AEB96DED3BA\res\values-v21\values-v21.xml(18): error APT0000: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Large.Inverse'.

12 Open Adndroid SDK Manager (Available in Xamarin Studio\Tools\Open Android SDK Manager)
13 Close IDE
14 Install Android 6.0 ()SDK API 23) SDK Platform
15 Open IDE
16 Compile and Build(success).

Personnally after this I just installed everything available in the
Android SDK Manager and will keep it installed and updated henceforth.

References:
https://bugzilla.xamarin.com/show_bug.cgi?id=35074
https://bugzilla.xamarin.com/show_bug.cgi?id=35257
http://forums.xamarin.com/discussion/50642/touchscreenblocksfocus-error-with-xamarin-android-support-v7-appcompat-version-22-2-1-0#latest

Thanks for takeing the time to help me work through this:
@JimBorden
@PaulDiPietro

So in summary (In case you got a @ Find match halfway down the page and now your at the bottom looking for the solution)

Any time a package updates Close the IDE and reopen(not always required but its what I'll do)
Any time a package Updates Check Android SDK Manager for any Android updates that the new package might be using.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>