Hi,

 

Lucene has no official Android support. Lucene 4.7 is the last version that 
(may) work with Android, because it is limited to Java 6, which is mostly 
supported by Android. Java 7 is only partially supported.

 

Later Lucene versions (4.8+ requires minimum Java 7) uses many of the new Java 
language and API features in its core APIs (this is what you see with 
MethodHandles), which is very important for performance and security reasons. 
In addition, Lucene 5.x makes more heavy use of Java 7, because all I/O APIs 
were changed to use NIO.2 (java.io.File is gone). This is for safety on index 
commits.

 

Since Lucene 6 we require Java 8 as minimum version (Lambdas,…).

 

There are no plans to support older Java versions anymore, so unless Android is 
*fully* Java 7 compatible (including MethodHandles APIs), you are stuck with 
4.7.x. The main branch is Java 8, so it is impossible to support Android.

 

Please ask Google to finally fix Android to be compatible to Java SE. Please 
note, Apache Lucene Core is using “compact1” profile, so if Android supports 
Java 8, Lambdas, and all APIs from the “compact1” profile (which is intended 
for mobile devices), you can use the core JAR file.

 

Uwe

 

-----

Uwe Schindler

Achterdiek 19, D-28357 Bremen

http://www.thetaphi.de <http://www.thetaphi.de/> 

eMail: u...@thetaphi.de

 

From: xufusheng [mailto:xufush...@huawei.com] 
Sent: Wednesday, January 18, 2017 10:02 AM
To: dev@lucene.apache.org
Cc: Lipeng (Honor) <lane...@huawei.com>; xueyakun <xueya...@huawei.com>; 
Lixiang (Tony) <tony.lixi...@huawei.com>
Subject: is there a Lucene that can be used on Android devices

 

Hi Lucene dev team,

I am a Android software engineer from Huawei Device Company, and have some 
Android compatible issues wandering if you can help to clarify.

 

Our latest smart phone MATE9 use Lucene as the search engine for local 
information, such as message in Email, SMS, Calendar and so on.

But the Lucene jar version is very old (4.5.0), because if use newer version, 
APK will crash with the following information:

java.lang.NoClassDefFoundError: Failed resolution of: 
Ljava/lang/invoke/MethodHandles;

We found that the JDK in Android is slightly different with desktop version 
which Lucene build upon.

 

So, we would like to know:

Is there any plan that Lucene team will develop a “Lite”version that could run 
on a mobile device,

or fix the crash issues which will enable the current version compatible with 
Android platform.

Also, if we fix the Android compatible issues, is it possible for us to submit 
changes into the main branch?

 

Best Regards,

Fusheng Xu from Huawei.

 

Reply via email to