[ 
https://issues.apache.org/jira/browse/AVRO-2863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17403043#comment-17403043
 ] 

Ryan Skraba commented on AVRO-2863:
-----------------------------------

Thanks so much for all of this information -- how does this sound for a first 
strategy?

For 1.11.0:

# We'll target API 24 
# Create an {{avro-android-1.11.0.jar}} artifact that is a shaded version of 
Avro core removing the reflect package.  We might need to rewrite some parts of 
Avro core to be compatible with both Android and and non-Android (We lived 
without Thread.withInitial before, we can probably work around it for now).  
# We'll manually test the artifact today, using your helpful test project and 
hopefully someone will step in and check a release candidate on some actual 
devices!
# We'll carefully document the changes we made and call this 1.11.0 release 
"Experimental support for Android".

In the near future:

# Restore the missing functionality such as reflection (if it's even in demand 
in the Android platform).  I'm not sure if there's much demand for avro-ipc for 
example, but we should look into the other artifacts.
# Integrate the checks and build into the release process and CI on github to 
make sure we remain compatible.

It's a pretty big learning curve for me.  Does this plausible and doable?  
Would it be useful to have an artifact that only works with generic and 
specific/generated records, without reflection?

> 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
>            Priority: Major
>             Fix For: 1.11.0
>
>
> 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)

Reply via email to