2016-06-22 1 views
0

최근에는 vuforia와 libGDX 통합에 관심이있었습니다. 이전 작업을 제어했지만 그 중 어떤 작업도 올바르게 작동하지 않았고, 안드로이드 및 그라디언트 문제에 초보자도 없습니다. 가장 좋은 것은 daemontus를위한 것이 었습니다. vuforia libgdx의 그의 오래된 버전 만이 vuforia에 의해 타겟을 추적하기 위해 더 이상 지원되지 않을 것입니다. 하지만 내 프로젝트에 vuforia 5.5를 구현해야합니다.Vuforia와 LibGDX를 함께 설치하는 방법은 무엇입니까?

나는 그 또한 vuforai.jar와 엔진을 추가, https://github.com/daemontus/VuforiaLibGDX 코드를 다운로드 한. 엔진을 변경하여 파일을 jar 파일로 변경하여 (처음에는 zip 파일을 포함하는 폴더를 만든 다음 확장 프로그램을 jar로 변경) vuforia와 엔진을 라이브러리의 lib 폴더에 복사하고 android로 루트 폴더를 가져옵니다. 사진관. 그런 다음 프로젝트 스타일로 안드로이드 스타일을 변경 한 다음 라이브러리가 제 위치에 있는지 확인합니다. 내가 프로젝트를 마우스 오른쪽 버튼으로 누른 다음 응용 프로그램 탭에서 열어 의존성을 열고 새로운 vuforia와 엔진을 의존성 목록에 추가했습니다. 또한 NDK가 존재하는지 확인했습니다. 확인을 누릅니다. 내가 그것에 대한 해결책을 찾을 수없는 것 같습니다 gradles에 대해이 오류를 얻을 : 방법을 포함하지 않는 Gradle을 버전을

Error:(53, 0) Gradle DSL method not found: 'compile()' Possible causes:

프로젝트 'VuforiaLibGDX 마스터'를 사용 할 수있다. 열기 Gradle 래퍼 파일 빌드 파일에 Gradle 플러그인이 누락되었을 수 있습니다. Gradle 플러그인 적용

최신 vuforia 샘플이 여기에 설명 된 절차와 유사하게 작동합니다. 나는 창 10을 사용하고 있습니다. 또한 수입 장소에 vuforia가 발견되지 않았다는 것을 알았지 만 종속성에 추가했습니다. import com. vuforia. Matrix44F;

build.gradle 프로젝트 : 모든 하위 프로젝트/모듈에 공통 구성 옵션을 추가 할 수 있습니다

// 최고 수준의 빌드 파일.

buildscript { 
    repositories { 
     mavenCentral() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.1.2' 
    } 
} 

allprojects { 
    repositories { 
     mavenCentral() 
    } 
} 

Build.gradle.App :

apply plugin: 'com.android.application' 

def VUFORIA_SDK_DIR = '/Users/daemontus/Library/Vuforia' 
def NATIVE_LIB_DIR = 'build/lib' 
def JAR_DIR = 'build/java/vuforia' 

android { 
    compileSdkVersion 23 
    buildToolsVersion '23.0.2' 

    sourceSets.main { 
     jni.srcDirs = [] 
     jniLibs.srcDirs = ["$VUFORIA_SDK_DIR/$NATIVE_LIB_DIR/", "lib/"] 
    } 

    defaultConfig { 
     applicationId "com.github.daemontus.renderer" 
     minSdkVersion 15 
     targetSdkVersion 22 
     versionCode 1 
     versionName "1.0" 
    } 

    archivesBaseName = rootProject.projectDir.getName() 

    buildTypes { 
     release { 
      minifyEnabled false 
      ndk { 
       abiFilters "armeabi-v7a" 
      } 
     } 
     debug { 
      minifyEnabled false 
      debuggable true 
      ndk { 
       abiFilters "armeabi-v7a" 
      } 
     } 
    } 
} 

repositories { 
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } 
} 

ext { 
    gdxVersion = '1.9.3' 
} 

