Start a new topic

Camera only show TRIALS word and no camera view

Camera only show TRIALS word and no camera view

4 people have this problem

Hello there,

I feel sorry to re-open that ticket, but I encounter the same problem as the first one Soo How NG got. On my first trial app, i only get a black background and the trial word on the screen. It seems that the SDK is fully loaded, but i can't use my camera vision, any idea?

I run on Android Marshmallow (23) and id doesn't work, neither on android Kitkat (19). I tried it on the emulator and on my phone device, and I use the last version of the javascript sdk, the 7.0.0.

Thanks by advance,


Julien


1 person likes this

 This is my architectView activity:

package com.example.thomas.artest;

import android.Manifest;
import android.app.Activity;
import android.os.PersistableBundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.wikitude.architect.ArchitectStartupConfiguration;
import com.wikitude.architect.ArchitectView;
import com.wikitude.common.camera.CameraSettings;
import com.wikitude.common.permission.PermissionManager;

import java.io.IOException;
import java.security.Permission;

public class ARtivity extends Activity {

    protected ArchitectView architectView;

    public static final String KEY = "xzyLUb8xLJhjCcnvsMW3Sx2mfYJqxewOB3xJ+X4cWd14ZmvOou61Ih95TERKNwHfqVTJ4zWRg+zMGWjQJg1QYeMb7MvcBijzxqhd/OZl18hGjN8bOrOiUbxi64CMYrdpM1soimzMLhV+GqzdRt+wZWenatwTKfYoDJ9d+sxsO+NTYWx0ZWRfX9d4qgY+oB6bOZK0Z0DX1AFp1kZWhQeSBTZjrSHbomM7lmi4gaWjDlAaA/7GQLU2pCQQqKTiEEvV0SFosUYLPxTcad6Ot9SEgLGHJrjerAjvAfQvP0LkvQVguBXKZl4opzTyf8LeTmrZDt1R3WtffqsCjaEkwVH06pw4O+y5JwCXclLz2FH2eDddt7tKqAp/TxAOkA398+OhfR8yNkutXn2Yr0D/vMabt27OZTrRFfhWPbi3JeobXqg5ih+CvZf/hxLcYeKJ7i4K9nRYFUwopAbKX/Gm+mvtmPEyOOp8v/SVlErCIWhVwLoXujvUcmi96gGuDQS8GY1zf8pMYY8LmIruldBc4jR7qiIpQWBHE77uSstaYOzUmsr7II+oGQCdjiRAUtsjqhInFal/jtfwgG+OFdIVPlrfH/LEpH/WvJMN5q3JXtUw0C7N64ql3wozP3bTy96XmYuiEH/PXFETSzEdi7VnIiV9/LfOm2e/KzJree9RIG6KLEw=";

    PermissionManager pm;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_artivity);

        architectView = (ArchitectView)findViewById(R.id.architectView);

        final ArchitectStartupConfiguration config = new ArchitectStartupConfiguration();
        config.setLicenseKey(KEY);
        config.setCameraPosition(CameraSettings.CameraPosition.DEFAULT);
        architectView.onCreate(config);

    }

    @Override
    public void onPostCreate(@Nullable Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);
        if (this.architectView != null) {
            this.architectView.onPostCreate();
            try {
                this.architectView.load("test/index.html");

            } catch (IOException e1) {
                e1.printStackTrace();
            }
        }
    }
}

 MainActivity where you press a button to access the ARtivity: 

package com.example.thomas.artest;

import android.Manifest;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import com.wikitude.architect.ArchitectView;
import com.wikitude.common.permission.PermissionManager;

import java.util.Arrays;

public class MainActivity extends AppCompatActivity {

    PermissionManager pm;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        pm = ArchitectView.getPermissionManager();


        Button btn = (Button)findViewById(R.id.button);
        final String[] permissions = new String[]{Manifest.permission.CAMERA};
        btn.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View view) {
                pm.checkPermissions(MainActivity.this, permissions, PermissionManager.WIKITUDE_PERMISSION_REQUEST, new PermissionManager.PermissionManagerCallback() {
                    @Override
                    public void permissionsGranted(int i) {
                        Intent intent = new Intent(MainActivity.this, ARtivity.class);
                        startActivity(intent);
                    }

                    @Override
                    public void permissionsDenied(@NonNull String[] strings) {
                        Toast.makeText(MainActivity.this, "The Wikitude SDK needs the following permissions to enable an AR experience: " + Arrays.toString(strings), Toast.LENGTH_SHORT).show();
                    }

                    @Override
                    public void showPermissionRationale(final int i, @NonNull String[] strings) {
                        AlertDialog.Builder alertBuilder = new AlertDialog.Builder(MainActivity.this);
                        alertBuilder.setCancelable(true);
                        alertBuilder.setTitle("Wikitude Permissions");
                        alertBuilder.setMessage("The Wikitude SDK needs the following permissions to enable an AR experience: " + Arrays.toString(strings));
                        alertBuilder.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
                            @Override
                            public void onClick(DialogInterface dialog, int which) {
                                pm.positiveRationaleResult(i, permissions);
                            }
                        });

                        AlertDialog alert = alertBuilder.create();
                        alert.show();
                    }
                });


            }
        });
    }


    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        pm.onRequestPermissionsResult(requestCode, permissions, grantResults);
    }
}

  and this is my manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.thomas.artest">

    <uses-sdk
        android:minSdkVersion="9"
        android:targetSdkVersion="19" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_GPS" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <uses-feature
        android:name="android.hardware.camera"
        android:required="true" />
    <uses-feature
        android:name="android.hardware.location"
        android:required="true" />
    <uses-feature
        android:name="android.hardware.sensor.accelerometer"
        android:required="true" />
    <uses-feature
        android:name="android.hardware.sensor.compass"
        android:required="true" />
    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".ARtivity" android:configChanges="screenSize|orientation"></activity>
    </application>

