Skip to content

Resolve Android CI compile break from namespace/type collisions in AndroidApkInstaller#8

Merged
JusterZhu merged 2 commits intomainfrom
copilot/fix-ci-di-error
Mar 23, 2026
Merged

Resolve Android CI compile break from namespace/type collisions in AndroidApkInstaller#8
JusterZhu merged 2 commits intomainfrom
copilot/fix-ci-di-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 23, 2026

Recent CI runs failed in the Android target due to symbol resolution conflicts introduced in AndroidApkInstaller (Android.*/Java.IO.* identifiers colliding with the project namespace and BCL types). This PR scopes Android/Java references explicitly so the Android build compiles deterministically.

  • Changes

    • AndroidApkInstaller import and symbol disambiguation
      • Replaced broad Android/Java usings with explicit aliases:
        • AndroidApp, AndroidContent, AndroidNet, AndroidOS, JavaFile
      • Updated call sites to use aliased namespaces/types (Application.Context, Intent, ActivityFlags, Uri, BuildVersionCodes).
    • Exception/file type conflict fix
      • Qualified FileNotFoundException as System.IO.FileNotFoundException.
      • Replaced ambiguous File/Uri references with JavaFile / AndroidNet.Uri.
  • Representative diff pattern

    #if ANDROID
    using AndroidApp = Android.App;
    using AndroidContent = Android.Content;
    using AndroidNet = Android.Net;
    using AndroidOS = Android.OS;
    using JavaFile = Java.IO.File;
    #endif
    
    var context = AndroidApp.Application.Context;
    var apkFile = new JavaFile(apkFilePath);
    AndroidNet.Uri apkUri = AndroidNet.Uri.FromFile(apkFile);
    throw new System.IO.FileNotFoundException("APK file was not found.", apkFilePath);
Original prompt

This section details on the original issue you should resolve

<issue_title>CI/DI error</issue_title>
<issue_description>Please check the cause of the error and fix it.
https://github.com/GeneralLibrary/GeneralUpdate.Maui/actions/runs/23427212372/job/68144624765</issue_description>

<agent_instructions>请充分理解仓库代码、issue上下文,并修复问题。</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@JusterZhu Please check the cause of the error and fix it. https://github.com/GeneralLibrary/GeneralUpdate.Maui/actions/runs/23428739300/job/68149550278

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@JusterZhu JusterZhu marked this pull request as ready for review March 23, 2026 08:55
Copilot AI review requested due to automatic review settings March 23, 2026 08:55
@JusterZhu JusterZhu merged commit 1c375f5 into main Mar 23, 2026
@JusterZhu JusterZhu deleted the copilot/fix-ci-di-error branch March 23, 2026 08:56
Copilot AI restored the copilot/fix-ci-di-error branch March 23, 2026 08:56
Copilot AI changed the title [WIP] Fix CI/DI error in GeneralUpdate.Maui Resolve Android CI compile break from namespace/type collisions in AndroidApkInstaller Mar 23, 2026
Copilot AI requested a review from JusterZhu March 23, 2026 08:56
Copilot stopped work on behalf of JusterZhu due to an error March 23, 2026 08:56
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses CI build failures in the GeneralUpdate.Maui.Android project by removing Android/Java namespace and type ambiguities in the APK installation implementation.

Changes:

  • Introduces explicit namespace/type aliases for Android and Java namespaces to avoid ambiguous references.
  • Fully-qualifies System.IO.FileNotFoundException to prevent clashes with Java IO types.
  • Updates Android API usages (Build, Intent, Uri, Application) to use the new aliases consistently.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI/DI error

3 participants