2016-03-28 140 views
0

由于晚上,我试图建立andEngine与Android工作室,AndEngine安装了Android错误

  1. 我下载andEngine从GitHub https://github.com/nicolasgramlich/AndEngine GLES-中心定位..

  2. 我从SDK安装NDK经理(在adroid工作室)

  3. 然后,我创建了android工作室(空白活动)的新项目,然后我去了项目结构和点击+左侧,并添加了“导入Eclipse ADT项目” - >和选择下载andEngine(从GitHub),并完成

  4. 然后我得到了错误“NDK depcrecated”通过添加gradle.properties下面一行“android.useDeprecatedNdk =真”,这是解决

  5. 然后尝试SYN再次,然后我得到了下面的错误,我不知道现在要做什么..请帮我解决它..

    信息:Gradle任务[:app:generateDebugSources,:app:generateDebugAndroidTestSources,:andEngine:generateDebugSources,: andEngine:generateDebugAndroidTestSources] :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :应用程序:checkDebugManifest :andEngine:预生成UP-TO-DATE :andEngine:preReleaseBuild UP-TO-DATE :andEngine:compileReleaseNdk C:\用户\ Amul \ AndroidStudioProjects \ MyApplication2 \ andEngine \ SRC \主\ JNI \ src \ GLES20Fix.c:在函数'Java_org_andengine_opengl_GLES20Fix_glVertexAttribPointer'中: glVertexAttribPointer(index,size,type,normalized,stride,(void *)offset); ^ C:\用户\ Amul \ AndroidStudioProjects \ MyApplication2 \ andEngine \ SRC \主\ JNI \ SRC \ GLES20Fix.c:在函数 'Java_org_andengine_opengl_GLES20Fix_glDrawElements': glDrawElements(模式,计数,类型,(无效*)偏移量);^ C:\ Users \ Amul \ AndroidStudioProjects \ MyApplication2 \ andEngine \ build \ intermediates \ ndk \ release \ obj/local/arm64-v8a/objs/andengine_shared/C_ \ Users \ Amul \ AndroidStudioProjects \ MyApplication2 \ andEngine \ src \ main \ jni \ src \ GLES20Fix.o:In function Java_org_andengine_opengl_GLES20Fix_glVertexAttribPointer': C:\Users\Amul\AndroidStudioProjects\MyApplication2\andEngine\build\intermediates\ndk\release\obj/local/arm64-v8a/objs/andengine_shared/C_\Users\Amul\AndroidStudioProjects\MyApplication2\andEngine\src\main\jni\src\GLES20Fix.o: In function Java_org_andengine_opengl_GLES20Fix_glDrawElements': C:\ Users \ Amul \ AndroidStudioProjects \ MyApplication2 \ andEngine \ src \ main \ jni \ src \ GLES20Fix.c 警告:(9,63)警告:从不同大小的整数转换为指针[-Wint-to-pointer-cast] 警告:(13,36)警告:从不同大小的整数转换为指针[-Wint-to-pointer-cast] 错误: (9)undefined参考glVertexAttribPointer' Error:(13) undefined reference to glDrawElements' 错误:错误:ld返回1退出状态 make:*** [C:\错误:执行失败,任务':andEngine:compileReleaseNdk'。用户\ Amul \ AndroidStudioProjects \ MyApplication2 \和发动机\ build \ intermediates \ ndk \ release \ obj /本地/ arm64-v8a/libandengine_shared.so错误1 错误:

    com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Amul\AppData\Local\Android\sdk\ndk-bundle\ndk-build.cmd'' finished with non-zero exit value 2 Information:BUILD FAILED Information:Total time: 7.815 secs Information:4 errors Information:2 warnings Information:See complete output in console

+0

未定义的引用在OpenGL中都是符号,所以依赖关系没有得到解决。你在项目中链接到OpenGL吗?请发布Android.mk(如果你使用它)和build.gradle。 –

回答

0

大概本地库(.so从lib目录文件)丢失。

如果您使用的是android studio,您必须修改andEngine build.gradle。

将sourceSets块添加到您的andEngine版本。gradle这个文件:

sourceSets { 
      main { 
       jni.srcDirs = [] 
       jniLibs.srcDir 'libs' 
      } 
     } 

将成为您andEngine的build.gradle文件后:

apply plugin: 'com.android.library' 

    android { 
     compileSdkVersion 20 
     buildToolsVersion "23.0.3" 

     defaultConfig { 
      minSdkVersion 17 
      targetSdkVersion 23 

      ndk { 
       moduleName "andengine_shared" 
      } 
     } 

     sourceSets { 
      main { 
       jni.srcDirs = [] 
       jniLibs.srcDir 'libs' 
      } 
     } 

     buildTypes { 
      release { 
       minifyEnabled false 
       proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 
      } 
     } 
    } 

希望它可能是有益的,否则告诉我结果。