</manifest>

 I'm using Wikitude SDK version 7.0.0 and this is my build.gradle file for the app: 

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "com.example.thomas.artest"
        minSdkVersion 22
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile(name: 'wikitudesdk', ext: 'aar')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:26.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'
}

repositories {
    flatDir {
        dirs 'libs'
    }
}

 to test i have tried using Xiaomi Redmi Note 4 running Android 7.0 and a Samsung s6 running android 7  and the same problem has persisted with all of them. Thanks for the incredibly fast reply!! 


Tom 

Hi Tom,


if this is the whole code for your ARtivity you are missing other ArchitectView lifecycle calls.

You will have to call ArchitectView.onResume/onPause/onDestroy in their respective Activity Lifecycle methods.


Best Regards,

Alex


Man, I have the same exact frustration. The wikitude team must really have 1 more line of instruction in their "Getting started" page to say that you need to update the trial SDK key cause as the WikitudePlugin.js says to leave it empty. Please just update the comment there. It will resolve alot of unnecessary headache!
Hell Julien,

You cannot use the emulator for SDK versions prior to 7.0 since this is something that we have integrated with our SDK 7.1 version. Did you try with our sample app and still receiving the same error? Did you make sure that you have allowed camera permissions for our SDK?

Thanks
Eva

 

Hello again!

Thanks for answering that fast. I allowed camera permissions as the following screenshot can show you, but I didn't try with the sample apps. Gonna try it today.


image

Thx again,


Julien



Hi, I am using the example files to run on phonegap, but after the app started, the camera view is just pitch black with Trial words all over. I am using trial version with trial keys. Is there anything that I should do to solve this problem?

Hi,

The "Trial" words indicate that you are using the SDK with a Trial license, so the behavior is on purpose in this regards.

However, the camera should still be on, even when in Trial mode. Did you try to restart your phone? Sometimes, certain apps don't properly release access to the camera after they have been closed. In this case, any access to the camera is blocked, even for other applications.

Please try to restart your phone and immediately afterwards start the example again.

Thanks,

Martin

Yes, thanks for the information.
However, after restarting the phone, the problem still persist. 
The camera is my android phone has asked for Camera and Geo Location permission. After that, it just show pitch black.

And at times, the POI would show up, but against black background.

On my iOS however, I am facing another problem, the camera however is working fine, but the POI is not showing up. There is an indicator at the bottom of the screen that tells you whether location has been detected and how many POI has been put into the World. But it just doesn't show up.

And another thing is that, the capture screen doesn't seem to work. I am using the example files from github, by the way.

Hi,
We need some more information in order to help you regarding the rendering issues: Which Android/iOS device are you using and which OS version do they run?

I will have a look into the capture screen problem and reply to you as soon as possible.

Best regards

Andreas

My iOS Device,

iPhone 4 - OS 7.1.2
iPad Mini - OS 7.1.2

Samsung Galaxy Tab 4 7.0 - OS 4.4.2
XiaoMi 3 - OS 4.4.2

Thanks.

Regarding the screen shot issue. I tried it on a iPhone 4 and it was working as expected. You have to accept the Camera Roll access so that we can save the screen shot.
Does the error callback is called?

On which device are you experiencing the screen shot issues?

Best regards

Andreas

Actually, on all my devices, I can't take the screenshot. It didn't prompt me for Camera Roll access.
Is there anyway that I can send you my current phonegap files that you can verify for me? 

Because, I am really hitting a dead end here if the example files are not working out of the box.

Here is my phonegap files. https://dl.dropboxusercontent.com/u/7374845/Another.zip

Thanks!

Hi guys,

We are looking into this issue currently, but we don't have any ETAs yet. We will let you know once this is investigated.

Best,

Martin
Login or Signup to post a comment