- Sort Posts
- 17 replies
- Last post
Sample App needs a Licence key?
Christ, all these responses to the OP are so disappointing, albeit on-par for the community and it's documentation practices.
So I dug around all over the example files until I found what you all were apparently too afraid to document.
For reference (something none of you apparently believe in) I am in Android Studio 3.1.1, and have downloaded from https://developer.vuforia.com/downloads/samples?d=windows-31-22-6820&retU the 'vuforia-samples-core-android-7-1-34', and from within that, have the project 'VuforiaSamples-7-1-34' open in Android Studio.
Once the project is (hopefully) loaded in, in the Project tab of Android Studio, make sure you're in the Android view (unless you've configured your Android Studio otherwise, this should be like it by default. So if you're unsure, it's probably in its default setup.) Here's the folder hierarchy for getting to the file that has the bit of code in it that everyone's hinting at.
app > java > com.vuforia.samples > SampleApplication
Inside of SampleApplication, there is a file titled SampleApplicationSession.java (the .java obviously doesn't appear in the Project tab, a blue 'C' icon should be next to the file title though.) Inside that file down on line 370 (yes, line number referencing is a bit jankie, so a more universal way to find this would be to search within that file for the following: doInBackground) is the line 'protected Boolean doInBackground(Void... params)'. A few lines below that (for me it's on line 375) is the fabled bit of super top secret code.
Vuforia.setInitParameters(mActivity,mVuforiaFlags, "");
From here my assumption would be that you paste the license key that you made on https://developer.vuforia.com/targetmanager/licenseManager/licenseListing into the double quotes in that line of code.
For the record, I have not tested whether this solves any problems for me. It just irked me so much that multiple people were posting the supposed answer, with absolutely zero reference/record of how to actually do the fix. Hopefully this will help some poor soul in the future.
Sample App needs a Licence key?
Sample App needs a Licence key?
Sample App needs a Licence key?
Thanks for your reply.
We are using Android Studio 2.3.3 on win7 machine. We are using vuforia-samples-core-android-6-2-10.
We have performed the following steps :
- We imported vuforia sample in Android Studio.
- Generated license key
- Pass the license key in the following function :
Vuforia.setInitParameters(mActivity, mVuforiaFlags, "myLicenseKey");
- Build the apk
- Installed the apk on Nexus 10(Android version 5.1.1)
- Run the application
- Select "Image Targets" on "Veforia Samples" screen
- Click on "Start" button.
- A black screen is displayed for a fraction of second and "Vuforia Samples" screen displayed again.
When we try to debug the application, on click of "Start" button the application is closed. Last call reached to the mentioned function.
- Kruparth Rana
Sample App needs a Licence key?
I have generated license key and used it as mentioned in the article for android.
https://library.vuforia.com/articles/Solution/How-To-add-a-License-Key-to-your-Vuforia-App
It is not working. Is there anything else to do?
Sample App needs a Licence key?
Yes you are right. They don't provide the license key for the sample projects. Why should we have to create one for sample apps?
To answer your question of "So, where DO you enter this damn key?"
First you need to drag in an ARcamera into scene then select it and on the right inspector menu under "Vuforia Behavior script" click on the "open Vuforia configuration"
and there you will see a textarea to paste in your license key.
Still need that answer of why the sample apps doesn't come with license keys?
Sample App needs a Licence key?
Thank you for providing the answer in this post because there is no indication in the code comments or variable names as to where the license key goes. Something so basic should be included in a quick setup readme.
Vuforia seems like a promising platform but the poor documentation is a turn-off.
Sample App needs a Licence key?
If you have successfully created license key. then follow these steps.
. copy the license key.
. Open SampleApplicationSession.java file.
. Look into InitVuforiaTask asycTask Class.
. Pase your license key as the parameter in Vuforia.setInitParameters.
example Vuforia.setInitParameters(mActivity, mVuforiaFlags, "<pase your license key here>")
This thread helped me avoid a lot of pain debugging the issue. All I had to do was create a license key and paste it in code as suggested. Thank you!