2016-09-25 2 views
0

Android Studio 2.1.2 프로젝트에 Lucene 6.2.0을 추가하는 데 문제가 있습니다. 그러나이 라이브러리를 IntelliJ IDEA에 추가하는 것은 문제가되지 않습니다. Lucene 파일을 내 libs 폴더에 복사 한 다음 here으로 표시된 jar 파일을 라이브러리로 추가하려고했습니다 (마우스 오른쪽 버튼 => 라이브러리로 추가). Build.gradle 잘보고 있었다 : Android Studio 프로젝트에 Lucene 추가

Information:Gradle tasks [:app:clean, :app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :app:assembleDebug] 
 
:app:clean 
 
:app:preBuild UP-TO-DATE 
 
:app:preDebugBuild UP-TO-DATE 
 
:app:checkDebugManifest 
 
:app:preReleaseBuild UP-TO-DATE 
 
:app:prepareComAndroidSupportAnimatedVectorDrawable2400Library 
 
:app:prepareComAndroidSupportAppcompatV72400Library 
 
:app:prepareComAndroidSupportCardviewV72340Library 
 
:app:prepareComAndroidSupportCustomtabs2340Library 
 
:app:prepareComAndroidSupportDesign2400Library 
 
:app:prepareComAndroidSupportRecyclerviewV72400Library 
 
:app:prepareComAndroidSupportSupportV42400Library 
 
:app:prepareComAndroidSupportSupportVectorDrawable2400Library 
 
:app:prepareComFacebookAndroidFacebookAndroidSdk4150Library 
 
:app:prepareDebugDependencies 
 
:app:compileDebugAidl 
 
:app:compileDebugRenderscript 
 
:app:generateDebugBuildConfig 
 
:app:mergeDebugShaders 
 
:app:compileDebugShaders 
 
:app:generateDebugAssets 
 
:app:mergeDebugAssets 
 
:app:generateDebugResValues UP-TO-DATE 
 
:app:generateDebugResources 
 
:app:mergeDebugResources 
 
:app:processDebugManifest 
 
:app:processDebugResources 
 
:app:generateDebugSources 
 
:app:mockableAndroidJar UP-TO-DATE 
 
:app:preDebugUnitTestBuild UP-TO-DATE 
 
:app:prepareDebugUnitTestDependencies 
 
:app:preDebugAndroidTestBuild UP-TO-DATE 
 
:app:prepareDebugAndroidTestDependencies 
 
:app:compileDebugAndroidTestAidl 
 
:app:processDebugAndroidTestManifest 
 
:app:compileDebugAndroidTestRenderscript 
 
:app:generateDebugAndroidTestBuildConfig 
 
:app:mergeDebugAndroidTestShaders 
 
:app:compileDebugAndroidTestShaders 
 
:app:generateDebugAndroidTestAssets 
 
:app:mergeDebugAndroidTestAssets 
 
:app:generateDebugAndroidTestResValues UP-TO-DATE 
 
:app:generateDebugAndroidTestResources 
 
:app:mergeDebugAndroidTestResources 
 
:app:processDebugAndroidTestResources 
 
:app:generateDebugAndroidTestSources 
 
:app:incrementalDebugJavaCompilationSafeguard 
 
:app:compileDebugJavaWithJavac 
 
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.). 
 
Note: C:\Users\Tomek\AndroidStudioProjects\UniversalSoundboard\app\src\main\java\com\tomaszstankowski\universalsoundboard\adapters\SoundListAdapter.java uses or overrides a deprecated API. 
 
Note: Recompile with -Xlint:deprecation for details. 
 
Note: C:\Users\Tomek\AndroidStudioProjects\UniversalSoundboard\app\src\main\java\com\tomaszstankowski\universalsoundboard\custom\singletons\SoundBank.java uses unchecked or unsafe operations. 
 
Note: Recompile with -Xlint:unchecked for details. 
 
:app:compileDebugNdk UP-TO-DATE 
 
:app:compileDebugSources 
 
:app:buildInfoDebugLoader 
 
:app:transformClassesWithExtractJarsForDebug 
 
:app:transformClassesWithInstantRunVerifierForDebug 
 
:app:transformClassesWithJavaResourcesVerifierForDebug 
 
:app:mergeDebugJniLibFolders 
 
:app:transformNative_libsWithMergeJniLibsForDebug 
 
:app:processDebugJavaRes UP-TO-DATE 
 
:app:transformResourcesWithMergeJavaResForDebug 
 
:app:transformResourcesAndNative_libsWithJavaResourcesVerifierForDebug 
 
:app:transformClassesWithInstantRunForDebug 
 
:app:transformClasses_enhancedWithInstant+reloadDexForDebug 
 
:app:incrementalDebugTasks 
 
:app:prePackageMarkerForDebug 
 
:app:fastDeployDebugExtractor 
 
:app:generateDebugInstantRunAppInfo 
 
:app:coldswapKickerDebug 
 
:app:transformClassesWithInstantRunSlicerForDebug 
 
:app:transformClassesWithDexForDebug 
 
To run dex in process, the Gradle daemon needs a larger heap. 
 
It currently has approximately 910 MB. 
 
For faster builds, increase the maximum heap size for the Gradle daemon to more than 2048 MB. 
 
To do this set org.gradle.jvmargs=-Xmx2048M in the project gradle.properties. 
 
For more information see https://docs.gradle.org/current/userguide/build_environment.html 
 
Error:PARSE ERROR: 
 
Error:unsupported class file version 52.0 
 
Error:...while parsing org/apache/lucene/analysis/ar/ArabicAnalyzer.class 
 
Error:1 error; aborting 
 
:app:transformClassesWithDexForDebug FAILED 
 
Error:Execution failed for task ':app:transformClassesWithDexForDebug'. 
 
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_73\bin\java.exe'' finished with non-zero exit value 1 
 
Information:BUILD FAILED 
 
Information:Total time: 40.184 secs 
 
Information:5 errors 
 
Information:0 warnings 
 
Information:See complete output in console

compile files('libs/lucene-6.2.0/queryparser/lucene-queryparser-6.2.0.jar') 
compile files('libs/lucene-6.2.0/demo/lucene-demo-6.2.0.jar') 
compile files('libs/lucene-6.2.0/core/lucene-core-6.2.0.jar') 
compile files('libs/lucene-6.2.0/analysis/common/lucene-analyzers-common-6.2.0.jar') 
은 메이븐 중앙에서 종속성 이러한 라이브러리를 추가하는 시도하지만 결과는 상기와 동일했다.

compile fileTree(dir: 'libs', include: '*.jar') 

내 응용 프로그램이 오류없이 실행하지만 루씬 클래스가 인식되지 않은 :

Error:unsupported class file version 52.0 
Error:...while parsing org/apache/lucene/analysis/ar/ArabicAnalyzer.class 

나는이 방법을 시도했다.

내가 뭘 잘못하고있어?

답변

0

문제는 지금 해결 된 것 같습니다.

Error:unsupported class file version 52.0 

라이브러리는 여전히 강력하게 충분한 같은 라이브러리를 사용하기 당신이 당신의 안드로이드 Studio 프로젝트 설정에서 1.8 이상 JDK를 선택한 경우에도 자바 8을 지원하지 않는 자바 8 (버전 52.0)와 안드로이드 API를 쓴 것을 의미한다. 틀 렸으면 고쳐줘.

관련 문제