-
Notifications
You must be signed in to change notification settings - Fork 564
[Xamarin.Android.Build.Tasks] fix classes-zip inception #1142
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
Conversation
|
cc @JonDouglas |
|
@jonathanpeppers now that I think about this.. are we doing to hit an incremental clean issue here? Also does the Clean target remove the classes.zip from the new location? |
Thought about it.. changes might be needed.
|
The test I added is looking at the contents of the zip file, so it isn’t getting deleted.... But I didn’t check for anything explicitly keeping it, is there a wildcard that keeps everything under the |
|
@jonathanpeppers I think the test should also do a build with No changes.. that is usually when the IncrementalClean hits us. We should also add a call to the Clean at the end and make sure the classes.zip is removed. I think we remove the entire |
|
Is this issue also affecting the release build process for the archive manager? |
|
@erdmenchen asked:
I do not understand the question. What archive manager? |
|
Since VS 15.5.2 with Xamarin.Android 8.1.0.25 I experience this issue for debug and release builds. Submitted builds to the Google Play Store via the Visual Studio Archive Manager have the same exception as mentioned in the bugzilla bugreport. So my question is: Does this fix also apply to the archive manager release build chain? |
I believe so, yes. |
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=61073 Context: a296784 When we added the new `classes.zip` functionality, there was one oddity present. On the first build, everything appears to be normal. On the second build, `classes.zip` appeared to contain itself inside itself??? To make things even stranger, I wrote a unit test that contains a `Java.Lang.Object` subclass in which its type and namespace names change on each write. This worked fine on macOS, even with the oddity of `classes.zip` continually zipping itself inside itself... The new java sources would appear at the bottom of the list within the zip file. Everything broke down when I tried my unit test on Windows, the case of `classes.zip` trying to compress itself inside itself was silently failing. It was not processing any further files after the failing zip entry, and so *in theory* this situation would cause many Java stubs to be missing from the zip. Solution? Let's just put `classes.zip` up one directory. So instead of: ``` obj/Debug/android/bin/classes/classes.zip ``` Move it to: ``` obj/Debug/android/bin/classes.zip ``` This prevents the `classes` directory from containing `classes.zip`, and our strange case of `classes.zip` inception. Merry Christmas! I'm going to go play Skylanders now.
a1ee986 to
44ae238
Compare
|
@dellis1972 a build with no changes and a clean both seemed to work (I only have my Mac ATM). I didn't see what is preventing I rebased against master and started a Windows build, so hopefully it works there, too. |
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=61073 Context: a296784 When we added the new `classes.zip` functionality, there was one oddity present. On the first build, everything appears to be normal. On the second build, `classes.zip` appeared to contain itself inside itself??? To make things even stranger, I wrote a unit test that contains a `Java.Lang.Object` subclass in which its type and namespace names change on each write. This worked fine on macOS, even with the oddity of `classes.zip` continually zipping itself inside itself... The new java sources would appear at the bottom of the list within the zip file. Everything broke down when I tried my unit test on Windows, the case of `classes.zip` trying to compress itself inside itself was silently failing. It was not processing any further files after the failing zip entry, and so *in theory* this situation would cause many Java stubs to be missing from the zip. Solution? Let's just put `classes.zip` up one directory. So instead of: ``` obj/Debug/android/bin/classes/classes.zip ``` Move it to: ``` obj/Debug/android/bin/classes.zip ``` This prevents the `classes` directory from containing `classes.zip`, and our strange case of `classes.zip` inception. Merry Christmas! I'm going to go play Skylanders now.
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=61073 Context: a296784 When we added the new `classes.zip` functionality, there was one oddity present. On the first build, everything appears to be normal. On the second build, `classes.zip` appeared to contain itself inside itself??? To make things even stranger, I wrote a unit test that contains a `Java.Lang.Object` subclass in which its type and namespace names change on each write. This worked fine on macOS, even with the oddity of `classes.zip` continually zipping itself inside itself... The new java sources would appear at the bottom of the list within the zip file. Everything broke down when I tried my unit test on Windows, the case of `classes.zip` trying to compress itself inside itself was silently failing. It was not processing any further files after the failing zip entry, and so *in theory* this situation would cause many Java stubs to be missing from the zip. Solution? Let's just put `classes.zip` up one directory. So instead of: ``` obj/Debug/android/bin/classes/classes.zip ``` Move it to: ``` obj/Debug/android/bin/classes.zip ``` This prevents the `classes` directory from containing `classes.zip`, and our strange case of `classes.zip` inception. Merry Christmas! I'm going to go play Skylanders now.
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=61073 Context: a296784 When we added the new `classes.zip` functionality, there was one oddity present. On the first build, everything appears to be normal. On the second build, `classes.zip` appeared to contain itself inside itself??? To make things even stranger, I wrote a unit test that contains a `Java.Lang.Object` subclass in which its type and namespace names change on each write. This worked fine on macOS, even with the oddity of `classes.zip` continually zipping itself inside itself... The new java sources would appear at the bottom of the list within the zip file. Everything broke down when I tried my unit test on Windows, the case of `classes.zip` trying to compress itself inside itself was silently failing. It was not processing any further files after the failing zip entry, and so *in theory* this situation would cause many Java stubs to be missing from the zip. Solution? Let's just put `classes.zip` up one directory. So instead of: ``` obj/Debug/android/bin/classes/classes.zip ``` Move it to: ``` obj/Debug/android/bin/classes.zip ``` This prevents the `classes` directory from containing `classes.zip`, and our strange case of `classes.zip` inception. Merry Christmas! I'm going to go play Skylanders now.
Context: #5331 Changes: xamarin/monodroid@0eef889...27736a7 * xamarin/monodroid@27736a7ff: [tools/msbuild] Fix App Bundle deployment (#1142) * xamarin/monodroid@f38dbc7ab: [tools/msbuild] use @(_AndroidMSBuildAllProjects) (#1140) * xamarin/monodroid@cfa21d57b: [tools/msbuild] Fix some issues with FastDev (#1139) * xamarin/monodroid@3ba648386: [tools/msbuild] Add missing parameter to BuildAppBundle. (#1138) * xamarin/monodroid@5bb29971b: [tools/msbuild] Add Multi User Support for Debugging. (#1135) * xamarin/monodroid@156abf47c: [tools/msbuild] default $(_AndroidAllowDeltaInstall) to false (#1137) * xamarin/monodroid@fbc961218: [build] Pass EnableCompression to BuildApk (#1094) Add support for running multi-user unit tests on device. It makes use of various adb commands to create test users and remove them. Create a guest user with name `{name}`: adb shell pm create-user --guest {name} Remove a guest user with the specified user id `{userId}`: adb shell pm remove-user --guest {userId} Note that user creation takes a "name", while deletion takes an id. To obtain the mapping, use: $ adb shell pm list users Users: UserInfo{0:Owner:c13} running UserInfo{10:guest1:414} The userId is the number *between* the `{` and the `:` and user name. The userId for `Owner` is 0, while the userId for `guest1` is 10. We can then use a `Regex` to pull out the required `userId` for a specific user. To switch a device to use user `{userId}`: adb shell am switch-user {userId} Emulators seem to create the main user with the name "Owner", so that should be the default name we use for the main user. In the unit tests if we cannot find a user named "Owner" when looking for "Owner" we will default to a `userId` of `0`. User ID 0 always means the default user. This is to handle the case where we are testing locally on devices where the main user is not called "Owner".
|
Hi everyone => so if some one can help me please |
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=61073
Context: a296784
When we added the new
classes.zipfunctionality, there was one odditypresent. On the first build, everything appears to be normal. On the
second build,
classes.zipappeared to contain itself inside itself???To make things even stranger, I wrote a unit test that contains a
Java.Lang.Objectsubclass in which its type and namespace names changeon each write. This worked fine on macOS, even with the oddity of
classes.zipcontinually zipping itself inside itself... The new javasources would appear at the bottom of the list within the zip file.
Everything broke down when I tried my unit test on Windows, the case of
classes.ziptrying to compress itself inside itself was silentlyfailing. It was not processing any further files after the failing zip
entry, and so in theory this situation would cause many Java stubs to
be missing from the zip.
Solution? Let's just put
classes.zipup one directory.So instead of:
Move it to:
This prevents the
classesdirectory from containingclasses.zip, andour strange case of
classes.zipinception.Merry Christmas! I'm going to go play Skylanders now.