-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Android ecosytem updates #15399
Android ecosytem updates #15399
Conversation
|
@@ -54,11 +54,11 @@ | |||
<_MicrosoftWebWebView2Version>1.0.1774.30</_MicrosoftWebWebView2Version> | |||
<!-- GLIDE - the android maven artifact in /src/Core/AndroidNative/maui/build.gradle --> | |||
<!-- must be kept in sync with the binding library version to it here: --> | |||
<_XamarinAndroidGlideVersion>4.14.2.1</_XamarinAndroidGlideVersion> | |||
<_XamarinAndroidGlideVersion>4.15.1.1</_XamarinAndroidGlideVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to update the maven also
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
found it.
I am going to hit the sack soon.
OK. Found it. Didn't know there are also |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
downgraded gradle plugin needs update |
investigating gradle error:
|
gradle
|
solved (locally) by adding quick-n-dirty solution:
But (always this but) there are few lint errors that might be needed to be addressed (cleaned up a bit):
|
regarding lint errors:
Maybe this would apply to native code too? |
stuck at (investigating):
|
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
Last errors about binary something kill me if I understand |
please help
I have only 3 kids not 8
|
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
still
|
The first error is:
Is there any major changes to |
@rmarinho the underlying cause here is the timmer/linker is disabled in this project: maui/src/Compatibility/ControlGallery/src/Android/Compatibility.ControlGallery.Android.csproj Line 12 in 15b10a2
I wouldn't recommend turning this off, as you probably want to be testing trimmed projects. I can reproduce the issue in a test, but it may not be solved in the next .NET 8 Preview as there is an easy workaround. |
…Rewriter Context: dotnet/maui#15399 (comment) During a PR updating AndroidX dependencies in .NET MAUI, we got the error: Task GenerateJavaStubs ... System.IO.IOException: The process cannot access the file 'D:\a\_work\1\s\src\Compatibility\ControlGallery\src\Android\obj\Release\net8.0-android\android\assets\Xamarin.AndroidX.CustomView.pdb' because it is being used by another process. at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite) at Xamarin.Android.Tasks.MarshalMethodsAssemblyRewriter.Rewrite(DirectoryAssemblyResolver resolver, List`1 targetAssemblyPaths, Boolean brokenExceptionTransitions) at Xamarin.Android.Tasks.GenerateJavaStubs.Run(DirectoryAssemblyResolver res, Boolean useMarshalMethods) at Xamarin.Android.Tasks.GenerateJavaStubs.RunTask() at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25 Which has some very odd logging right before the failure: Copying rewritten assembly: obj\Release\net8.0-android\android\assets\Xamarin.AndroidX.CustomView.PoolingContainer.dll.new -> obj\Release\net8.0-android\android\assets\Xamarin.AndroidX.CustomView.PoolingContainer.dll Copying rewritten assembly: obj\Release\net8.0-android\android\assets\Xamarin.AndroidX.CustomView.PoolingContainer.pdb -> obj\Release\net8.0-android\android\assets\Xamarin.AndroidX.CustomView.pdb Copying `Xamarin.AndroidX.CustomView.PoolingContainer.pdb` to `Xamarin.AndroidX.CustomView.pdb`? I could reproduce the issue in a test with `PublishTrimmed=false`: [Test] public void SimilarAndroidXAssemblyNames ([Values(true, false)] bool publishTrimmed) { var proj = new XamarinAndroidApplicationProject { IsRelease = true, AotAssemblies = publishTrimmed, PackageReferences = { new Package { Id = "Xamarin.AndroidX.CustomView", Version = "1.1.0.17" }, new Package { Id = "Xamarin.AndroidX.CustomView.PoolingContainer", Version = "1.0.0.4" }, } }; proj.SetProperty (KnownProperties.PublishTrimmed, publishTrimmed.ToString()); proj.MainActivity = proj.DefaultMainActivity.Replace ("//${AFTER_ONCREATE}", "AndroidX.CustomView.PoolingContainer.PoolingContainer.IsPoolingContainer (null);"); using var builder = CreateApkBuilder (); Assert.IsTrue (builder.Build (proj), "Build should have succeeded."); } In `MarshalMethodsAssemblyRewriter` we write temporary assembly files to `foo.new` and copy to the original path at `foo.dll`. We next copy any symbol files if found. I found two underlying issues here. First, this `Mono.Cecil` API: AssemblyDefinition.Write("foo.new", new WriterParameters { WriteSymbols = true }); It would write a `foo.pdb` instead of `foo.new.pdb`, and so we have no way for this to write symbols to a temporary location. I put the temporary location in a `new` subdirectory instead of appending `.new` to the path. The second problem is this code: target = Path.ChangeExtension (Path.Combine (targetPath, Path.GetFileNameWithoutExtension (pdb)), ".pdb"); CopyFile (pdb, target); It appears to lose `.PoolingContainer` from the path, and so it uses the destination of: obj\Release\net8.0-android\android\assets\Xamarin.AndroidX.CustomView.pdb But using a `new` subdirectory instead, we bypass this issue. After these changes, we instead get: Copying rewritten assembly: obj\Release\android\assets\new\Xamarin.AndroidX.CustomView.PoolingContainer.dll -> obj\Release\android\assets\Xamarin.AndroidX.CustomView.PoolingContainer.dll Copying rewritten assembly: obj\Release\android\assets\new\Xamarin.AndroidX.CustomView.PoolingContainer.pdb -> obj\Release\android\assets\Xamarin.AndroidX.CustomView.PoolingContainer.pdb Deleting: obj\Release\android\assets\new\Xamarin.AndroidX.CustomView.PoolingContainer.dll Deleting: obj\Release\android\assets\new\Xamarin.AndroidX.CustomView.PoolingContainer.pdb Lastly, I removed `.mdb` file support -- but that is completely unrelated to the issue.
50cceaa
to
9d4be10
Compare
…#8151) Context: dotnet/maui#15399 (comment) During a PR updating AndroidX dependencies in .NET MAUI, we saw: Task GenerateJavaStubs … System.IO.IOException: The process cannot access the file 'D:\a\_work\1\s\src\Compatibility\ControlGallery\src\Android\obj\Release\net8.0-android\android\assets\Xamarin.AndroidX.CustomView.pdb' because it is being used by another process. at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite) at Xamarin.Android.Tasks.MarshalMethodsAssemblyRewriter.Rewrite(DirectoryAssemblyResolver resolver, List`1 targetAssemblyPaths, Boolean brokenExceptionTransitions) at Xamarin.Android.Tasks.GenerateJavaStubs.Run(DirectoryAssemblyResolver res, Boolean useMarshalMethods) at Xamarin.Android.Tasks.GenerateJavaStubs.RunTask() at Microsoft.Android.Build.Tasks.AndroidTask.Execute() Which has some very odd logging right before the failure: Copying rewritten assembly: obj\Release\net8.0-android\android\assets\Xamarin.AndroidX.CustomView.PoolingContainer.dll.new -> obj\Release\net8.0-android\android\assets\Xamarin.AndroidX.CustomView.PoolingContainer.dll Copying rewritten assembly: obj\Release\net8.0-android\android\assets\Xamarin.AndroidX.CustomView.PoolingContainer.pdb -> obj\Release\net8.0-android\android\assets\Xamarin.AndroidX.CustomView.pdb Copying `Xamarin.AndroidX.CustomView.PoolingContainer.pdb` to `Xamarin.AndroidX.CustomView.pdb`? Where is `.PoolingContainer`? I could reproduce the issue in a test with `$(PublishTrimmed)`=False: [Test] public void SimilarAndroidXAssemblyNames ([Values(true, false)] bool publishTrimmed) { var proj = new XamarinAndroidApplicationProject { IsRelease = true, AotAssemblies = publishTrimmed, PackageReferences = { new Package { Id = "Xamarin.AndroidX.CustomView", Version = "1.1.0.17" }, new Package { Id = "Xamarin.AndroidX.CustomView.PoolingContainer", Version = "1.0.0.4" }, } }; proj.SetProperty (KnownProperties.PublishTrimmed, publishTrimmed.ToString()); proj.MainActivity = proj.DefaultMainActivity.Replace ("//${AFTER_ONCREATE}", "AndroidX.CustomView.PoolingContainer.PoolingContainer.IsPoolingContainer (null);"); using var builder = CreateApkBuilder (); Assert.IsTrue (builder.Build (proj), "Build should have succeeded."); } In `MarshalMethodsAssemblyRewriter` we write temporary assembly files to `foo.new` and copy to the original path at `foo.dll`. We next copy any symbol files if found. I found two underlying issues here: First, this `Mono.Cecil` API: AssemblyDefinition.Write("foo.new", new WriterParameters { WriteSymbols = true, }); would write a `foo.pdb` instead of `foo.new.pdb`, and so we have no way for this to write symbols to a temporary location. I put the temporary location in a `new` subdirectory instead of appending `.new` to the path. The second problem is this code: target = Path.ChangeExtension (Path.Combine (targetPath, Path.GetFileNameWithoutExtension (pdb)), ".pdb"); CopyFile (pdb, target); It appears to lose `.PoolingContainer` from the path, and so it uses the destination of: obj\Release\net8.0-android\android\assets\Xamarin.AndroidX.CustomView.pdb By using a `new` subdirectory instead, we bypass this issue. After these changes, we instead get: Copying rewritten assembly: obj\Release\android\assets\new\Xamarin.AndroidX.CustomView.PoolingContainer.dll -> obj\Release\android\assets\Xamarin.AndroidX.CustomView.PoolingContainer.dll Copying rewritten assembly: obj\Release\android\assets\new\Xamarin.AndroidX.CustomView.PoolingContainer.pdb -> obj\Release\android\assets\Xamarin.AndroidX.CustomView.PoolingContainer.pdb Deleting: obj\Release\android\assets\new\Xamarin.AndroidX.CustomView.PoolingContainer.dll Deleting: obj\Release\android\assets\new\Xamarin.AndroidX.CustomView.PoolingContainer.pdb Lastly, I removed `.mdb` file support -- but that is completely unrelated to the issue.
…#8151) Context: dotnet/maui#15399 (comment) During a PR updating AndroidX dependencies in .NET MAUI, we saw: Task GenerateJavaStubs … System.IO.IOException: The process cannot access the file 'D:\a\_work\1\s\src\Compatibility\ControlGallery\src\Android\obj\Release\net8.0-android\android\assets\Xamarin.AndroidX.CustomView.pdb' because it is being used by another process. at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite) at Xamarin.Android.Tasks.MarshalMethodsAssemblyRewriter.Rewrite(DirectoryAssemblyResolver resolver, List`1 targetAssemblyPaths, Boolean brokenExceptionTransitions) at Xamarin.Android.Tasks.GenerateJavaStubs.Run(DirectoryAssemblyResolver res, Boolean useMarshalMethods) at Xamarin.Android.Tasks.GenerateJavaStubs.RunTask() at Microsoft.Android.Build.Tasks.AndroidTask.Execute() Which has some very odd logging right before the failure: Copying rewritten assembly: obj\Release\net8.0-android\android\assets\Xamarin.AndroidX.CustomView.PoolingContainer.dll.new -> obj\Release\net8.0-android\android\assets\Xamarin.AndroidX.CustomView.PoolingContainer.dll Copying rewritten assembly: obj\Release\net8.0-android\android\assets\Xamarin.AndroidX.CustomView.PoolingContainer.pdb -> obj\Release\net8.0-android\android\assets\Xamarin.AndroidX.CustomView.pdb Copying `Xamarin.AndroidX.CustomView.PoolingContainer.pdb` to `Xamarin.AndroidX.CustomView.pdb`? Where is `.PoolingContainer`? I could reproduce the issue in a test with `$(PublishTrimmed)`=False: [Test] public void SimilarAndroidXAssemblyNames ([Values(true, false)] bool publishTrimmed) { var proj = new XamarinAndroidApplicationProject { IsRelease = true, AotAssemblies = publishTrimmed, PackageReferences = { new Package { Id = "Xamarin.AndroidX.CustomView", Version = "1.1.0.17" }, new Package { Id = "Xamarin.AndroidX.CustomView.PoolingContainer", Version = "1.0.0.4" }, } }; proj.SetProperty (KnownProperties.PublishTrimmed, publishTrimmed.ToString()); proj.MainActivity = proj.DefaultMainActivity.Replace ("//${AFTER_ONCREATE}", "AndroidX.CustomView.PoolingContainer.PoolingContainer.IsPoolingContainer (null);"); using var builder = CreateApkBuilder (); Assert.IsTrue (builder.Build (proj), "Build should have succeeded."); } In `MarshalMethodsAssemblyRewriter` we write temporary assembly files to `foo.new` and copy to the original path at `foo.dll`. We next copy any symbol files if found. I found two underlying issues here: First, this `Mono.Cecil` API: AssemblyDefinition.Write("foo.new", new WriterParameters { WriteSymbols = true, }); would write a `foo.pdb` instead of `foo.new.pdb`, and so we have no way for this to write symbols to a temporary location. I put the temporary location in a `new` subdirectory instead of appending `.new` to the path. The second problem is this code: target = Path.ChangeExtension (Path.Combine (targetPath, Path.GetFileNameWithoutExtension (pdb)), ".pdb"); CopyFile (pdb, target); It appears to lose `.PoolingContainer` from the path, and so it uses the destination of: obj\Release\net8.0-android\android\assets\Xamarin.AndroidX.CustomView.pdb By using a `new` subdirectory instead, we bypass this issue. After these changes, we instead get: Copying rewritten assembly: obj\Release\android\assets\new\Xamarin.AndroidX.CustomView.PoolingContainer.dll -> obj\Release\android\assets\Xamarin.AndroidX.CustomView.PoolingContainer.dll Copying rewritten assembly: obj\Release\android\assets\new\Xamarin.AndroidX.CustomView.PoolingContainer.pdb -> obj\Release\android\assets\Xamarin.AndroidX.CustomView.PoolingContainer.pdb Deleting: obj\Release\android\assets\new\Xamarin.AndroidX.CustomView.PoolingContainer.dll Deleting: obj\Release\android\assets\new\Xamarin.AndroidX.CustomView.PoolingContainer.pdb Lastly, I removed `.mdb` file support -- but that is completely unrelated to the issue.
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
I think something got wrong with rebase or merge, I think these changes are coming from main and not net8. |
…ncies' of https://github.com/Forks4Work-Microsoft-Xamarin/maui into dev/moljac/net8-manual-updates-20230601-android-dependencies
…droid-dependencies
I noticed it last week when there were some issues with github. Not sure what happened. I cannot resolve these 3 issues either. |
Description of Change
net8
TFMeng/AndroidX.targets
eng/Versions.props
src/Core/AndroidNative/*
src/Compatibility/Maps/src/Android/Compatibility.Maps.Android.csproj
gradle