{"push_id":2796062769,"size":7,"distinct_size":4,"ref":"refs/heads/Issue1768","head":"16281fb571c799be26bec23d9eec0e5d6da28582","before":"1490c8ff0c311a0dcd6bd517e88b9cc5eb3a8206","commits":[{"sha":"2921f9a4b81a9d70e16772a0c0311452237dbd7b","author":{"name":"Jonathan Peppers","email":"bada9c05996b779e3b1d99a9591d4bfcbe6ff4f4@gmail.com"},"message":"[Xamarin.Android.Build.Tasks] 3 tales of #deletebinobj (#2057)\n\nI got report from a customer (over email) of an error such as:\r\n\r\n\tJava.Lang.ClassNotFoundException: Didn't find class \"com.google.android.gms.R$string\" on path: DexPathList\r\n\r\nThe build log showed the app was using a combination of Firebase with\r\nMultiDex enabled, so I tried the Firebase sample from the docs team:\r\n\r\n\thttps://github.com/xamarin/monodroid-samples/tree/master/Firebase/FCMNotifications\r\n\r\nThings appeared to work fine, but something seemed strange: my\r\n\"spider sense\" was going off.  My initial thought was that the\r\ncustomer recently enabled MultiDex, and toggling MultiDex on/off was\r\nbreaking the build.\r\n\r\nOh, it was much worse than that.\r\n\r\nI wrote a simple test with the following scenario:\r\n\r\n 1. Build an app that *requires* MultiDex, w/ many methods\r\n 2. Check we have `classes.dex`, `classes2.dex`, `classes3.dex`\r\n 3. Remove the Java code with all the methods, so MultiDex is no longer required\r\n 4. Build again\r\n 5. We should *only* have `classes.dex`\r\n\r\nHere I found problem No. 1:\r\n\r\n    <Delete Files=\"$(IntermediateOutputPath)android\\bin\\classes\\*.dex\" />\r\n\r\nNot only is this the *wrong directory* -- which should be\r\n`$(IntermediateOutputPath)android\\bin\\*.dex` -- but this is also an\r\nincorrect use of the `<Delete/>` task!  Using wildcards like this\r\nrequires use of an `<ItemGroup/>` to \"gather\" the paths.\r\n\r\nI added an `<ItemGroup/>` and moved on:\r\n\r\n\t<ItemGroup>\r\n\t  <_DexesToDelete Include=\"$(IntermediateOutputPath)android\\bin\\*.dex\" />\r\n\t</ItemGroup>\r\n\t<Delete Files=\"@(_DexesToDelete)\" />\r\n\r\nThen I found problem No. 2: After it was now properly deleting the\r\n`.dex` files, `classes2.dex` and `classes3.dex` were still recreated!\r\n\r\nLooking into `obj\\Debug\\android\\bin\\classes`, I saw e.g.\r\n`ManyMethods.class` and `ManyMethods2.class`, which should *not*\r\nexist, as step (3) removed them!\r\n\r\nNothing deletes old `*.classes` files!  (I guess they are just left\r\naround?)  `javac` happily overwrites existing `class` files as needed?\r\n\r\nSo I added a call to remove the `classes` directory before `<Javac/>`:\r\n\r\n    <RemoveDir Directories=\"$(IntermediateOutputPath)android\\bin\\classes\" />\r\n\r\nThen I found problem No 3: when inspecting `obj`, I noticed\r\n`obj\\Debug\\android\\bin\\classes.zip` still contained the types\r\n`ManyMethods.class` and `ManyMethods2.class`, even though they were\r\ndeleted...\r\n\r\nIt looked like the `<Javac/>` task was *appending* to the zip file!\r\n\r\nI added a final `<Delete/>` to remove `classes.zip`:\r\n\r\n    <Delete Files=\"$(IntermediateOutputPath)android\\bin\\classes.zip\" />\r\n\r\nAnd my test now passes.\r\n\r\nHow did this ever work?!","distinct":false,"url":"https://api.github.com/repos/dellis1972/xamarin-android/commits/2921f9a4b81a9d70e16772a0c0311452237dbd7b"},{"sha":"8905dfa4bb8b3e736e3b1ce256e60b18d1674121","author":{"name":"Jonathan Peppers","email":"bada9c05996b779e3b1d99a9591d4bfcbe6ff4f4@gmail.com"},"message":"[Xamarin.Android.Build.Tasks] fix for parallel builds (#2051)\n\nContext: https://github.com/xamarin/xamarin-android/issues/2043\r\n\r\nWhen parallel builds occur, `obj/Debug/lp` can get broken:\r\n\r\n\tResources/layout/abc_action_menu_layout.xml warning XA1001:\r\n\tAndroidResgen: Warning while updating Resource XML '/var/folders/nx/rzr6lcqj6j3_vp7vtp28v2cw0000gn/T/tmp6bafd8e4.tmp': Root element is missing.\r\n\r\nThen later, `<Aapt/>` fails on the empty file:\r\n\r\n\tobj/Debug/lp/11/jl/res/layout/abc_action_menu_layout.xml(2,0): error APT0000: Error parsing XML: no element found\r\n\r\nIt appears that the `<ConvertResourcesCases/>` task still copies the\r\nfile, even if `AndroidResource.UpdateXmlResource()` fails.\r\nSubsequent builds will continue to fail, because an empty file has\r\nbeen copied with a newer timestamp.  Once in this state, developers\r\nwould have to `Rebuild` the project or delete the `obj` directory.\r\n\r\nThe fix here is to:\r\n\r\n 1. Return a `bool` indicating whether or not\r\n    `AndroidResource.UpdateXmlResource()` succeeds.\r\n 2. Don't write the final file if\r\n    `AndroidResource.UpdateXmlResource()` fails.\r\n\r\nThis change doesn't fully fix #2043, as I think Visual Studio for Mac\r\nshould prevent builds from happening in parallel.  I tried the change\r\nin the IDE once, and it worked.  However, I feel like if I repeated\r\nthe steps 10 times in a row, something would eventually go wrong.\r\n\r\nThis change *does*, however, fix the issue for the user so that a\r\n**Rebuild** is not required.\r\n\r\nOther changes:\r\n\r\n  - The original temp file can use `File.Copy()` since it is empty\r\n  - We can use the `?.` operator for invoking `logMessage`","distinct":false,"url":"https://api.github.com/repos/dellis1972/xamarin-android/commits/8905dfa4bb8b3e736e3b1ce256e60b18d1674121"},{"sha":"c3ccb955d30a87702560244a285db246afea20e0","author":{"name":"Dean Ellis","email":"049ca2a632b02fd8d7fb6fd36ea8779ff1a63a3d@googlemail.com"},"message":"[Xamarin.Android.Build.Tasks] Process 'raw' items from R.txt (#2045)\n\nOur `ManagedResourceParser` was not processing `raw` items when\r\nprocessing an `R.txt` file.  As a result you'd get this error:\r\n\r\n\tResource' does not contain a definition for 'Raw'\r\n\r\nEnsure we process `raw` resources.","distinct":false,"url":"https://api.github.com/repos/dellis1972/xamarin-android/commits/c3ccb955d30a87702560244a285db246afea20e0"},{"sha":"e13bf40a41c2a73b2e49d9b56cc3bff476345c5e","author":{"name":"Dean Ellis","email":"049ca2a632b02fd8d7fb6fd36ea8779ff1a63a3d@googlemail.com"},"message":"[Xamarin.Android.Build.Tasks] Warnings and errors for compileSdkVersion, targetSdkVersion, and minSdkVersion\n\nContext https://github.com/xamarin/xamarin-android/issues/1768\n\nGoogle has the following guidance for these three values:\n\n> minSdkVersion (lowest possible) <= targetSdkVersion == compileSdkVersion (latest SDK)\n\nThis commit adds a new Task `CheckGoogleSdkRequirements` which is responsible for checking\nthese values. It will be enabled by default but the task can be disabled via the\n`AndroidEnableGooglePlayStoreChecks` property.","distinct":true,"url":"https://api.github.com/repos/dellis1972/xamarin-android/commits/e13bf40a41c2a73b2e49d9b56cc3bff476345c5e"},{"sha":"dcf39fa53f0ce04a977d35b090314143260df072","author":{"name":"Dean Ellis","email":"049ca2a632b02fd8d7fb6fd36ea8779ff1a63a3d@googlemail.com"},"message":"Fixed Compile Error","distinct":true,"url":"https://api.github.com/repos/dellis1972/xamarin-android/commits/dcf39fa53f0ce04a977d35b090314143260df072"},{"sha":"3d2314884b775a6824a9911ef48e04412c614259","author":{"name":"Dean Ellis","email":"049ca2a632b02fd8d7fb6fd36ea8779ff1a63a3d@googlemail.com"},"message":"Reworked the messages","distinct":true,"url":"https://api.github.com/repos/dellis1972/xamarin-android/commits/3d2314884b775a6824a9911ef48e04412c614259"},{"sha":"16281fb571c799be26bec23d9eec0e5d6da28582","author":{"name":"Dean Ellis","email":"049ca2a632b02fd8d7fb6fd36ea8779ff1a63a3d@googlemail.com"},"message":"Updated Docs","distinct":true,"url":"https://api.github.com/repos/dellis1972/xamarin-android/commits/16281fb571c799be26bec23d9eec0e5d6da28582"}]}
{"actor":{"display_login":"dellis1972"}}