Skip to content

Conversation

@jonpryor
Copy link
Contributor

Context: https://developer.xamarin.com/releases/android/xamarin.android_7/xamarin.android_7.4/#API-10_is_Obsolete
Context: #1105
Context: #1032

In Xamarin.Android 7.4, we announced that API-10 was obsolete and
would be removed in a future release.

PR #1032 attempted to do so, but does not yet work, so until now we
have continued shipping API-10 assemblies, even though
Xamarin.Android 7.4 hit stable on 2017-Aug-11.

Meanwhile, PR #1105 includes an NDK bump, which in turn means that the
lowest API level we can compile for will be API-14.

Attempt to split the difference, assuming PR #1105 lands before
PR #1032: Keep the supporting files for API-10, but don't build them,
and explicitly remove v2.3 from the .vsix file.

Context: https://developer.xamarin.com/releases/android/xamarin.android_7/xamarin.android_7.4/#API-10_is_Obsolete
Context: dotnet#1105
Context: dotnet#1032

In Xamarin.Android 7.4, we announced that API-10 was obsolete and
would be removed in a future release.

PR dotnet#1032 attempted to do so, but does not yet work, so until now we
have continued shipping API-10 assemblies, even though
Xamarin.Android 7.4 hit stable on 2017-Aug-11.

Meanwhile, PR dotnet#1105 includes an NDK bump, which in turn means that the
lowest API level we can compile for will be *API-14*.

Attempt to split the difference, assuming PR dotnet#1105 lands before
PR dotnet#1032: Keep the supporting files for API-10, but don't build them,
and explicitly remove `v2.3` from the `.vsix` file.
@jonpryor jonpryor added the full-mono-integration-build For PRs; run a full build (~6-10h for mono bumps), not the faster PR subset (~2h for mono bumps) label Dec 15, 2017
@jonpryor jonpryor merged commit 6671f05 into dotnet:master Dec 16, 2017
jonpryor added a commit that referenced this pull request Dec 17, 2017
jonpryor added a commit that referenced this pull request Dec 17, 2017
Revert commit 6671f05.

Removing the build and install of API-10 broke the monodroid build;
this will need to be fixed later.

Additionally, commit 6671f05 was *incomplete*: it stopped building
and installing the `v2.3` framework, but e.g.
`Xamarin.Android.CSharp.targets` still used `v2.3` as the default.
jonpryor pushed a commit that referenced this pull request Oct 12, 2020
Fixes: #4996
Fixes: #5009
Fixes: #5147

Changes: xamarin/monodroid@1ac5333...767f647

  * xamarin/monodroid@767f64715: [msbuild] Fast Deployment v2.0 (#1090)
  * xamarin/monodroid@0f04ba56d: Merge pull request #1115 from xamarin/remove-xreitem
  * xamarin/monodroid@d75341fc3: Remove provisionator file completely
  * xamarin/monodroid@b62e8c693: Replace XreItem with supported Xcode and JavaJDK syntax

The Fast Deployment system used for debugging Xamarin.Android apps has
been completely re-written.  This is mostly due to changes in Android
which means we can no longer use the external storage directory to
store assemblies.

Fast Deployment works by not including files which change often,
like assemblies, in the actual apk.  This means the `.apk` will mostly
not need to be re-installed during a debugging/development session.
Instead the assemblies are "Fast Deployed" to a special directory where
a debug version of our runtime knows where to find them.

Historically this was on the external storage directory such as

	/storage/emulated/0/Android/data/com.some.package
	/mnt/shell/emulated/0/Android/data/com.some.package
	/storage/sdcard/Android/data/com.some.package

With Android 11, these directories are no longer accessible.  Instead,
we need to deploy the assemblies into the app's internal `files`
directory.  This is usually located in `/data/data/@PACKAGE_NAME@`.
This is not a global writable folder, so we need to use the `run-as`
tool to run all the commands to copy the files into that directory.

The `run-as` tool does not always work on older devices.  From this
point on Fast Deployment v2 will only be available on API-21+ devices.
If a certain device does not support the `run-as` tool, then you can
always fall back to debugging without Fast Deployment.  While this is
slower, it should still work on most devices.

[`$(AndroidFastDeploymentType)`][0] is still supported.  This will
deploy both assemblies, native libraries, typemaps, and `.dex` files to
the `files` directory.  Support for Fast Deploying Android resources
and assets was removed in commit f0d565f, as it required the use of
deprecated API's to work.

The Shared Runtime has also be removed in this new system.  Previously,
we used to deploy the BCL and API specific assemblies via separate
`.apk` files.  This new system removes the need for that.  All the BCL
and API specific assemblies will be deployed to the `files` directory
like all the other assemblies.

The new system is on par with the existing system when it comes to
speed.  More improvements are planned in future releases which should
make it much quicker.

Using the `samples\HelloWorld` project these are the performance
differences using `HelloWorld.csproj /restore /t:Install /v:n`:

  * Deploy "from Clean"
    * v1: 00:00:11.42
    * v2: 00:00:11.78 [3% longer]
  * Incrementally deploy C#-based change
    * v1: 00:00:02.58
    * v2: 00:00:02.43 [6% faster]

[0]: https://docs.microsoft.com/en-us/xamarin/android/deploy-test/building-apps/build-properties#androidfastdeploymenttype
@github-actions github-actions bot locked and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

full-mono-integration-build For PRs; run a full build (~6-10h for mono bumps), not the faster PR subset (~2h for mono bumps)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant