Using Android Studio with Vuforia [closed]

一个人想着一个人 提交于 2019-11-27 04:40:13
Dhana Sekaran

Read our Getting Started Guide for instructions on setting up the Java SDK, Android SDK and NDK:

 https://developer.vuforia.com/resources/dev-guide/getting-started-android-native-sdk

Make sure you have installed the latest version available of Android Studio from:

http://developer.android.com/sdk/index.html 

Use the Android SDK Manager (from within Android Studio) to get the latest Android SDK and Android Platform and Build tools

Launch Android Studio

Select File - > Import Project ... and browse to the root directory of the sample Vuforia project you want to open Proceed in the Import Wizard dialog (click Next, Next) until you reach a page with this message:

"Alternatively, you can fill in the actual path map in the table below": click to edit

enter the actual path to the Vuforia.jar library (which is located under your vuforia_install_dir/build/java/vuforia)

In the Project view, right-click on the Project and expand the view hierarchy so to locate the Vuforia.jar under app > src > main right-click on Vuforia.jar to open the context menu

click on the "Add as library..." option in the context menu

Alternatively, if you cannot locate the Vuforia.jar in your project hierarchy: right-click on the Project and select "Open Module Settings"

select "App" then select the "Dependencies" tab

Click on the "+" button to Add a File Dependency and browse to the Vuforia.jar file

Create a folder called "jniLibs" under the "app/src/main" folder under your Android Studio project directory

Copy the "armeabi-v7a" folder (including the libVuforia.so file located inside it) from the "vuforia_install_dir/build/lib" to the "app/src/main/jniLibs" folder

the resulting directory structure under your project root should be:
/app
/src
/main
/jniLibs
/armeabi-v7a
libVuforia.so

Clean and rebuild the project

Run the app on your device

Try this, Exporting Eclipse Project with vuforia into Android Studio, which worked for me.

Below are the steps which i followed to the project work fine in Android Studio.

  • Export the Eclipse project from Eclipse as a Gradle project.
  • Go to the welcome to android studio window in android studio.
  • Click on Import Non android studio project.
  • Locate the project that you exported from eclipse, expand it and select the build.gradle file and click ok.
  • Copy the vuforia.jar file from the vuforia sdk.
  • Right click on the project in android studio and click on Show in Explorer option.
  • Locate the libs folder and paste the copied vuforia.jar file.
  • Make a folder lib ( NOTE: it is not libs) in the same structure as APK file.
  • Make another folder armeabi inside lib folder.
  • Copy .so files and paste it inside armeabi folder. and zip the lib folder into lib.zip
  • Rename the lib.zip to armeabi.jar
  • Include the armeabi.jar inside libs folder.
  • Then clean build and run the project.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!