-
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
Cherry-pick fixes from master #841
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dotnet#749) Context: https://bugzilla.xamarin.com/show_bug.cgi?id=58580 Unable to locate assemblies when running projects when `$(Configuration)`=Release and `$(Optimize)` != True. Commit edabe8a reworked the build logic so that `$(Optimize)` controls the deployment of the debug or release runtimes. Input Property: || Output Property DebugSymbols | DebugType | EmbedAssembliesIntoApk | Optimize || AndroidIncludeDebugSymbols ================+============+==========================+============++=========================== True *any* True True False (Release runtime) True *any* True False True (Debug runtime) True *any* False True True (Debug runtime) True *any* False False True (Debug runtime) True *empty* True True True (Debug runtime) True *empty* True False True (Debug runtime) True *empty* False True True (Debug runtime) True *empty* False False True (Debug runtime) False - - - False (Release runtime) *empty* *any* *empty* False True (Debug runtime) In this scenario, `$(DebugSymols)` and `$(EmbedAssembliesIntoApk)` are both empty. As a result `$(EmbedAssembliesIntoApk)` gets a default value of 'False'. But because `$(DebugSymols)` is empty we fall through the MSBuild case statement and end up with `$(AndroidIncludeDebugSymbols)` = `True`. Which is NOT what we want in this case. So if `$(EmbedAssembliesIntoApk)` we should always default `$(AndroidIncludeDebugSymbols)` to false. In addition there was a weird issue with the way we install debug apps. If the app is using the Shared Runtime the deployment process sends a broadcast to the Shared Runtime app which returns the external storage directory. This tends to be something like /mnt/shell/emulated/0/ So when we deploy our debug assemblies we do so to a directory like /mnt/shell/emulated/0/Android/data/$(PackageName)/files/.__override__ This works as expected. Now if we try to debug an app without using the Shared Runtime it will work as expected.. unless the Shared Runtime was not installed. In this case the broadcast fails and we fall back to getting the external storage using adb shell echo -b ${EXTERNAL_STORAGE} This returns /mnt/shell/emulated/legacy so we end up deploying the debug assemblies to /mnt/shell/emulated/legacy/Android/data/$(PackageName)/files/.__override__ So all is well and good. However problems start in our runtime and the MonoPackageManager. We use android.os.Environment.getExternalStorageDirectory (); to get the external storage directory. In this case it ALWAYS returns /mnt/shell/emulated/0/ So if we are debugging without the Shared Runtime being installed, we will NEVER find the fast deployed assebmies. So the app will crash. The fix in this case is to check both directories when we are running the debug runtime.
…otnet#764) Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=58865 Consider a project with an `App.csproj` and a referenced `Lib.csproj`. Not all changes to C# sources within `Lib.csproj` should require rebuilding and redeploying the `.apk` when Fast Deployment is enabled; only those that result in changes to Java Callable Wrappers should require rebuilding and redeploying the `.apk`. Unfortunately, that wasn't the case: *any* change to `Lib.csproj` would result rebuilding and redeploying the `.apk`, because `AndroidManifest.xml` was constantly being modified, which would cause the `_CompileToDalvikWithDx` target to be invoked, resulting in a `.apk` rebuild + redeploy. The item <meta-data android:name="android.support.VERSION" android:value="25.4.0" /> was constantly being duplicated in the manifest. As a result it was always newer and was triggering a change of build targets. So we need to double check we are NOT adding 100% duplicate values to the manifest.
…tnet#757) Context: https://bugzilla.xamarin.com/show_bug.cgi?id=58682 Seeing a new seemingly DesignTimeBuild-related build failure when invoking the `Rebuild` msbuild target. The `$(DesignTimeBuild)` value was empty when running under mac. This cuases the error error MSB4044: The "GetAdditionalResourcesFromAssemblies" task was not given a value for the required parameter "DesignTimeBuild". So we need to make sure that the value is set before we get to `GetAdditionalResourcesFromAssemblies`. The reason we got the error is before we used `$(DesignTimeBuild)` only in conditionals. However when moving to use it as a property of a task it cannot be empty. So we need to make sure we call `_SetupDesignTimeBuildForBuild` early in the build process.
This patchset contains a known API break! It breaks the Android Designer and Forms Previewer. |
oops... @alanmcgovern is there a bug we can track? |
jonpryor
added a commit
to jonpryor/xamarin-android
that referenced
this pull request
May 20, 2021
Fixes: dotnet/java-interop#835 Fixes: dotnet#5921 Context: dotnet#5894 Changes: http://github.com/xamarin/Java.Interop/compare/12e670a8560f69581d3a3adf0a9d91e8ce8c9afa...2573dc8c84fd4eb68e75bcae73912c26f4942356 * dotnet/java-interop@2573dc8c: [Java.Interop.Tools.*] IMetadataResolver not TypeDefinitionCache (dotnet#842) * dotnet/java-interop@412e974b: Revert "[generator] Disable [SupportedOSPlatform] until .NET 5/6. (dotnet#781)" (dotnet#841) * dotnet/java-interop@23baf0bc: [Java.Interop] Fix NRT warnings introduced by targeting 'net6.0' (dotnet#840) * dotnet/java-interop@131c1496: [generator] Fix NRE from return type not consistently set (dotnet#834) * dotnet/java-interop@100fffc1: [generator] Ensure "global::" is prepended to generic return casts. (dotnet#838) * dotnet/java-interop@9b89e90e: [generator] Ignore types without names (dotnet#837) * dotnet/java-interop@0e01fb5d: [Java.Interop.Tools.JavaSource] Merge @return block values (dotnet#836)
jonpryor
added a commit
to jonpryor/xamarin-android
that referenced
this pull request
May 20, 2021
Fixes: dotnet/java-interop#835 Fixes: dotnet#5921 Context: dotnet#5894 Changes: http://github.com/xamarin/Java.Interop/compare/12e670a8560f69581d3a3adf0a9d91e8ce8c9afa...2573dc8c84fd4eb68e75bcae73912c26f4942356 * dotnet/java-interop@2573dc8c: [Java.Interop.Tools.*] IMetadataResolver not TypeDefinitionCache (dotnet#842) * dotnet/java-interop@412e974b: Revert "[generator] Disable [SupportedOSPlatform] until .NET 5/6. (dotnet#781)" (dotnet#841) * dotnet/java-interop@23baf0bc: [Java.Interop] Fix NRT warnings introduced by targeting 'net6.0' (dotnet#840) * dotnet/java-interop@131c1496: [generator] Fix NRE from return type not consistently set (dotnet#834) * dotnet/java-interop@100fffc1: [generator] Ensure "global::" is prepended to generic return casts. (dotnet#838) * dotnet/java-interop@9b89e90e: [generator] Ignore types without names (dotnet#837) * dotnet/java-interop@0e01fb5d: [Java.Interop.Tools.JavaSource] Merge @return block values (dotnet#836)
jonpryor
added a commit
to jonpryor/xamarin-android
that referenced
this pull request
May 21, 2021
Fixes: dotnet/java-interop#835 Fixes: dotnet#5921 Context: dotnet#5894 Changes: http://github.com/xamarin/Java.Interop/compare/12e670a8560f69581d3a3adf0a9d91e8ce8c9afa...a5ed8919fb2ec894cb8144e51ae7c29b4811ee2a * dotnet/java-interop@a5ed8919: [Java.Interop.Tools.Cecil] Fix the xamarin-android build * dotnet/java-interop@2573dc8c: [Java.Interop.Tools.*] IMetadataResolver not TypeDefinitionCache (dotnet#842) * dotnet/java-interop@412e974b: Revert "[generator] Disable [SupportedOSPlatform] until .NET 5/6. (dotnet#781)" (dotnet#841) * dotnet/java-interop@23baf0bc: [Java.Interop] Fix NRT warnings introduced by targeting 'net6.0' (dotnet#840) * dotnet/java-interop@131c1496: [generator] Fix NRE from return type not consistently set (dotnet#834) * dotnet/java-interop@100fffc1: [generator] Ensure "global::" is prepended to generic return casts. (dotnet#838) * dotnet/java-interop@9b89e90e: [generator] Ignore types without names (dotnet#837) * dotnet/java-interop@0e01fb5d: [Java.Interop.Tools.JavaSource] Merge @return block values (dotnet#836)
jonpryor
added a commit
that referenced
this pull request
May 23, 2021
Fixes: dotnet/java-interop#835 Fixes: #5921 Context: #5894 Changes: http://github.com/xamarin/Java.Interop/compare/12e670a8560f69581d3a3adf0a9d91e8ce8c9afa...a5ed8919fb2ec894cb8144e51ae7c29b4811ee2a * dotnet/java-interop@a5ed8919: [Java.Interop.Tools.Cecil] Fix the xamarin-android build * dotnet/java-interop@2573dc8c: [Java.Interop.Tools.*] IMetadataResolver not TypeDefinitionCache (#842) * dotnet/java-interop@412e974b: Revert "[generator] Disable [SupportedOSPlatform] until .NET 5/6. (#781)" (#841) * dotnet/java-interop@23baf0bc: [Java.Interop] Fix NRT warnings introduced by targeting 'net6.0' (#840) * dotnet/java-interop@131c1496: [generator] Fix NRE from return type not consistently set (#834) * dotnet/java-interop@100fffc1: [generator] Ensure "global::" is prepended to generic return casts. (#838) * dotnet/java-interop@9b89e90e: [generator] Ignore types without names (#837) * dotnet/java-interop@0e01fb5d: [Java.Interop.Tools.JavaSource] Merge @return block values (#836)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=58580
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=58865
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=58682