From 84f538e39f55b04ac317785395de39152802ae15 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Jun 2025 17:35:50 +0000 Subject: [PATCH 1/5] Initial plan for issue From 642fc9bde696e1441f3553a51d5a43a825d44711 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Jun 2025 18:00:15 +0000 Subject: [PATCH 2/5] Remove MakeBundleNativeCodeExternal task and related components Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com> --- Documentation/docs-mobile/messages/index.md | 2 +- .../Properties/Resources.Designer.cs | 27 +- .../Properties/Resources.cs.resx | 15 - .../Properties/Resources.de.resx | 15 - .../Properties/Resources.es.resx | 15 - .../Properties/Resources.fr.resx | 15 - .../Properties/Resources.it.resx | 15 - .../Properties/Resources.ja.resx | 15 - .../Properties/Resources.ko.resx | 15 - .../Properties/Resources.pl.resx | 15 - .../Properties/Resources.pt-BR.resx | 15 - .../Properties/Resources.resx | 18 +- .../Properties/Resources.ru.resx | 15 - .../Properties/Resources.tr.resx | 15 - .../Properties/Resources.zh-Hans.resx | 15 - .../Properties/Resources.zh-Hant.resx | 15 - .../Tasks/MakeBundleNativeCodeExternal.cs | 274 ------------------ .../MakeBundleNativeCodeExternalTests.cs | 73 ----- .../Xamarin.Android.Common.targets | 2 +- .../Assets/AboutAssets.txt | 19 -- .../MainActivity.cs | 135 --------- .../Properties/AndroidManifest.xml | 6 - .../Properties/AssemblyInfo.cs | 23 -- .../Resources/AboutResources.txt | 44 --- .../Resources/drawable/Icon.png | Bin 2574 -> 0 bytes .../Resources/layout/Main.axml | 14 - .../Resources/values/Strings.xml | 5 - .../Xamarin.Android.MakeBundle-Tests.csproj | 93 ------ ...amarin.Android.MakeBundle-Tests.dll.config | 3 - .../libs/armeabi-v7a/libsanangeles.so | Bin 19500 -> 0 bytes .../libs/armeabi/libsanangeles.so | Bin 26560 -> 0 bytes .../libs/x86/libsanangeles.so | Bin 20400 -> 0 bytes 32 files changed, 8 insertions(+), 925 deletions(-) delete mode 100644 src/Xamarin.Android.Build.Tasks/Tasks/MakeBundleNativeCodeExternal.cs delete mode 100644 src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/MakeBundleNativeCodeExternalTests.cs delete mode 100644 tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/Assets/AboutAssets.txt delete mode 100644 tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/MainActivity.cs delete mode 100644 tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/Properties/AndroidManifest.xml delete mode 100644 tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/Properties/AssemblyInfo.cs delete mode 100644 tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/Resources/AboutResources.txt delete mode 100644 tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/Resources/drawable/Icon.png delete mode 100644 tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/Resources/layout/Main.axml delete mode 100644 tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/Resources/values/Strings.xml delete mode 100644 tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/Xamarin.Android.MakeBundle-Tests.csproj delete mode 100644 tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/Xamarin.Android.MakeBundle-Tests.dll.config delete mode 100755 tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/libs/armeabi-v7a/libsanangeles.so delete mode 100755 tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/libs/armeabi/libsanangeles.so delete mode 100755 tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/libs/x86/libsanangeles.so diff --git a/Documentation/docs-mobile/messages/index.md b/Documentation/docs-mobile/messages/index.md index f12cdb16898..03691341731 100644 --- a/Documentation/docs-mobile/messages/index.md +++ b/Documentation/docs-mobile/messages/index.md @@ -335,7 +335,7 @@ and `NNN` is a 3 digit number indicating the type of the unhandled `Exception`. * `LNS` - `LinkAssembliesNoShrink` * `LNT` - `Lint` * `LWF` - `LogWarningsForFiles` -* `MBN` - `MakeBundleNativeCodeExternal` + * `MDC` - `MDoc` * `PAI` - `PrepareAbiItems` * `PAW` - `ParseAndroidWearProjectAndManifest` diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs b/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs index 82c813e76aa..4dc26b5b6b0 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs @@ -1609,23 +1609,9 @@ public static string XA5101_Toolchain { } } - /// - /// Looks up a localized string similar to Conversion from assembly to native code failed. Exit code {0}. - /// - public static string XA5102 { - get { - return ResourceManager.GetString("XA5102", resourceCulture); - } - } - /// - /// Looks up a localized string similar to NDK C compiler exited with an error. Exit code {0}. - /// - public static string XA5103 { - get { - return ResourceManager.GetString("XA5103", resourceCulture); - } - } + + /// /// Looks up a localized string similar to Could not locate the Android NDK. Please make sure the Android NDK is installed in the Android SDK Manager, or if using a custom NDK path, please ensure the $(AndroidNdkDirectory) MSBuild property is set to the custom path.. @@ -1645,14 +1631,7 @@ public static string XA5105 { } } - /// - /// Looks up a localized string similar to NDK linker exited with an error. Exit code {0}. - /// - public static string XA5201 { - get { - return ResourceManager.GetString("XA5201", resourceCulture); - } - } + /// /// Looks up a localized string similar to Cannot find `{0}`. Please install the Android SDK Build-Tools package with the `{1}{2}tools{2}{3}` program.. diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.cs.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.cs.resx index b032bb720a7..d7517d92b09 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.cs.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.cs.resx @@ -842,16 +842,6 @@ Odeberte z projektu odkaz na {0} a místo toho přidejte balíček NuGet{1}. Adresář sady nástrojů pro cíl {0} se nenašel. {0} - The target architecture, such as Arm, Arm64, or X86_64 - - Převod ze sestavení na nativní kód se nezdařil. Ukončovací kód {0} - In this message, the term "assembly" means the low-level language that an assembler like `as` takes as input. (This is different from most of the other messages, where the term "assembly" means the file type that the C# compiler produces.) -{0} - The exit code number - - - Kompilátor NDK C byl ukončen s chybou. Ukončovací kód {0} - The following are literal names and should not be translated: NDK, C -{0} - The exit code number - Nepovedlo se najít sadu Android NDK. Ujistěte se prosím, že v Android SDK Manageru je nainstalovaná sada Android NDK, nebo pokud používáte vlastní cestu k sadě NDK, ujistěte se prosím, že vlastnost MSBuildu $(AndroidNdkDirectory) je nastavená na danou vlastní cestu. The following are literal names and should not be translated: $(AndroidNdkDirectory) @@ -861,11 +851,6 @@ Odeberte z projektu odkaz na {0} a místo toho přidejte balíček NuGet{1}. {0} - The missing utility name, such as gcc or clang {1} - The target architecture, such as Arm, Arm64, or X86_64 {2} - The path of the directory that was searched - - - Linker NDK byl ukončen s chybou. Ukončovací kód {0} - The following are literal names and should not be translated: NDK -{0} - The exit code number Nepovedlo se najít {0}. Nainstalujte prosím balíček Android SDK Build-Tools pomocí programu {1}{2}tools{2}{3}. diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.de.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.de.resx index 7108a20a22d..359250268e3 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.de.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.de.resx @@ -842,16 +842,6 @@ Entfernen Sie den '{0}' Verweis aus Ihrem Projekt, und fügen Sie stattdessen da Das Toolkettenverzeichnis für das Ziel "{0}" wurde nicht gefunden. {0} - The target architecture, such as Arm, Arm64, or X86_64 - - Fehler beim Konvertieren der Assembly in nativen Code. Exitcode: {0} - In this message, the term "assembly" means the low-level language that an assembler like `as` takes as input. (This is different from most of the other messages, where the term "assembly" means the file type that the C# compiler produces.) -{0} - The exit code number - - - Der NDK C-Compiler wurde mit einem Fehler beendet. Exitcode: {0} - The following are literal names and should not be translated: NDK, C -{0} - The exit code number - Das Android NDK wurde nicht gefunden. Stellen Sie sicher, dass das Android NDK im Android SDK Manager installiert ist, oder stellen Sie bei Verwendung eines benutzerdefinierten NDK-Pfads sicher, dass die MSBuild-Eigenschaft "$(AndroidNdkDirectory)" auf den benutzerdefinierten Pfad festgelegt ist. The following are literal names and should not be translated: $(AndroidNdkDirectory) @@ -861,11 +851,6 @@ Entfernen Sie den '{0}' Verweis aus Ihrem Projekt, und fügen Sie stattdessen da {0} - The missing utility name, such as gcc or clang {1} - The target architecture, such as Arm, Arm64, or X86_64 {2} - The path of the directory that was searched - - - Der NDK-Linker wurde mit einem Fehler beendet. Exitcode: {0} - The following are literal names and should not be translated: NDK -{0} - The exit code number "{0}" wurde nicht gefunden. Installieren Sie das Paket mit den Android SDK-Buildtools mit dem Programm "{1}{2}tools{2}{3}". diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.es.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.es.resx index a8007296413..fd4583728a0 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.es.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.es.resx @@ -842,16 +842,6 @@ Quite la referencia de "{0}" del proyecto y agregue el paquete NuGet "{1}". No se encontró el directorio de cadena de herramientas para el destino {0}. {0} - The target architecture, such as Arm, Arm64, or X86_64 - - No se pudo realizar la conversión de ensamblado a código nativo. Código de salida {0} - In this message, the term "assembly" means the low-level language that an assembler like `as` takes as input. (This is different from most of the other messages, where the term "assembly" means the file type that the C# compiler produces.) -{0} - The exit code number - - - El compilador de C del NDK se cerró con un error. Código de salida {0} - The following are literal names and should not be translated: NDK, C -{0} - The exit code number - No se pudo encontrar Android NDK. Asegúrese de que está instalado en el Administrador de Android SDK o, si usa una ruta de acceso de NDK personalizada, asegúrese de que la propiedad $(AndroidNdkDirectory) de MSBuild está establecida en la ruta de acceso personalizada. The following are literal names and should not be translated: $(AndroidNdkDirectory) @@ -861,11 +851,6 @@ Quite la referencia de "{0}" del proyecto y agregue el paquete NuGet "{1}". {0} - The missing utility name, such as gcc or clang {1} - The target architecture, such as Arm, Arm64, or X86_64 {2} - The path of the directory that was searched - - - El enlazador de NDK se cerró con un error. Código de salida {0} - The following are literal names and should not be translated: NDK -{0} - The exit code number No se puede encontrar "{0}". Instale el paquete Build-Tools de Android SDK con el programa "{1}{2}tools{2}{3}". diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.fr.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.fr.resx index 00ed686c192..dfa459af60b 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.fr.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.fr.resx @@ -842,16 +842,6 @@ Supprimez la référence de '{0}' de votre projet et ajoutez plutôt le '{1}'.pa Le répertoire de chaîne d'outils pour la cible {0} est introuvable. {0} - The target architecture, such as Arm, Arm64, or X86_64 - - Échec de la conversion de l'assembly en code natif. Code de sortie : {0} - In this message, the term "assembly" means the low-level language that an assembler like `as` takes as input. (This is different from most of the other messages, where the term "assembly" means the file type that the C# compiler produces.) -{0} - The exit code number - - - Arrêt du compilateur NDK C à la suite d'une erreur. Code de sortie : {0} - The following are literal names and should not be translated: NDK, C -{0} - The exit code number - Impossible de localiser le kit Android NDK. Vérifiez que le kit Android NDK est installé dans le Gestionnaire SDK Android, ou si vous utilisez un chemin de kit NDK personnalisé, vérifiez que la propriété MSBuild $(AndroidNdkDirectory) a la valeur du chemin personnalisé. The following are literal names and should not be translated: $(AndroidNdkDirectory) @@ -861,11 +851,6 @@ Supprimez la référence de '{0}' de votre projet et ajoutez plutôt le '{1}'.pa {0} - The missing utility name, such as gcc or clang {1} - The target architecture, such as Arm, Arm64, or X86_64 {2} - The path of the directory that was searched - - - Arrêt de l'éditeur de liens NDK C à la suite d'une erreur. Code de sortie : {0} - The following are literal names and should not be translated: NDK -{0} - The exit code number '{0}' est introuvable. Installez le package Android SDK Build-Tools avec le programme '{1}{2}Tools{2}{3}'. diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.it.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.it.resx index 28ea7f4631e..2323de233a0 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.it.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.it.resx @@ -842,16 +842,6 @@ Rimuovere il riferimento '{0}' dal progetto e aggiungere invece il pacchetto NuG La directory della toolchain per la destinazione {0} non è stata trovata. {0} - The target architecture, such as Arm, Arm64, or X86_64 - - La conversione da assembly a codice nativo non è riuscita. Codice di uscita: {0} - In this message, the term "assembly" means the low-level language that an assembler like `as` takes as input. (This is different from most of the other messages, where the term "assembly" means the file type that the C# compiler produces.) -{0} - The exit code number - - - Il compilatore C di NDK è stato terminato con un errore. Codice di uscita: {0} - The following are literal names and should not be translated: NDK, C -{0} - The exit code number - Non è stato possibile trovare Android NDK. Assicurarsi che Android NDK sia installato in Gestione Android SDK, oppure se si usa un percorso NDK personalizzato, assicurarsi che la proprietà $(AndroidNdkDirectory) di MSBuild sia impostata sul percorso personalizzato. The following are literal names and should not be translated: $(AndroidNdkDirectory) @@ -861,11 +851,6 @@ Rimuovere il riferimento '{0}' dal progetto e aggiungere invece il pacchetto NuG {0} - The missing utility name, such as gcc or clang {1} - The target architecture, such as Arm, Arm64, or X86_64 {2} - The path of the directory that was searched - - - Il linker di NDK è stato terminato con un errore. Codice di uscita: {0} - The following are literal names and should not be translated: NDK -{0} - The exit code number Non è possibile trovare `{0}`. Installare il pacchetto Android SDK Build-Tools con il programma `{1}{2}tools{2}{3}`. diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.ja.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.ja.resx index bc5515bcbb8..ca3c9e0f076 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.ja.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.ja.resx @@ -843,16 +843,6 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi ターゲット {0} のためのツールチェーン ディレクトリが見つかりませんでした。 {0} - The target architecture, such as Arm, Arm64, or X86_64 - - アセンブリからネイティブ コードへの変換に失敗しました。終了コード {0} - In this message, the term "assembly" means the low-level language that an assembler like `as` takes as input. (This is different from most of the other messages, where the term "assembly" means the file type that the C# compiler produces.) -{0} - The exit code number - - - NDK C コンパイラがエラーで終了しました。終了コード {0} - The following are literal names and should not be translated: NDK, C -{0} - The exit code number - Android NDK が見つかりませんでした。Android NDK が Android SDK マネージャーにインストールされていることを確認するか、カスタムの NDK パスを使用している場合は、$(AndroidNdkDirectory) MSBuild プロパティがカスタム パスに設定されていることを確認してください。 The following are literal names and should not be translated: $(AndroidNdkDirectory) @@ -862,11 +852,6 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi {0} - The missing utility name, such as gcc or clang {1} - The target architecture, such as Arm, Arm64, or X86_64 {2} - The path of the directory that was searched - - - NDK リンカーがエラーで終了しました。終了コード {0} - The following are literal names and should not be translated: NDK -{0} - The exit code number `{0}` が見つかりません。`{1}{2}tools{2}{3}` プログラムを使用して Android SDK Build-Tools パッケージをインストールしてください。 diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.ko.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.ko.resx index 44fac0c6832..5a2ce710cdc 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.ko.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.ko.resx @@ -842,16 +842,6 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi 대상 {0}용 도구 체인 디렉터리를 찾을 수 없습니다. {0} - The target architecture, such as Arm, Arm64, or X86_64 - - 어셈블리에서 네이티브 코드로 변환하지 못했습니다. 종료 코드 {0} - In this message, the term "assembly" means the low-level language that an assembler like `as` takes as input. (This is different from most of the other messages, where the term "assembly" means the file type that the C# compiler produces.) -{0} - The exit code number - - - NDK C 컴파일러가 오류로 인해 종료되었습니다. 종료 코드 {0} - The following are literal names and should not be translated: NDK, C -{0} - The exit code number - Android NDK를 찾을 수 없습니다. Android SDK 관리자에 Android NDK가 설치되어 있는지 확인하거나, 사용자 지정 NDK 경로를 사용하는 경우 $(AndroidNdkDirectory) MSBuild 속성이 사용자 지정 경로로 설정되어 있는지 확인하세요. The following are literal names and should not be translated: $(AndroidNdkDirectory) @@ -861,11 +851,6 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi {0} - The missing utility name, such as gcc or clang {1} - The target architecture, such as Arm, Arm64, or X86_64 {2} - The path of the directory that was searched - - - NDK 링커가 오류로 인해 종료되었습니다. 종료 코드 {0} - The following are literal names and should not be translated: NDK -{0} - The exit code number '{0}'을(를) 찾을 수 없습니다. '{1}{2}tools{2}{3}' 프로그램을 사용하여 Android SDK Build-Tools 패키지를 설치하세요. diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.pl.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.pl.resx index 8f6217b05cb..1feb2cc1cb1 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.pl.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.pl.resx @@ -842,16 +842,6 @@ Usuń odwołanie „{0}” z projektu i zamiast niego dodaj pakiet NuGet „{1} Nie znaleziono katalogu łańcucha narzędzi dla docelowej architektury {0}. {0} - The target architecture, such as Arm, Arm64, or X86_64 - - Konwersja z zestawu do kodu natywnego nie powiodła się. Kod zakończenia {0} - In this message, the term "assembly" means the low-level language that an assembler like `as` takes as input. (This is different from most of the other messages, where the term "assembly" means the file type that the C# compiler produces.) -{0} - The exit code number - - - Kompilator języka C zestawu NDK zakończył pracę z błędem. Kod zakończenia {0} - The following are literal names and should not be translated: NDK, C -{0} - The exit code number - Nie można było zlokalizować zestawu Android NDK. Upewnij się, że zestaw Android NDK jest zainstalowany w Menedżerze zestawów Android SDK, a jeśli używana jest niestandardowa ścieżka zestawu NDK, upewnij się, że właściwość $(AndroidNdkDirectory) narzędzia MSBuild jest ustawiona na ścieżkę niestandardową. The following are literal names and should not be translated: $(AndroidNdkDirectory) @@ -861,11 +851,6 @@ Usuń odwołanie „{0}” z projektu i zamiast niego dodaj pakiet NuGet „{1} {0} - The missing utility name, such as gcc or clang {1} - The target architecture, such as Arm, Arm64, or X86_64 {2} - The path of the directory that was searched - - - Konsolidator zestawu NDK zakończył pracę z błędem. Kod zakończenia {0} - The following are literal names and should not be translated: NDK -{0} - The exit code number Nie można znaleźć narzędzia „{0}”. Zainstaluj pakiet Android SDK Build-Tools za pomocą programu „{1}{2}tools{2}{3}”. diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.pt-BR.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.pt-BR.resx index 2ac7888ef3c..b63fbc0a68a 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.pt-BR.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.pt-BR.resx @@ -842,16 +842,6 @@ Remover a referência '{0}' de seu projeto e adicionar o pacote NuGet '{1}' em v O diretório de cadeia ferramentas do {0} de destino não foi encontrado. {0} - The target architecture, such as Arm, Arm64, or X86_64 - - Falha na conversão de assembly em código nativo. Código de saída {0} - In this message, the term "assembly" means the low-level language that an assembler like `as` takes as input. (This is different from most of the other messages, where the term "assembly" means the file type that the C# compiler produces.) -{0} - The exit code number - - - O compilador NDK C foi encerrado com um erro. Código de saída {0} - The following are literal names and should not be translated: NDK, C -{0} - The exit code number - Não foi possível localizar o Android NDK. Verifique se o Android NDK está instalado no Gerenciador de SDK Android ou, se estiver usando um caminho personalizado do NDK, verifique se a propriedade $(AndroidNdkDirectory) do MSBuild está definida para o caminho personalizado. The following are literal names and should not be translated: $(AndroidNdkDirectory) @@ -861,11 +851,6 @@ Remover a referência '{0}' de seu projeto e adicionar o pacote NuGet '{1}' em v {0} - The missing utility name, such as gcc or clang {1} - The target architecture, such as Arm, Arm64, or X86_64 {2} - The path of the directory that was searched - - - O vinculador NDK C foi encerrado com um erro. Código de saída {0} - The following are literal names and should not be translated: NDK -{0} - The exit code number Não é possível localizar `{0}`. Instale o pacote Build-Tools do SDK do Android com o programa `{1}{2}tools{2}{3}`. diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx index df1f9eef5a6..78b8e16b829 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx @@ -842,16 +842,8 @@ Remove the '{0}' reference from your project and add the '{1}' NuGet package ins Toolchain directory for target {0} was not found. {0} - The target architecture, such as Arm, Arm64, or X86_64 - - Conversion from assembly to native code failed. Exit code {0} - In this message, the term "assembly" means the low-level language that an assembler like `as` takes as input. (This is different from most of the other messages, where the term "assembly" means the file type that the C# compiler produces.) -{0} - The exit code number - - - NDK C compiler exited with an error. Exit code {0} - The following are literal names and should not be translated: NDK, C -{0} - The exit code number - + + Could not locate the Android NDK. Please make sure the Android NDK is installed in the Android SDK Manager, or if using a custom NDK path, please ensure the $(AndroidNdkDirectory) MSBuild property is set to the custom path. The following are literal names and should not be translated: $(AndroidNdkDirectory) @@ -862,11 +854,7 @@ Remove the '{0}' reference from your project and add the '{1}' NuGet package ins {1} - The target architecture, such as Arm, Arm64, or X86_64 {2} - The path of the directory that was searched - - NDK linker exited with an error. Exit code {0} - The following are literal names and should not be translated: NDK -{0} - The exit code number - + Cannot find `{0}`. Please install the Android SDK Build-Tools package with the `{1}{2}tools{2}{3}` program. The following are literal names and should not be translated: Android SDK Build-Tools, {1}{2}tools{2}{3} diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.ru.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.ru.resx index eb960c3b688..efba54a98a1 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.ru.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.ru.resx @@ -842,16 +842,6 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi Каталог цепочки инструментов для целевой архитектуры {0} не найден. {0} - The target architecture, such as Arm, Arm64, or X86_64 - - Не удалось выполнить преобразование из сборки в машинный код. Код выхода: {0}. - In this message, the term "assembly" means the low-level language that an assembler like `as` takes as input. (This is different from most of the other messages, where the term "assembly" means the file type that the C# compiler produces.) -{0} - The exit code number - - - Компилятор NDK C завершил работу с ошибкой. Код выхода: {0}. - The following are literal names and should not be translated: NDK, C -{0} - The exit code number - Не удалось найти Android NDK. Проверьте установку этого пакета в Диспетчере SDK Android, а если используется особый путь к NDK, этот путь должен быть задан в свойстве MSBuild $(AndroidNdkDirectory). The following are literal names and should not be translated: $(AndroidNdkDirectory) @@ -861,11 +851,6 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi {0} - The missing utility name, such as gcc or clang {1} - The target architecture, such as Arm, Arm64, or X86_64 {2} - The path of the directory that was searched - - - Работа компоновщика NDK завершилась с ошибкой. Код выхода: {0}. - The following are literal names and should not be translated: NDK -{0} - The exit code number Не удается найти "{0}". Установите пакет Android SDK Build-Tools с программой "{1}{2}tools{2}{3}". diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.tr.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.tr.resx index c434dd43549..e23a8d89347 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.tr.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.tr.resx @@ -842,16 +842,6 @@ Projenizden '{0}' başvurusunu kaldırın ve yerine '{1}' NuGet paketini ekleyin {0} hedefi için araç zinciri dizini bulunamadı. {0} - The target architecture, such as Arm, Arm64, or X86_64 - - Bütünleştirilmiş koddan yerel koda dönüştürülemedi. Çıkış kodu {0} - In this message, the term "assembly" means the low-level language that an assembler like `as` takes as input. (This is different from most of the other messages, where the term "assembly" means the file type that the C# compiler produces.) -{0} - The exit code number - - - NDK C derleyicisi bir hatayla çıkış yaptı. Çıkış kodu {0} - The following are literal names and should not be translated: NDK, C -{0} - The exit code number - Android NDK bulunamadı. Lütfen Android NDK'nin Android SDK Yöneticisi'nde yüklü olduğundan veya özel bir NDK yolu kullandığından emin olun. Lütfen $(AndroidNdkDirectory) MSBuild özelliğinin özel yola ayarlandığından emin olun. The following are literal names and should not be translated: $(AndroidNdkDirectory) @@ -861,11 +851,6 @@ Projenizden '{0}' başvurusunu kaldırın ve yerine '{1}' NuGet paketini ekleyin {0} - The missing utility name, such as gcc or clang {1} - The target architecture, such as Arm, Arm64, or X86_64 {2} - The path of the directory that was searched - - - NDK bağlayıcısı bir hatayla çıkış yaptı. Çıkış kodu {0} - The following are literal names and should not be translated: NDK -{0} - The exit code number `{0}` bulunamıyor. Lütfen `{1}{2}tools{2}{3}` programıyla Android SDK Build-Tools paketini yükleyin. diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.zh-Hans.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.zh-Hans.resx index b4f48046e2a..663dae61a5a 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.zh-Hans.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.zh-Hans.resx @@ -842,16 +842,6 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi 找不到目标 {0} 的工具链目录。 {0} - The target architecture, such as Arm, Arm64, or X86_64 - - 从程序集到本机代码转换失败。退出代码 {0} - In this message, the term "assembly" means the low-level language that an assembler like `as` takes as input. (This is different from most of the other messages, where the term "assembly" means the file type that the C# compiler produces.) -{0} - The exit code number - - - NDK C 编译器已退出,但出现错误。退出代码 {0} - The following are literal names and should not be translated: NDK, C -{0} - The exit code number - 找不到 Android NDK。请确保在 Android SDK 管理器中安装 Android NDK,或者如果使用自定义 NDK 路径,请确保将 $(AndroidNdkDirectory) MSBuild 属性设置为自定义路径。 The following are literal names and should not be translated: $(AndroidNdkDirectory) @@ -861,11 +851,6 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi {0} - The missing utility name, such as gcc or clang {1} - The target architecture, such as Arm, Arm64, or X86_64 {2} - The path of the directory that was searched - - - NDK 链接器已退出,但出现错误。退出代码 {0} - The following are literal names and should not be translated: NDK -{0} - The exit code number 找不到“{0}”。请使用 `{1}{2}tools{2}{3}` 程序安装 Android SDK 生成工具包。 diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.zh-Hant.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.zh-Hant.resx index f618d1366d8..42ce6678b85 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.zh-Hant.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.zh-Hant.resx @@ -842,16 +842,6 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi 找不到目標 {0} 的工具鏈目錄。 {0} - The target architecture, such as Arm, Arm64, or X86_64 - - 從組件到機器碼的轉換失敗。結束代碼 {0} - In this message, the term "assembly" means the low-level language that an assembler like `as` takes as input. (This is different from most of the other messages, where the term "assembly" means the file type that the C# compiler produces.) -{0} - The exit code number - - - NDK C 編譯器結束,但發生錯誤。結束代碼 {0} - The following are literal names and should not be translated: NDK, C -{0} - The exit code number - 找不到 Android NDK。請確認 Android NDK 已安裝在 Android SDK 管理員中,若使用自訂的 NDK 路徑,請確認 $(AndroidNdkDirectory) MSBuild 屬性已設定為自訂路徑。 The following are literal names and should not be translated: $(AndroidNdkDirectory) @@ -861,11 +851,6 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi {0} - The missing utility name, such as gcc or clang {1} - The target architecture, such as Arm, Arm64, or X86_64 {2} - The path of the directory that was searched - - - NDK 連結器結束,但發生錯誤。結束代碼 {0} - The following are literal names and should not be translated: NDK -{0} - The exit code number 找不到 `{0}`。請使用 `{1}{2}tools{2}{3}` 程式安裝 Android SDK Build-Tools 套件。 diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/MakeBundleNativeCodeExternal.cs b/src/Xamarin.Android.Build.Tasks/Tasks/MakeBundleNativeCodeExternal.cs deleted file mode 100644 index a6e012a456f..00000000000 --- a/src/Xamarin.Android.Build.Tasks/Tasks/MakeBundleNativeCodeExternal.cs +++ /dev/null @@ -1,274 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Text.RegularExpressions; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -using Java.Interop.Tools.Diagnostics; -using Xamarin.Android.Tools; -using Microsoft.Android.Build.Tasks; - -namespace Xamarin.Android.Tasks -{ - // can't be a single ToolTask, because it has to run mkbundle many times for each arch. - public class MakeBundleNativeCodeExternal : AndroidTask - { - public override string TaskPrefix => "MBN"; - - const string BundleSharedLibraryName = "libmonodroid_bundle_app.so"; - - public string? AndroidNdkDirectory { get; set; } - - [Required] - public ITaskItem[] Assemblies { get; set; } = []; - - // Which ABIs to include native libs for - [Required] - public string [] SupportedAbis { get; set; } = []; - - [Required] - public string TempOutputPath { get; set; } = ""; - - public string? IncludePath { get; set; } - - [Required] - public string ToolPath { get; set; } = ""; - - public bool AutoDeps { get; set; } - public bool EmbedDebugSymbols { get; set; } - public bool KeepTemp { get; set; } - - [Required] - public string BundleApiPath { get; set; } = ""; - - [Output] - public ITaskItem []? OutputNativeLibraries { get; set; } - - public MakeBundleNativeCodeExternal () - { - } - - public override bool RunTask () - { - NdkTools ndk = NdkTools.Create (AndroidNdkDirectory, logErrors: true, log: Log); - if (Log.HasLoggedErrors) { - return false; // NdkTools.Create will log appropriate error - } - - try { - return DoExecute (ndk); - } catch (XamarinAndroidException e) { - Log.LogCodedError (string.Format ("XA{0:0000}", e.Code), e.MessageWithoutCode); - if (MonoAndroidHelper.LogInternalExceptions) - Log.LogMessage (e.ToString ()); - } catch (Exception ex) { - Log.LogErrorFromException (ex); - } - return !Log.HasLoggedErrors; - } - - bool DoExecute (NdkTools ndk) - { - var results = new List (); - string bundlepath = Path.Combine (TempOutputPath, "bundles"); - if (!Directory.Exists (bundlepath)) - Directory.CreateDirectory (bundlepath); - else - Directory.Delete (bundlepath, true); - foreach (var abi in SupportedAbis) { - AndroidTargetArch arch = AndroidTargetArch.Other; - switch (abi) { - case "arm64": - case "arm64-v8a": - case "aarch64": - arch = AndroidTargetArch.Arm64; - break; - case "armeabi-v7a": - arch = AndroidTargetArch.Arm; - break; - case "x86": - arch = AndroidTargetArch.X86; - break; - case "x86_64": - arch = AndroidTargetArch.X86_64; - break; - case "mips": - arch = AndroidTargetArch.Mips; - break; - } - - if (!ndk.ValidateNdkPlatform (arch, enableLLVM: false)) { - return false; - } - - int level = ndk.GetMinimumApiLevelFor (arch); - var outpath = Path.Combine (bundlepath, abi); - if (!Directory.Exists (outpath)) - Directory.CreateDirectory (outpath); - - var clb = new CommandLineBuilder (); - clb.AppendSwitch ("--dos2unix=false"); - clb.AppendSwitch ("--nomain"); - clb.AppendSwitch ("--i18n none"); - clb.AppendSwitch ("--bundled-header"); - clb.AppendSwitch ("--mono-api-struct-path"); - clb.AppendFileNameIfNotNull (BundleApiPath); - clb.AppendSwitch ("--style"); - clb.AppendSwitch ("linux"); - clb.AppendSwitch ("-c"); - clb.AppendSwitch ("-o"); - clb.AppendFileNameIfNotNull (Path.Combine (outpath, "temp.c")); - clb.AppendSwitch ("-oo"); - clb.AppendFileNameIfNotNull (Path.Combine (outpath, "assemblies.o")); - if (AutoDeps) - clb.AppendSwitch ("--autodeps"); - if (KeepTemp) - clb.AppendSwitch ("--keeptemp"); - clb.AppendSwitch ("-z"); // Compress - clb.AppendFileNamesIfNotNull (Assemblies, " "); - var psi = new ProcessStartInfo () { - FileName = MkbundlePath, - Arguments = clb.ToString (), - UseShellExecute = false, - RedirectStandardOutput = true, - RedirectStandardError = true, - CreateNoWindow = true, - WindowStyle = ProcessWindowStyle.Hidden, - }; - string windowsCompilerSwitches = ndk.GetCompilerTargetParameters (arch, level); - var compilerNoQuotes = ndk.GetToolPath (NdkToolKind.CompilerC, arch, level); - var compiler = $"\"{compilerNoQuotes}\" {windowsCompilerSwitches}".Trim (); - var gas = '"' + ndk.GetToolPath (NdkToolKind.Assembler, arch, level) + '"'; - psi.EnvironmentVariables ["CC"] = compiler; - psi.EnvironmentVariables ["AS"] = gas; - Log.LogDebugMessage ("CC=" + compiler); - Log.LogDebugMessage ("AS=" + gas); - //psi.EnvironmentVariables ["PKG_CONFIG_PATH"] = Path.Combine (Path.GetDirectoryName (MonoDroidSdk.MandroidTool), "lib", abi); - Log.LogDebugMessage ("[mkbundle] " + psi.FileName + " " + clb); - var proc = new Process (); - proc.OutputDataReceived += OnMkbundleOutputData; - proc.ErrorDataReceived += OnMkbundleErrorData; - proc.StartInfo = psi; - proc.Start (); - proc.BeginOutputReadLine (); - proc.BeginErrorReadLine (); - proc.WaitForExit (); - if (proc.ExitCode != 0) { - Log.LogCodedError ("XA5102", Properties.Resources.XA5102, proc.ExitCode); - return false; - } - - // then compile temp.c into temp.o and ... - - clb = new CommandLineBuilder (); - - // See NdkToolsWithClangWithPlatforms.ctor for reasons why - if (!String.IsNullOrEmpty (windowsCompilerSwitches)) - clb.AppendTextUnquoted (windowsCompilerSwitches); - - clb.AppendSwitch ("-c"); - - // This is necessary only when unified headers are in use but it won't hurt to have it - // defined even if we don't use them - clb.AppendSwitch ($"-D__ANDROID_API__={level}"); - - // This is necessary because of the injected code, which is reused between libmonodroid - // and the bundle - clb.AppendSwitch ("-DANDROID"); - - clb.AppendSwitch ("-o"); - clb.AppendFileNameIfNotNull (Path.Combine (outpath, "temp.o")); - if (!string.IsNullOrWhiteSpace (IncludePath)) { - clb.AppendSwitch ("-I"); - clb.AppendFileNameIfNotNull (IncludePath); - } - - string asmIncludePath = ndk.GetDirectoryPath (NdkToolchainDir.AsmInclude, arch, level); - if (!String.IsNullOrEmpty (asmIncludePath)) { - clb.AppendSwitch ("-I"); - clb.AppendFileNameIfNotNull (asmIncludePath); - } - - clb.AppendSwitch ("-I"); - clb.AppendFileNameIfNotNull (ndk.GetDirectoryPath (NdkToolchainDir.PlatformInclude, arch, level)); - clb.AppendFileNameIfNotNull (Path.Combine (outpath, "temp.c")); - Log.LogDebugMessage ("[CC] " + compiler + " " + clb); - if (MonoAndroidHelper.RunProcess (compilerNoQuotes, clb.ToString (), OnCcOutputData, OnCcErrorData) != 0) { - Log.LogCodedError ("XA5103", Properties.Resources.XA5103, proc.ExitCode); - return false; - } - - // ... link temp.o and assemblies.o into app.so - - clb = new CommandLineBuilder (); - clb.AppendSwitch ("--shared"); - clb.AppendFileNameIfNotNull (Path.Combine (outpath, "temp.o")); - clb.AppendFileNameIfNotNull (Path.Combine (outpath, "assemblies.o")); - - // API23+ requires that the shared library has its soname set or it won't load - clb.AppendSwitch ("-soname"); - clb.AppendSwitch (BundleSharedLibraryName); - clb.AppendSwitch ("-o"); - clb.AppendFileNameIfNotNull (Path.Combine (outpath, BundleSharedLibraryName)); - clb.AppendSwitch ("-L"); - clb.AppendFileNameIfNotNull (ndk.GetDirectoryPath (NdkToolchainDir.PlatformLib, arch, level)); - clb.AppendSwitch ("-lc"); - clb.AppendSwitch ("-lm"); - clb.AppendSwitch ("-ldl"); - clb.AppendSwitch ("-llog"); - clb.AppendSwitch ("-lz"); // Compress - string ld = ndk.GetToolPath (NdkToolKind.Linker, arch, level); - Log.LogMessage (MessageImportance.Normal, "[LD] " + ld + " " + clb); - if (MonoAndroidHelper.RunProcess (ld, clb.ToString (), OnLdOutputData, OnLdErrorData) != 0) { - Log.LogCodedError ("XA5201", Properties.Resources.XA5201, proc.ExitCode); - return false; - } - results.Add (new TaskItem (Path.Combine (outpath, "libmonodroid_bundle_app.so"))); - } - OutputNativeLibraries = results.ToArray (); - return true; - } - - void OnCcOutputData (object sender, DataReceivedEventArgs e) - { - Log.LogDebugMessage ("[cc stdout] {0}", e.Data ?? ""); - } - - void OnCcErrorData (object sender, DataReceivedEventArgs e) - { - Log.LogMessage ("[cc stderr] {0}", e.Data ?? ""); - } - - void OnLdOutputData (object sender, DataReceivedEventArgs e) - { - Log.LogDebugMessage ("[ld stdout] {0}", e.Data ?? ""); - } - - void OnLdErrorData (object sender, DataReceivedEventArgs e) - { - Log.LogMessage ("[ld stderr] {0}", e.Data ?? ""); - } - - void OnMkbundleOutputData (object sender, DataReceivedEventArgs e) - { - Log.LogDebugMessage ("[mkbundle stdout] {0}", e.Data ?? ""); - } - - void OnMkbundleErrorData (object sender, DataReceivedEventArgs e) - { - Log.LogMessage ("[mkbundle stderr] {0}", e.Data ?? ""); - } - - string MkbundlePath { - get { - return Path.Combine (ToolPath, "mkbundle.exe"); - } - } - } -} diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/MakeBundleNativeCodeExternalTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/MakeBundleNativeCodeExternalTests.cs deleted file mode 100644 index 31f33804af5..00000000000 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/MakeBundleNativeCodeExternalTests.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using Microsoft.Build.Framework; -using NUnit.Framework; -using System.Collections.Generic; -using System.IO; -using Xamarin.Android.Tasks; - -namespace Xamarin.Android.Build.Tests { - - [TestFixture] - public class MakeBundleNativeCodeExternalTests : BaseTest { - List errors; - List warnings; - List messages; - MockBuildEngine engine; - string path; - - [SetUp] - public void Setup () - { - engine = new MockBuildEngine (TestContext.Out, - errors: errors = new List (), - warnings: warnings = new List (), - messages: messages = new List ()); - - path = Path.Combine (Root, "temp", TestName); - TestOutputDirectories [TestContext.CurrentContext.Test.ID] = path; - } - - [TestCase (null)] - [TestCase ("")] - [TestCase ("DoesNotExist")] - public void XA5104AndroidNdkNotFound (string androidNdkDirectory) - { - var task1 = new MakeBundleNativeCodeExternal { - BuildEngine = engine, - AndroidNdkDirectory = androidNdkDirectory, - Assemblies = Array.Empty (), - SupportedAbis = new [] { "armeabi-v7a" }, - TempOutputPath = path, - ToolPath = "", - BundleApiPath = "" - }; - - Assert.IsFalse (task1.Execute (), "Task should fail!"); - BuildErrorEventArgs error1 = errors [0]; - Assert.AreEqual ("XA5104", error1.Code); - StringAssert.Contains (" NDK ", error1.Message); - StringAssert.Contains ("AndroidNdkDirectory", error1.Message); - StringAssert.Contains ("SDK Manager", error1.Message); - - var task2 = new Aot { - BuildEngine = engine, - AndroidNdkDirectory = androidNdkDirectory, - AndroidAotMode = "normal", - AndroidApiLevel = "28", - EnableLLVM = true, - ResolvedAssemblies = Array.Empty (), - SupportedAbis = new [] { "armeabi-v7a" }, - AotOutputDirectory = path, - IntermediateAssemblyDir = path - }; - - if (androidNdkDirectory == "DoesNotExist") { - Assert.IsFalse (task2.Execute (), "Task should fail!"); - BuildErrorEventArgs error2 = errors [1]; - Assert.AreEqual (error1.Message, error2.Message, "Aot and MakeBundleNativeCodeExternal should produce the same error messages."); - } else { - Assert.IsTrue (task2.Execute (), "Aot task should succeed with null or empty NDK!"); - } - } - } -} diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets index ec72580c77b..0ee0e5019ec 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets @@ -87,7 +87,7 @@ Copyright (C) 2011-2012 Xamarin. All rights reserved. - + diff --git a/tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/Assets/AboutAssets.txt b/tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/Assets/AboutAssets.txt deleted file mode 100644 index a9b0638eb1b..00000000000 --- a/tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/Assets/AboutAssets.txt +++ /dev/null @@ -1,19 +0,0 @@ -Any raw assets you want to be deployed with your application can be placed in -this directory (and child directories) and given a Build Action of "AndroidAsset". - -These files will be deployed with your package and will be accessible using Android's -AssetManager, like this: - -public class ReadAsset : Activity -{ - protected override void OnCreate (Bundle bundle) - { - base.OnCreate (bundle); - - InputStream input = Assets.Open ("my_asset.txt"); - } -} - -Additionally, some Android functions will automatically load asset files: - -Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); diff --git a/tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/MainActivity.cs b/tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/MainActivity.cs deleted file mode 100644 index cad37e42f87..00000000000 --- a/tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/MainActivity.cs +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This is a small port of the "San Angeles Observation" demo - * program for OpenGL ES 1.x. For more details, see: - * - * http://jet.ro/visuals/san-angeles-observation/ - * - * This program demonstrates how to use a GLSurfaceView from Java - * along with native OpenGL calls to perform frame rendering. - * - * Touching the screen will start/stop the animation. - * - * Note that the demo runs much faster on the emulator than on - * real devices, this is mainly due to the following facts: - * - * - the demo sends bazillions of polygons to OpenGL without - * even trying to do culling. Most of them are clearly out - * of view. - * - * - on a real device, the GPU bus is the real bottleneck - * that prevent the demo from getting acceptable performance. - * - * - the software OpenGL engine used in the emulator uses - * the system bus instead, and its code rocks :-) - * - * Fixing the program to send less polygons to the GPU is left - * as an exercise to the reader. As always, patches welcomed :-) - */ -using System; - -using Javax.Microedition.Khronos.Egl; -using Javax.Microedition.Khronos.Opengles; - -using Android.App; -using Android.Content; -using Android.Opengl; -using Android.OS; -using Android.Views; -using System.Runtime.InteropServices; - -namespace SanAngles -{ - class Consts - { - public const string NativeLibrary = "native"; - } - - [Activity (Label = "Mono Mkbundle Test", MainLauncher = true)] - public class DemoActivity : Activity { - protected override void OnCreate (Bundle savedInstanceState) - { - base.OnCreate (savedInstanceState); - mGLView = new DemoGLSurfaceView (this); - SetContentView (mGLView); - } - - protected override void OnPause () - { - base.OnPause(); - mGLView.OnPause (); - } - - protected override void OnResume () - { - base.OnResume (); - mGLView.OnResume (); - } - - private GLSurfaceView mGLView; - } - - class DemoGLSurfaceView : GLSurfaceView - { - public DemoGLSurfaceView (Context context) - : base (context) - { - mRenderer = new DemoRenderer (); - SetRenderer (mRenderer); - } - - public override bool OnTouchEvent (MotionEvent evt) - { - if (evt.Action == MotionEventActions.Down) - nativePause (IntPtr.Zero); - - return true; - } - - DemoRenderer mRenderer; - - [DllImport (Consts.NativeLibrary, EntryPoint = "Java_com_example_SanAngeles_DemoGLSurfaceView_nativePause")] - static extern void nativePause (IntPtr jnienv); - } - - class DemoRenderer : Java.Lang.Object, GLSurfaceView.IRenderer - { - public void OnSurfaceCreated (IGL10 gl, Javax.Microedition.Khronos.Egl.EGLConfig config) - { - nativeInit (IntPtr.Zero); - } - - public void OnSurfaceChanged (IGL10 gl, int w, int h) - { - //gl.glViewport(0, 0, w, h); - nativeResize (IntPtr.Zero, IntPtr.Zero, w, h); - } - - public void OnDrawFrame (IGL10 gl) - { - nativeRender (IntPtr.Zero); - } - - [DllImport (Consts.NativeLibrary, EntryPoint = "Java_com_example_SanAngeles_DemoRenderer_nativeInit")] - private static extern void nativeInit (IntPtr jnienv); - [DllImport (Consts.NativeLibrary, EntryPoint = "Java_com_example_SanAngeles_DemoRenderer_nativeResize")] - private static extern void nativeResize (IntPtr jnienv, IntPtr thiz, int w, int h); - [DllImport (Consts.NativeLibrary, EntryPoint = "Java_com_example_SanAngeles_DemoRenderer_nativeRender")] - private static extern void nativeRender (IntPtr jnienv); - [DllImport (Consts.NativeLibrary, EntryPoint = "Java_com_example_SanAngeles_DemoRenderer_nativeDone")] - private static extern void nativeDone (IntPtr jnienv); - } -} diff --git a/tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/Properties/AndroidManifest.xml b/tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/Properties/AndroidManifest.xml deleted file mode 100644 index 7ff42ff1ffd..00000000000 --- a/tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/Properties/AndroidManifest.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/Properties/AssemblyInfo.cs b/tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 6cc4a265e85..00000000000 --- a/tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using Android.App; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. -[assembly: AssemblyTitle ("Xamarin.Android.MakeBundle-Tests")] -[assembly: AssemblyDescription ("")] -[assembly: AssemblyConfiguration ("")] -[assembly: AssemblyCompany ("")] -[assembly: AssemblyProduct ("")] -[assembly: AssemblyCopyright ("atsushi")] -[assembly: AssemblyTrademark ("")] -[assembly: AssemblyCulture ("")] -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. -[assembly: AssemblyVersion ("1.0.0")] -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] - diff --git a/tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/Resources/AboutResources.txt b/tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/Resources/AboutResources.txt deleted file mode 100644 index 10f52d46021..00000000000 --- a/tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/Resources/AboutResources.txt +++ /dev/null @@ -1,44 +0,0 @@ -Images, layout descriptions, binary blobs and string dictionaries can be included -in your application as resource files. Various Android APIs are designed to -operate on the resource IDs instead of dealing with images, strings or binary blobs -directly. - -For example, a sample Android app that contains a user interface layout (main.axml), -an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) -would keep its resources in the "Resources" directory of the application: - -Resources/ - drawable/ - icon.png - - layout/ - main.axml - - values/ - strings.xml - -In order to get the build system to recognize Android resources, set the build action to -"AndroidResource". The native Android APIs do not operate directly with filenames, but -instead operate on resource IDs. When you compile an Android application that uses resources, -the build system will package the resources for distribution and generate a class called "R" -(this is an Android convention) that contains the tokens for each one of the resources -included. For example, for the above Resources layout, this is what the R class would expose: - -public class R { - public class drawable { - public const int icon = 0x123; - } - - public class layout { - public const int main = 0x456; - } - - public class strings { - public const int first_string = 0xabc; - public const int second_string = 0xbcd; - } -} - -You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main -to reference the layout/main.axml file, or R.strings.first_string to reference the first -string in the dictionary file values/strings.xml. diff --git a/tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/Resources/drawable/Icon.png b/tests/CodeGen-MkBundle/Xamarin.Android.MakeBundle-Tests/Resources/drawable/Icon.png deleted file mode 100644 index a07c69fa5a0f4da5d5efe96eea12a543154dbab6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2574 zcmV+p3i0)cP)Q`Og{P|8RRXpj5bgrSmEzSMfBn+{{vpNxw?;5UX;iv9sYxy_`IQHs$i<61a_iv^L>h8s-`D(`e@|IgS*Fj zNGM876Gf;3D8*1UX9a%v>yJKD*QkCwW2AirU(L{qNA)JghmGItc;(H<$!ABY&gBy1vJIEUj-b8%el*o|VkG)LqNx#TG>Jvj^jIte!!+RY z)T4j$7+PoF1AkRBf}R#^T=-q|PaK1$c<4UH)Hpq3$4WA|xtr!ZQLC=*vNE>O6E9kp+5X0eKB$6>C(lPwI@3#oY zhS_%x7e|j!$yG?ECXmh~EH~^OeuK}+sWoJse3Z3?ha3n`MM9KvA?uqpEnBg4Q46)7 zM$p%a$@l;+O}vfvx%XjH`}a{(-HHth9!JaUwV0*VqGR48^gWNYN<&~7x)y$e!X>e` zZ5!6KZoxbKuV9XUDI%#M1~IVh?pNSdeb~6@$y`v|yk=XK+fHxnDqnUK4&=QRNyIVf zYbDM*cI>~qIy*a7=z7uqkw@agd(<=y-Q7L!ty_23SGdXmahO<;N=wB+j;lNm%=OHC zy zU|>La6h%92y4IPufI$9>Xu!@y`TaNgtg&41@PwMwBdmSm7)xAWDLoqjZ==P2#*k7! z3o1)cVSI3KP_!?d8G^Lg0FtLXC~JYdxi|c%h~lXEixY=%VSFF@!*3&&9>(Rb|iK54Cx5;s~PY5iaV1het%w`dgQFBAJ;aFK zImQC}(|QaCFYUm1JVfzSc)ebv=)ObI)0jwJb``}Zj9J0n0Xgn*Zc(rFM9$xh_makZbm-at_v5^SW zM1y1SW@%+FuIy*WR)i3A2N_q;(YO`O!A|Ts^%z}9ZepCj3ytlw#x%N_fNrKKtPh`< z|1{UqF`4LxHaCQ79+E=uUXCOZ35jAMRz%R%0(P!0FMv=sk>Nr8%+OzY^c-M9@+fz=G`qa@v4sF5u-2289-#$**LWnyNNDwDf1( zkUiMnw|y$tn>pQP=Vn!#|17L^5AGrjtBkN$D@v)Z7LXc5EFhLB4<;7Wehh)CMqX|W zqsiZaO^benJ_hwa&V0ub$-_HUk**?g6fm9|!@kguU6*zhK)$qn-<3*kFrYPIaqR=V zUaUvk>@F_89b@tHs8R!*QKY;INJ<2_U+K6Ca3e9Gsl2{qY0%a7J?uICWgHuLfj+MB z=GkAN1&ifT#2u}B+2S#~$5jA(Qn^;H%CCmIae4AE-Dsng|Hl*Ov!z72k3ZnJs{pp| z+pW`DDueC#mEWOf=ucJ!dTL}hzOeiS-i?m2E;`EKz4<&Lu~NnW?peqVU^@<+T3KKu z{yrI%Qy-Z%HEvLUz}n^~m?7x`xuCtNR#L2En!T>dQtIKdS#V-Hzt3RtwTeYtmQ&dR z6qXZvac*oc@BUYEH%@Ylv_1&tSjkbzzU6*h1(3^C`;1z;g_SmOtclS?KWk2VYE zM*oS<=C483XckW?GN|1jfh3Ro(h - -