Start a new topic

Javascript SDK manual is incorrect?

 Hello,


I'm trying to follow the manual for this SDK but it keeps failing. This is the one i'm talking about: https://www.wikitude.com/external/doc/documentation/7.2/android/setupguideandroid.html


In the following step i find one inconsistency:

  • "Copy the file libs/wikitudesdk.aar into the libs folder of your module. (<project-root>/<module-name>/libs)"

image

Then i tried the next step, adding the dependencies like so:

image


But get this  error.. I initialised the project with sdk version 18.





i just changed the last line to:
compile 'com.android.support:appcompat-v7:26.1.0'


Then i got more errors that it couldnt find wikitudesdk.aar in a couple directories. Then i added the .aar file to one of the directories and added a '-' to it (wikitudesdk-.aar) and now i get a new error:



 

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 18 cannot be smaller than version 19 declared in library [:wikitudesdk:] C:\Users\robert\.gradle\caches\transforms-1\files-1.1\wikitudesdk-.aar\dc9bf5b22a0d9c55de972792925fa869\AndroidManifest.xml as the library might be using APIs not available in 18
  	Suggestion: use a compatible library with a minSdk of at most 18,
  		or increase this project's minSdk version to at least 19,
  		or use tools:overrideLibrary="com.wikitude.architectandlib" to force usage (may lead to runtime failures)

 

so next thing i did was change:

minSdkVersion 18
to

minSdkVersion 19
Now it says finally: build succesful!!

 

Alright! seems like i fixed some stuff.

I created a new class and called it "TheARActivity". Just an empty class that extends AppCompatActivity. Then put in the manifest:
<activity android:name="com.robert.wikitude_javascript_sdk_2.TheARActivity" android:configChanges="screenSize|orientation"/>


Now on to the next step:

"You have to include"

 <script src="https://wikitude.com/libs/architect.js"></script>

 In a html file, but i have no html files?? any idea where they are??

 I made my own with a webview according to this guide:


http://abhiandroid.com/androidstudio/add-local-html-file-android-studio.html

To no avail. Then i thought about just copying the sample app structure! This is going OK.

I now think i know where to put in the licence key, it tells me to visit this link to get a licence key:
https://www.wikitude.com/developer/licenses
But the website seems to be broken :(

image


 

 Hi,


If you want to download the trial license key then please follow the link here http://www.wikitude.com/developer/licenses. If you want to go to the documentation then please go here https://www.wikitude.com/documentation/, find the platform you are working with and follow the Getting Started guide and Where I should enter the license key link.


Thanks

Eva

Yes thanks sorry for the confusing messages, i already figured out how to do the key.

i got stuck on this step:


 

You have to include

 <script src="https://wikitude.com/libs/architect.js"></script>

in your HTML files to use the AR namespace and the architectView will handle them properly. To test an ARchitect World on a desktop browser, you must include ade.js tool instead to avoid JavaScript errors and see a development console. 

 i made an assets folder and put index.html in it. And then the script. Maybe it might work? i will try to proceed the guide

 

After some stressful hours managed to make a black screen appear with the wikitude and trial watermark. So i think it will work.


Thanks for your assistance, although i advice you to have someone walk through the tutorial and correct wherever it doesn't work anymore because it seems to be outdated for the newer Android studio versions.

 Good day! I'm sorry for reopening this but i couldnt find the solution on this forum.

i start my app and switch to the intent containing the architect view and it shows a nice splash screen on my phone with "trial" on the background and a wikitude logo.


When i look in my console i get:


 

resolveCameraResolution: This method may not be called when the camera is already running.
                                                                                  java.lang.RuntimeException: Fail to connect to camera service
                                                                                      at android.hardware.Camera.<init>(Camera.java:519)
                                                                                      at android.hardware.Camera.open(Camera.java:364)
                                                                                      at com.wikitude.common.camera.internal.c.a(ProGuard:288)
                                                                                      at com.wikitude.common.camera.internal.e.<init>(ProGuard:61)
                                                                                      at com.wikitude.common.camera.internal.CameraService.<init>(ProGuard:39)
                                                                                      at com.wikitude.architect.services.internal.a.a(ProGuard:50)
                                                                                      at com.wikitude.common.services.internal.ServiceManagerInternal.initService(ProGuard:33)
                                                                                      at com.wikitude.architect.ArchitectView.loadingStarted(Native Method)
                                                                                      at com.wikitude.architect.ArchitectWebView.startLoading(ProGuard:520)
                                                                                      at com.wikitude.architect.ArchitectWebView.loadArchitectFileFromUrl(ProGuard:355)
                                                                                      at com.wikitude.architect.ArchitectView.load(ProGuard:972)
                                                                                      at com.robert.wikitude_javascript_sdk_2.TheARActivity.onPostCreate(TheARActivity.java:79)
                                                                                      at android.app.Instrumentation.callActivityOnPostCreate(Instrumentation.java:1207)
                                                                                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2956)
                                                                                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045)
                                                                                      at android.app.ActivityThread.-wrap14(ActivityThread.java)
                                                                                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642)
                                                                                      at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                      at android.os.Looper.loop(Looper.java:154)
                                                                                      at android.app.ActivityThread.main(ActivityThread.java:6776)
                                                                                      at java.lang.reflect.Method.invoke(Native Method)
                                                                                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
                                                                                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

 

Hi,


Please make sure that you have the required camera permissions (in the manifest and the runtime permissions) before calling onResume of the ArchitectView. 


Best Regards,

Alex

Yes thanks i changed it to minimum api 23 so it enables me to dynamically ask for permissions. Then i added this code:


 

if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA)
                != PackageManager.PERMISSION_GRANTED) {
            // Permission is not granted
            System.out.println("test3: you dont have permission");

            System.out.println("test4: hij request permission!");
            ActivityCompat.requestPermissions(this,
                    new String[]{Manifest.permission.CAMERA},
                    1);

        }else{
            System.out.println("test5: it does something else?!");
        }

 And voila! It asks for permission. I clicked yes and then it went back to the black  'trial' window. It doesnt give the error in the console anymore and when i try again it wont ask for permission anymore because i already gave it.

 

added some overrides and now it works! Thanks for support.

Note to people reading this that dont have much experience with Android: take into account that different API targets have different ways of handling the permissions.

 

Login or Signup to post a comment