Can I use Apache-Flink for Android API-Level < 26?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Can I use Apache-Flink for Android API-Level < 26?

Alexander Borgschulze
I am trying to use Apache-Flink in my Android-Project with "minSdkVersion 24".
Unfortunately, the following code causes an error:
   
 
    val env: StreamExecutionEnvironment = LocalStreamEnvironment.getExecutionEnvironment()
    env.streamTimeCharacteristic = TimeCharacteristic.ProcessingTime
    val integerStream: DataStream<Int> = env.fromCollection(mutableListOf(1,2,3,4,5))
    
    integerStream.print()
    env.execute()

 
java.lang.NoClassDefFoundError: Failed resolution of: Ljava/time/Instant;
        at org.apache.flink.api.common.typeinfo.BasicTypeInfo.<clinit>(BasicTypeInfo.java:89)
        at org.apache.flink.api.common.typeinfo.BasicTypeInfo.getInfoFor(BasicTypeInfo.java:214)
        at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForClass(TypeExtractor.java:1705)
        at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForClass(TypeExtractor.java:1643)
        at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForObject(TypeExtractor.java:2038)
        at org.apache.flink.api.java.typeutils.TypeExtractor.getForObject(TypeExtractor.java:1983)
        at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.fromCollection(StreamExecutionEnvironment.java:782)
 
 
 
The java.time API was introduced in API Level 26. So is it impossible to run Flink on older Android-Verions?
Reply | Threaded
Open this post in threaded view
|

Re: Can I use Apache-Flink for Android API-Level < 26?

Chesnay Schepler

I agree with your conclusion that you cannot use Flink on an API Level below 26.

I do not know whether it will work even with Level 26 though, as I'm not aware of anyone having tried it.

On 14/04/2020 11:03, Alexander Borgschulze wrote:
I am trying to use Apache-Flink in my Android-Project with "minSdkVersion 24".
Unfortunately, the following code causes an error:
   
 
    val env: StreamExecutionEnvironment = LocalStreamEnvironment.getExecutionEnvironment()
    env.streamTimeCharacteristic = TimeCharacteristic.ProcessingTime
    val integerStream: DataStream<Int> = env.fromCollection(mutableListOf(1,2,3,4,5))
    
    integerStream.print()
    env.execute()

 
java.lang.NoClassDefFoundError: Failed resolution of: Ljava/time/Instant;
        at org.apache.flink.api.common.typeinfo.BasicTypeInfo.<clinit>(BasicTypeInfo.java:89)
        at org.apache.flink.api.common.typeinfo.BasicTypeInfo.getInfoFor(BasicTypeInfo.java:214)
        at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForClass(TypeExtractor.java:1705)
        at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForClass(TypeExtractor.java:1643)
        at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForObject(TypeExtractor.java:2038)
        at org.apache.flink.api.java.typeutils.TypeExtractor.getForObject(TypeExtractor.java:1983)
        at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.fromCollection(StreamExecutionEnvironment.java:782)
 
 
 
The java.time API was introduced in API Level 26. So is it impossible to run Flink on older Android-Verions?