[ https://issues.apache.org/jira/browse/AVRO-2863?focusedWorklogId=657432&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-657432 ]
ASF GitHub Bot logged work on AVRO-2863: ---------------------------------------- Author: ASF GitHub Bot Created on: 29/Sep/21 17:43 Start Date: 29/Sep/21 17:43 Worklog Time Spent: 10m Work Description: RyanSkraba opened a new pull request #1347: URL: https://github.com/apache/avro/pull/1347 Following the discussion on AVRO-2863, this PR shows how to create an `avro-android` artifact for experimental support of android for the next major release. * the `org.apache.avro.reflect package` is not supported. * `org.apache.avro.reflect.MapEntry` was deprecated in the `reflect` package and moved to `org.apache.avro.util`. (Note, the important thing about this class is that it is reliably available and the internal data members are "key" and "value"). * All uses of `ClassValue`, which cache information extracted from a `java.lang.Class` were wrapped in a `org.apache.avro.util.ClassValueCache` so that the android implementation could override its behaviour. I haven't finished the `ThreadLocal.withInitial` wrapping -- I wanted to validate this approach first. This implementation currently works with the [android test project](https://github.com/david-gang/avro-android-compatibility) provided by @david-gang, which doesn't call any of the core code that touches `ThreadLocal.withInitial`. For now, Android compatibility needs to be checked manually with a sample application, either on an emulator or a real device. ### Jira - [X] My PR addresses the following [Avro Jira](https://issues.apache.org/jira/browse/AVRO/) issues and references them in the PR title. For example, "AVRO-1234: My Avro PR" - https://issues.apache.org/jira/browse/AVRO-2863 - In case you are adding a dependency, check if the license complies with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x). ### Tests - [X] My PR adds the following unit tests __OR__ does not need testing for this extremely good reason: Tests around the wrapper class `ClassValueCache`. ### Commits - [X] My commits all reference Jira issues in their subject lines. In addition, my commits follow the guidelines from "[How to write a good git commit message](https://chris.beams.io/posts/git-commit/)": 1. Subject is separated from body by a blank line 1. Subject is limited to 50 characters (not including Jira issue reference) 1. Subject does not end with a period 1. Subject uses the imperative mood ("add", not "adding") 1. Body wraps at 72 characters 1. Body explains "what" and "why", not "how" ### Documentation - [X] In case of new functionality, my PR adds documentation that describes how to use it. - All the public functions and the classes in the PR contain Javadoc that explain what it does -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@avro.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 657432) Remaining Estimate: 0h Time Spent: 10m > Avro 1.9.2 Java library does not work on Android > ------------------------------------------------ > > Key: AVRO-2863 > URL: https://issues.apache.org/jira/browse/AVRO-2863 > Project: Apache Avro > Issue Type: Wish > Components: java > Affects Versions: 1.9.0, 1.9.1, 1.9.2 > Environment: Android 5.0.2 (API 21) up to the latest Android version, > using Android Gradle plugin version 4.0.0. > Reporter: Joris Borgdorff > Assignee: Ryan Skraba > Priority: Major > Fix For: 1.11.0 > > Time Spent: 10m > Remaining Estimate: 0h > > One of our Android apps uses Avro to communicate with the server. Up to > vision 1.8.2, it used a subset of the Avro library that was needed to perform > this communication. It does not use any of the compress codecs and keeps the > use of reflection to a minimum. Since Avro 1.9.0 a few blocking > incompatibilities have been introduced. This prevents us from using any of > the developments in Avro version 1.9.x, including the updated Jackson > dependency. > org.apache.avro.Schema uses ThreadLocal.withInitial, only available with > Android API 26 (Android 8.0) > org.apache.avro.reflect.ReflectUtils uses Method.invokeExact, not available > on Android > org.apache.avro.reflect.ReflectData uses java.lang.ClassValue, not available > on Android > I've experimented with excluding the org.apache.avro.reflect from the > distribution (except MapEntry, which is used elsewhere) and providing my own > java.lang.ClassValue implementation. This resolves all build and runtime > issues for Android API 26 and above except for ThreadLocal.withInitial, which > cannot be circumvented. > For now the Android app will keep using 1.8.2, but we would prefer to use > 1.9.2 or later. -- This message was sent by Atlassian Jira (v8.3.4#803005)