Install Vuforia in Android Studio

Can someone give me some instructions on how I should install Vuforia in Android Studio? I am creating a new application and I need to use Augmented Reality with Vuforia. I hope you help me!

Thank you so much!

+3
android android-studio augmented-reality vuforia
source share
2 answers

You need to follow these steps:

  • Check out the getting started guide for instructions on setting up the Java SDK, Android SDK, and NDK:

    https://developer.vuforia.com/downloads/sdk

  • Make sure the latest version of Android Studio is installed from:

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

  • Use the Android SDK Manager (from Android Studio) to get the latest Android SDKs and Android platforms and build tools

  • Launch Android Studio

  • Choose File → Import Project ... and go to the root directory of the Vuforia project you want to open.

  • Go to the Import Wizard dialog box (click Next, Next) until you find a page with this message:

    • "Alternatively, you can fill out the actual route map in the table below":
    • click to change
    • enter the actual path to the Vuforia.jar library (which is under your vuforia_install_dir / build / java / vuforia )
  • In the Project view, right-click the project and expand the hierarchy view to find Vuforia.ja r in the application> src> main

  • right click on Vuforia.jar to open the context menu

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

  • Alternatively, if you cannot find Vuforia.jar in your Hierarchy project:

  • right-click the project and select "Open Module Settings"

    • select "Application"
    • then select the "Dependencies" tab
    • Click the "+" button to add the file dependency, and go to the Vuforia.jar File page
  • Create a folder called "jniLibs" in the "app / src / main" folder in the Android Studio project directory

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

The resulting directory structure at the root of your project should be:

/app /src /main /jniLibs /armeabi-v7a /**libVuforia.so** 
  • If your project contains the "jni" folder, move it to a location outside of your project (otherwise Android Studio may try to compile the sources in this folder and may fail)
  • Clean and rebuild project
  • Launch the application on your device.

Best luck :)

+4
source share

answer here and work for me:

(It looks like the project needs access to the Vuforia.jar file and it cannot access it outside the sample folder (?))

So,

  • copy the Vuforia.jar file from the \ vuforia-sdk-android-xxx \ build \ java \ vuforia folder to the folder in the sample project, for example. in \ samples \ app \ libs (this is important in the "\ app" path, so you can find it in the next step)

  • in the Android SDK, press F4 (or right-click the application folder in the project structure and click “Open module settings.” Select the “Dependencies” tab, click “+” to add the dependency, and select “2 file dependencies.” Now select the above path and file ((\ samples \ app) \ libs \ Vuforia.jar), and the project will work fine ...

Good luck.

0
source share

All Articles