dependencies { 
    compile 'com.android.support:appcompat-v7:23.+' 
    compile "com.badlogicgames.gdx:gdx:$gdxVersion" compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion" compile files('lib/vEngine.jar') 
    compile files('lib/Vuforia.jar') 
    compile files('lib/vEngine.jar') 
} 
또한

내가 이런 식으로 내 Gradle을 변경했지만 그 작동하지 않는 원인 vuforia 패키지가 발견되지 않은 : 을 나는 또한이처럼 내 Gradle을 변경 한 하지만 여전히 vuforia를 찾을 수 없습니다 :

apply plugin: 'com.android.application' 
def VUFORIA_SDK_DIR = 'C:\\Dev\\vuforia-sdk-android-5-5-9' 
def NATIVE_LIB_DIR = 'build/lib' 

android { 
    compileSdkVersion 23 
    buildToolsVersion '23.0.2' 

    sourceSets.main { 
     jni.srcDirs = [] 
     jniLibs.srcDirs = ["$VUFORIA_SDK_DIR/$NATIVE_LIB_DIR/", "lib/"] 
    } 

    defaultConfig { 
     applicationId "com.github.daemontus.renderer" 
     minSdkVersion 15 
     targetSdkVersion 22 
     versionCode 1 
     versionName "1.0" 
    } 

    archivesBaseName = rootProject.projectDir.getName() 

    buildTypes { 
     release { 
      minifyEnabled false 
      ndk { 
       abiFilters "armeabi-v7a" 
      } 
     } 
     debug { 
      minifyEnabled false 
      debuggable true 
      ndk { 
       abiFilters "armeabi-v7a" 
      } 
     } 
    } 
} 

repositories { 
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } 
} 

ext { 
    gdxVersion = '1.9.3' 
} 

dependencies { 
    compile 'com.android.support:appcompat-v7:23.+' 
    compile fileTree(include: '*.jar', dir: 'libs') 
    compile files('libs/vuforia.jar') 
    compile "com.badlogicgames.gdx:gdx:$gdxVersion" 
    compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion" 
} 

오류 : (16, 19) 오류 : 패키지 com.vuforia이

존재하지 않습니다 끝에

답변

0

나는 내 문제를 발견하지만 난 검은 이미지를 얻을 :

나는이 같은 Gradle을 파일을 변경 :

apply plugin: 'com.android.application' 
def VUFORIA_SDK_DIR = 'C:\\Dev\\vuforia-sdk-android-5-5-9' 
def NATIVE_LIB_DIR = 'build/lib' 

android { 
    compileSdkVersion 23 
    buildToolsVersion '23.0.2' 

    sourceSets.main { 
     jni.srcDirs = [] 
     jniLibs.srcDirs = ["$VUFORIA_SDK_DIR/$NATIVE_LIB_DIR/", "lib/"] 
    } 

    defaultConfig { 
     applicationId "com.github.daemontus.renderer" 
     minSdkVersion 15 
     targetSdkVersion 22 
     versionCode 1 
     versionName "1.0" 
    } 

    archivesBaseName = rootProject.projectDir.getName() 

    buildTypes { 
     release { 
      minifyEnabled false 
      ndk { 
       abiFilters "armeabi-v7a" 
      } 
     } 
     debug { 
      minifyEnabled false 
      debuggable true 
      ndk { 
       abiFilters "armeabi-v7a" 
      } 
     } 
    } 
} 

repositories { 
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } 
} 

ext { 
    gdxVersion = '1.9.3' 
} 

dependencies { 
    compile 'com.android.support:appcompat-v7:23.+' 
    compile fileTree(include: '*.jar', dir: 'lib') 
    compile files('lib/vuforia.jar') 
    compile "com.badlogicgames.gdx:gdx:$gdxVersion" 
    compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion" 
} 

의 작업 만 시작할 때 그냥 검은 색을 보여줍니다! 그런데 2 ~ 3 분 후에 렌더링이 시작됩니다!. 왜 그렇게 많은 시간이 걸릴까요?