-
Notifications
You must be signed in to change notification settings - Fork 533
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
Starting in Xamarin.Android 10.2, .pdb files are not included in the APK if the managed linker is enabled #5009
Comments
This configuration emits a warning, right? |
Nah, there's no warning in this case because both fast deployment and AndroidUseSharedRuntime are disabled in this scenario. That is, this is the fallback "no fast deployment" scenario that might temporarily become more high traffic again in d16-9, depending on how smoothly the new rewritten fast deployment feature works for customers. |
When would you want fast deployment off, linker on, and debugging? It seems like a bananas combination, maybe we should have a warning? It seems like to me that This would also solve the issue. |
I'm not sure it's too terribly bananas. It seems potentially helpful in some edge cases to be able to debug with the linker enabled to try to debug issues that might only happen when the linker is enabled? Or to put it another way, it seems useful to be able to make the Debug configuration as similar to the Release configuration as possible for some edge cases where issues might only appear in the Release configuration. For example, what if somehow in some outlandish scenario, |
use AndroidIncludeDebugSymbols for _RemoveRegisterAttribute. Fixes dotnet#5009
use AndroidIncludeDebugSymbols for _RemoveRegisterAttribute. Fixes dotnet#5009
use AndroidIncludeDebugSymbols for _RemoveRegisterAttribute. Fixes dotnet#5009
use AndroidIncludeDebugSymbols for _RemoveRegisterAttribute. Fixes dotnet#5009
use AndroidIncludeDebugSymbols for _RemoveRegisterAttribute. Fixes dotnet#5009
use AndroidIncludeDebugSymbols for _RemoveRegisterAttribute. Fixes dotnet#5009
use AndroidIncludeDebugSymbols for _RemoveRegisterAttribute. Fixes dotnet#5009
use AndroidIncludeDebugSymbols for _RemoveRegisterAttribute. Fixes dotnet#5009
use AndroidIncludeDebugSymbols for _RemoveRegisterAttribute. Fixes dotnet#5009
use AndroidIncludeDebugSymbols for _RemoveRegisterAttribute. Fixes dotnet#5009
use AndroidIncludeDebugSymbols for _RemoveRegisterAttribute. Fixes dotnet#5009
use AndroidIncludeDebugSymbols for _RemoveRegisterAttribute. Fixes dotnet#5009
use AndroidIncludeDebugSymbols for _RemoveRegisterAttribute. Fixes dotnet#5009
use AndroidIncludeDebugSymbols for _RemoveRegisterAttribute. Fixes dotnet#5009
use AndroidIncludeDebugSymbols for _RemoveRegisterAttribute. Fixes dotnet#5009
use AndroidIncludeDebugSymbols for _RemoveRegisterAttribute. Fixes dotnet#5009
use AndroidIncludeDebugSymbols for _RemoveRegisterAttribute. Fixes dotnet#5009
use AndroidIncludeDebugSymbols for _RemoveRegisterAttribute. Fixes dotnet#5009
Fixes dotnet#5009 Fixes dotnet#5147 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](dotnet@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
Fixes dotnet#5009 Fixes dotnet#5147 Fixes dotnet#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](dotnet@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
Fixes dotnet#5009 Fixes dotnet#5147 Fixes dotnet#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](dotnet@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
Fixes dotnet#5009 Fixes dotnet#5147 Fixes dotnet#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](dotnet@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
Fixes dotnet#5009 Fixes dotnet#5147 Fixes dotnet#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](dotnet@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
Fixes dotnet#5009 Fixes dotnet#5147 Fixes dotnet#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](dotnet@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
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
Release status update A new Preview version of Xamarin.Android has now been published that includes the fix for this item. Fix included in Xamarin.Android SDK version 11.1.99.168. Fix included on Windows in Visual Studio 2019 version 16.9 Preview 1. To try the Preview version that includes the fix, check for the latest updates in Visual Studio Preview. Fix included on macOS in Visual Studio 2019 for Mac version 8.9 Preview 1. To try the Preview version that includes the fix, check for the latest updates on the Preview updater channel. |
Context: https://developercommunity.visualstudio.com/content/problem/1036602/debug-only-works-when-linking-is-set-to-none.html
It appears this change might have been introduced in 77ab240. In particular, before that change, only framework assemblies were copied into android/assets/shrunk, but now all assemblies are copied there. It looks like either (a) the .pdb files need to be copied to the android/assets/shrunk directory too or (b) the
BuildApk
task needs to use a different strategy to locate them since it currently assumes they are alongside the assemblies:https://github.com/xamarin/xamarin-android/blob/e61ff790ca524ac173be3965fbbad510d8303b43/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs#L349-L352
Perhaps of interest, there is already a
_ResolvedSymbols
MSBuild item list that contains the symbol locations, but that item list is not currently used in theBuildApk
task.Steps to reproduce
Activity.OnCreate()
override.Expected behavior
Actual behavior
Partial workaround
In Visual Studio 2019 version 16.6 or higher, set Build > Advanced > Debugging information to Embedded in the Visual Studio project properties pages. This corresponds to the
embedded
value for theDebugType
MSBuild property in the .csproj file:This is only a partial workaround because some projects might have reasons to prefer not to use embedded debugging symbols. Additionally, since embedded debugging symbols are relatively new, they might potentially have other unexpected consequences.
Version information
Affected versions
Last known version that includes the .pdb files in the APK in this scenario
The text was updated successfully, but these errors were encountered: