Here is how I run a Vuforia Sample on Android Studio on Window 8
- Download, extract sample, remove files .project and project.properties
- On Android Studio : Import project, next, next ...
- Download & install android NDK http://developer.android.com/tools/sdk/ndk/index.html
- Download & install cygwin http://cygwin.com/
Edit the file jni/Android.mk
LOCAL_SRC_FILES = C:/Vuforia-sdk/build/lib/$(TARGET_ARCH_ABI)/libQCAR.so LOCAL_EXPORT_C_INCLUDES := C:/Vuforia-sdk/build/include where Vuforia-sdk is your vuforia sdk
Open cmd in your project folder and do "ndk-build"
In android studio, click on project structure, modules, "YourModuleName", Dependencies, add jars, select the correct path to vuforia sdk for me it was :
C:\Vuforia-sdk\build\java\QCAR\QCAR.jar
build & run your project in Android Studio
- Have fun!
*Don't forget the PATH variable for the ndk & cygwin
Read our Getting Started Guide for instructions on setting up the Java SDK, Android SDK and NDK:
Make sure you have installed the latest version available of Android Studio from:
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
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.
build.gradle
file and click ok.vuforia.jar
file from the vuforia sdk.libs
folder and paste the copiedvuforia.jar
file.lib
( NOTE: it is not libs) in the same structure as APK file.armeabi
insidelib
folder..so
files and paste it insidearmeabi
folder. and zip the lib folder intolib.zip
lib.zip
toarmeabi.jar
armeabi.jar
insidelibs
folder.