You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Xamarin.Android.Build.Tasks] Fast Deployment v2.0
Fixes#5009Fixes#5147Fixes#4996
The Fast Deployment system used for debugging Xamarin.Android
apps has been completely re-written. This is mostly due to
changes in the android OS 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 the advent of Android 11, these directories are no longer accessable.
So instead we need to deploy the assemblies into the app internal `files`
directory. This is usually located in `/data/data/com.some.package`. 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 diectory.
The `run-as` tool does not always work on older devices. So from this point on
Fast Deployment will only be available on API 21 devices or newer. 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.
The [Enhanced Fast Deployment](~/android/deploy-test/building-apps/build-properties.md#AndroidFastDeploymentType) mode is still available with this new system.
This will deploy both assemblies, native libraries, typemaps and dexes to the `files`
directory. Support for Fast Deploying resources and assets via that system was
removed in commit [f0d565f](f0d565f). This was becuase it required the use of
depreicated API's to work.
The Shared Runtime has also be removed in this new system. Before we used to deploy
the BCL and API specific assemblies via seperate .apks. 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`
Old From Clean Time Elapsed 00:00:11.42
Old C# Change Time Elapsed 00:00:02.58
New From Clean Time Elapsed 00:00:11.78
New C# Change Time Elapsed 00:00:02.43
-`Dexes`: Deploy `.dex` files, Android Resources, and Android
437
-
Assets. **This value can *only* be used on devices running
438
+
-`Dexes`: Deploy `.dex` files, native libraries and typemaps.
439
+
**This value can *only* be used on devices running
438
440
Android 4.4 or later (API-19).**
439
441
440
442
The default value is `Assemblies`.
441
443
444
+
Support for Fast Deploying resources and assets via that system was
445
+
removed in commit [f0d565fe](https://github.com/xamarin/xamarin-android/commit/f0d565fe4833f16df31378c77bbb492ffd2904b9). This was becuase it required the use of
446
+
deprecated API's to work.
447
+
442
448
**Experimental**. Added in Xamarin.Android 6.1.
443
449
444
450
## AndroidGenerateJniMarshalMethods
@@ -1003,18 +1009,6 @@ than `aapt`.
1003
1009
1004
1010
Added in Xamarin.Android 8.1.
1005
1011
1006
-
## AndroidUseSharedRuntime
1007
-
1008
-
A boolean property that
1009
-
determines whether the *shared runtime packages* are required in
1010
-
order to run the Application on the target device. Relying on the
1011
-
shared runtime packages allows the Application package to be
1012
-
smaller, speeding up the package creation and deployment process,
1013
-
resulting in a faster build/deploy/debug turnaround cycle.
1014
-
1015
-
This property should be `True` for Debug builds, and `False` for
Copy file name to clipboardExpand all lines: Documentation/guides/messages/README.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,15 @@ ms.date: 01/24/2020
69
69
+[XA0122](xa0122.md): Assembly '{assembly}' is using a deprecated attribute '[assembly: Java.Interop.DoNotPackageAttribute]'. Use a newer version of this NuGet package or notify the library author.
70
70
+ XA0123: Removing {issue} from {propertyName}. Lint {version} does not support this check.
71
71
+[XA0124](xa0124.md): Interpreter is not supported by the x86 ABI
72
+
+[XA0125](xa0125.md): `{Project}` is using a deprecated debug information level.
73
+
Set the debugging information to Portable in the Visual Studio project property pages or edit the project file in a text editor and set the 'DebugType' MSBuild property to 'portable' to use the newer, cross-platform debug information level.
74
+
If this file comes from a NuGet package, update to a newer version of the NuGet package or notify the library author.
75
+
+[XA0126](xa0126.md): Error installing FastDev Tools. This device does not support Fast Deployment. Please rebuild your app using `EmbedAssembliesIntoApk = True`.
76
+
+[XA0127](xa0127.md): There was an issue deploying {destination} using {FastDevTool}. We encountered the following error {output}. Please rebuild your app using `EmbedAssembliesIntoApk = True`.
77
+
+[XA0128](xa0128.md): Stdio Redirection is enabled. Please disable it to use Fast Deployment.
78
+
+[XA0129](xa0129.md): Error deploying `{File}`. Please disable fast deployment in the Visual Studio project property pages or edit the project file in a text editor and set the 'EmbedAssembliesIntoApk' MSBuild property to 'true'.
79
+
+[XA0130](xa0130.md): Sorry. Fast deployment is only supported on devices running Android 5.0 (API level 21) or higher.
80
+
Please disable fast deployment in the Visual Studio project property pages or edit the project file in a text editor and set the 'EmbedAssembliesIntoApk' MSBuild property to 'true'.
72
81
73
82
## XA1xxx: Project related
74
83
@@ -233,6 +242,7 @@ and `NNN` is a 3 digit number indicating the type of the unhandled `Exception`.
This issue happens when you are trying to use fast deployment on a device which
11
+
does not support it. Fast deployment requires features which are not available
12
+
on devices running API 20 or lower. The Fast Deployment system makes use of the
13
+
[`run-as`](https://android.googlesource.com/platform/system/core.git/+/refs/heads/master/run-as/run-as.cpp#42) feature of the Android OS. This feature was either not available or had
14
+
limited capabilities in API 20 and earlier.
15
+
16
+
## Solution
17
+
18
+
Disable Fast Deployment by setting `EmbedAssembliesIntoApk = True` in your .csproj.
19
+
Or turn off `Fast Deployment` in the IDE. You will still be able to debug on the device,
20
+
all the required files will be packaged inside the .apk.
If you encounter this issue something unexpected happened with the Fast Deployment
11
+
native tooling. This is most likely to be a native crash.
12
+
13
+
## Solution
14
+
15
+
To work around the issue disable Fast Deployment by setting `EmbedAssembliesIntoApk = True`
16
+
in your .csproj. Or turn off `Fast Deployment` in the IDE. You will still be able to debug
17
+
on the device, all the required files will be packaged inside the .apk.
18
+
19
+
In addition raise an issue at [https://github.com/xamarin/xamarin-android/issues/new/choose](https://github.com/xamarin/xamarin-android/issues/new/choose). Please provide the deployment log and as much detail as possible.
This issue happens when you are trying to use fast deployment on a device which
10
+
does not support it. In this case both the normal and backup types of fast
11
+
deployment failed. The Fast Deployment system makes use of the
12
+
[`run-as`](https://android.googlesource.com/platform/system/core.git/+/refs/heads/master/run-as/run-as.cpp#42) feature of the Android OS. This feature was either not available or had
13
+
limited capabilities in API 20 and earlier
14
+
15
+
## Solution
16
+
17
+
Disable Fast Deployment by setting `EmbedAssembliesIntoApk = True` in your .csproj.
18
+
Or turn off `Fast Deployment` in the IDE. You will still be able to debug on the device,
19
+
all the required files will be packaged inside the .apk.
0 commit comments