Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Xamarin.Android 13.2.2.0 so that we can target Android API 34 #2611

Open
dinisvieira-xo opened this issue Jan 26, 2024 · 6 comments
Labels
build Related to App Center's Build service feature request New feature request

Comments

@dinisvieira-xo
Copy link

Describe the solution you'd like
Support for Xamarin.Android 13.2.2.0 so that we can target Android API 34.
Xamarin.Android 13.2.2.0 Release notes

Describe alternatives you've considered
Migration to MAUI (which is not an option for us in the next few months) or using another build service.

Additional context
This is needed if we want to publish to the Google Play Store after August 2024

@dinisvieira-xo dinisvieira-xo added the feature request New feature request label Jan 26, 2024
@Banana14
Copy link

Banana14 commented Jan 31, 2024

I have the same request.
Long story:
I updated our xamarin forms android project to target android sdk version 34. This was building locally but had issues with deployment (something about apk not being a zip, very puzzling). Until I realized that the I needed to update visual studio 22 to at least version 17.8. Then it built / deployed fine locally.
I tried the same on appcenter, but then I get the following error:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Aapt2.targets(189,3): error APT2000: Write fault on path /Users/runner/work/1/s/FolderName/AppName/AppName.Android/[Unknown] "[Unknown]". [/Users/runner/work/1/s/FolderName/AppName/AppName.Android/AppName.Android.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Aapt2.targets(189,3): error APT2000: Write fault on path /Users/runner/work/1/s/FolderName/AppName/AppName.Android/[Unknown] "[Unknown]". [/Users/runner/work/1/s/FolderName/AppName/AppName.Android/AppName.Android.csproj]
Done Building Project "/Users/runner/work/1/s/FolderName/AppName/AppName.Android/AppName.Android.csproj" (PackageForAndroid target(s)) -- FAILED.

Since AppCenter is usually some time behind the latest visual studio features, I'm guessing the error is because SDK 34 is not supported yet.

Note: we're in the same predicament, migration to MAUI is not an option for us in the coming months...

@DmitriyKirakosyan DmitriyKirakosyan added the build Related to App Center's Build service label Feb 7, 2024
@scherici
Copy link

Same issue by my side, seems that app center does not support yet the "new" xamarin sdk version. The latest supported version is 13.2.1.2, but we need 13.2.2.0 as well if we want to re-use our old scripts/build process....

@adamtha
Copy link

adamtha commented Feb 21, 2024

i had to fallback to Android 13 (API level 33) for now and its building fine
targeting API 34 failing with the same issues listed above

though the build vm image used seems to have SDK 34 insalled
https://github.com/actions/runner-images/blob/main/images/macos/macos-11-Readme.md

@follesoe
Copy link

As a bare minimum, Microsoft should ensure AppCenter stays alive and supports the last Xamarin releases, preventing developers from having to waste time on yet a migration (from AppCenter to another build service), and rather can focus on migrating from Xamarin to MAUI.

@follesoe
Copy link

A workaround is to install Xamarin.Android 13.2.2.0 yourself in a pre-build script:

#!/usr/bin/env bash
PKG_URL="https://dl.xamarin.com/MonoforAndroid/Mac/xamarin.android-13.2.2.0.pkg"
PKG_NAME=${PKG_URL##*/}
curl -4fsLo "${PKG_NAME}" "${PKG_URL}"
sudo installer -pkg "${PKG_NAME}" -target /

@Cybrosys
Copy link

Cybrosys commented Jun 5, 2024

Using the above hint, I got it working for Azure Build pipelines, but I had to add some more:

# Install the latest Android SDK Command-Line Tools and SDK 34
- script: |
    echo "Installing Android Command-Line Tools"
    mkdir -p $ANDROID_HOME/cmdline-tools/latest
    cd $ANDROID_HOME/cmdline-tools/latest
    curl -o sdk-tools.zip https://dl.google.com/android/repository/commandlinetools-mac-7583922_latest.zip
    unzip sdk-tools.zip
    export PATH=$ANDROID_HOME/cmdline-tools/latest/bin:$PATH
    yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses
    $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --update
    $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "platform-tools" "platforms;android-34" "build-tools;34.0.0"
  displayName: 'Install Android SDK Command-Line Tools and SDK 34'

# Install the latest Xamarin.Android package
- script: |
    echo "Installing Xamarin.Android"
    PKG_URL="https://dl.xamarin.com/MonoforAndroid/Mac/xamarin.android-13.2.2.0.pkg"
    PKG_NAME=${PKG_URL##*/}
    curl -4fsLo "${PKG_NAME}" "${PKG_URL}"
    sudo installer -pkg "${PKG_NAME}" -target /
  displayName: 'Install Xamarin.Android'

# Ensure the environment is updated with the latest tools
- script: |
    echo "Setting up environment variables"
    export PATH=$ANDROID_HOME/platform-tools:$PATH
    export PATH=$ANDROID_HOME/build-tools/34.0.0:$PATH
  displayName: 'Set up environment variables'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Related to App Center's Build service feature request New feature request
Projects
None yet
Development

No branches or pull requests

7 participants