Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The associated image target collection failed to load #2

Open
alessapac opened this issue Nov 4, 2020 · 20 comments
Open

The associated image target collection failed to load #2

alessapac opened this issue Nov 4, 2020 · 20 comments

Comments

@alessapac
Copy link

alessapac commented Nov 4, 2020

When I open one of the experiences, the javascript error "The associated image target failed to load" insists. After closing the alert, sometimes Wikitude works fine, other times it does not work (white transparent bar shows Loading ...).
How can I overcome the problem?

Node.js server console:
[Wed Nov 04 2020 11:21:30.767] LOG URL WIKITUDE: ARchitectExamples/01_ImageTracking_1_ImageOnTarget/index
[Wed Nov 04 2020 11:21:30.803] LOG Is focus
[Wed Nov 04 2020 11:21:30.823] LOG URL WIKITUDE: ARchitectExamples/01_ImageTracking_1_ImageOnTarget/index
[Wed Nov 04 2020 11:21:30.859] LOG ComponentDidUpdate
[Wed Nov 04 2020 11:21:30.865] LOG Value of URL: ARchitectExamples/01_ImageTracking_1_ImageOnTarget/index
[Wed Nov 04 2020 11:21:30.868] LOG didmount Wikitude SDK index.js
[Wed Nov 04 2020 11:21:30.911] LOG {"message": "File was not found or file was unreadable."}

BR, Aleš

@joaquinlom
Copy link
Owner

Hi, this issue is on android or IOS?.

@alessapac
Copy link
Author

It is on Android. When I open the sample experience (for example Image Tracking) the JS error is shown. But if I put the app to the background and then bring it on again, suddenly experience is loaded and working. It sounds like wtc file is not loaded or should be loaded after Wikitude logo gets out of focus. Maybe? Thanks.

@joaquinlom
Copy link
Owner

Hi.
Can you share with me more information? Android Version, Wikitude SDK Version. Do you have all permissions accepted?
Thanks.

It' can be related that some reason the WikitudeView is rendering twice, are you running the example as it is or did you modify something else?

@alessapac
Copy link
Author

Hello.

Wikitude SDK install from npm:
wikitude@0.0.1 C:\mobileapp\react-native\wikitude
`-- react-native-wikitude-sdk@1.0.0 (github:joaquinlom/react-native-wikitude-sdk#93edb2f2fe595caba0634de65d986fc63ddd08b6)

Build.Gradle:
buildToolsVersion = "29.0.2"
minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 29

Settings.Gradle:
rootProject.name = 'wikitude'
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':wikitudesdk',':react-native-wikitude-sdk'
project(':react-native-wikitude-sdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-wikitude-sdk/android')
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'

Testing on my Android phone:
REALME 6PRO
Android Version 10

Camera permission is accepted on phone

I am running your example and cloned it from github.
Everything I changed is TRIAL LICENCE KEY.

Hope this helps.

Thanks,

@joaquinlom
Copy link
Owner

Ok, the only thing remaining is the version of Wikitude SDK.

I will run some tests and let you know.

Thanks

@alessapac
Copy link
Author

Any luck about the error?

Thanks

@joaquinlom
Copy link
Owner

Hi.
I'm unable to replicate the issue, Still testing with different phones.

@GianlucaP99
Copy link

Hi,
I have the same issued of @alessapac.
do you have any news on how to solve?

thanks, I really appreciate your work

@alessapac
Copy link
Author

Nothing yet. You can switch to cordova plugin instead of react native.

Still waiting for the solution.

@joaquinlom
Copy link
Owner

Let me try it again, and I'll let you know.
Ihavent found a way to replicate

@GianlucaP99
Copy link

GianlucaP99 commented May 26, 2021

HI @joaquinlom,
I don't know if it will be useful, but I'll add some details.
First of all I would like to say that I have installed on my samsung S10 (Android 11) device the apk provided by wikitude javascript sdk and it had no problems.
While doing a simple clone of this project, doing npm install there are about 12000 vulnerabilities I think referring to older versions of the libraries. In fact, in this case I get the error: "com.wikitudeexample.MainActivity cannot be cast to com.reactnativenavigation.NavigationActivity".

For this reason I had to create a new react native project from scratch and gradually install the updated libraries with npm and load the various assets in the android folder. after this procedure I was able to test my application on the device and it gave me the problem that when launching the view with wikitude it gave target failed loaded, while if I put it in the background and reopened it everything would work again.

Out of curiosity, I also tried to structure my application from scratch taking a cue from some bad things and the error recurred. Sometimes (a few) it also happened to me to receive the error in different ways:

  • error 2 times target failed in the first opening, after putting in background and reopening all works great.
  • 1 time error in the first opening, after putting in background and reopening all works great.
  • error 0 times in the first opening and after putting in background and reopening, it came out error in target and then it loaded it by itself.

Target error not found, I attach screenshots.

erroreReactWikitudeJavascriptSDK

I am available for any additional information and I hope I have been clear.

@joaquinlom
Copy link
Owner

What kind of URL are you trying to pass it to the WikitudeView Compontent?

@GianlucaP99
Copy link

url: '/assets/wikitude/firstTest/index'.

obviously inside openWikitude there is control on android:

const openWikitude = (url, allData) => {
console.log(props);
// eslint-disable-next-line no-undef
if (Platform.OS === 'android') {
url = url.replace('/assets/', '');
}
props.navigation.navigate('Details', {url: url, allData:allData});
};

I also attach the logs provided by the metro console:

image

In this case I got 2 file not accessible error alerts, after which I put in the background and reopened and everything worked

@joaquinlom
Copy link
Owner

And how do you pass it to the component?.
If you set the url directly into the WikitudeView component should the same result?

@joaquinlom
Copy link
Owner

I was able to replicate the issue, I'll come back with a fix.

@GianlucaP99
Copy link

I'm sorry if I didn't reply right away, but I'm glad you managed to replicate the error.

@joaquinlom
Copy link
Owner

Please use the latest version of the library.
Also verify the maven instalation.
Let me know if still have the issue.

*In my testing still throwing the message, but it works.

@GianlucaP99
Copy link

Hi,
I tried the last version of the library and all seems to work, although the error always comes out "E/Wikitude: File was not found or file was unreadable" .

I personally encountered 2 problems:

  • if i try to enter and exit augmented reality several times i notice that sometimes the target is not loaded. Before the change of the library it was never loaded at the first time, while now the first time always works while the following times some yes some not. I don't notice a particular error on the console, except "E / Wikitude: File was not found or file was unreadable". The problem persists even if I put in the background then the foreground still does not go, it is necessary to exit the augmented reality and re-enter. For this malfunction I tried to remove the comments from the lines of the wikitude component specifically for the commands wikitudeView.current.stopRendering (); and wikitudeView.current.resumeRendering () ;. By making these lines active, the question of entering and exiting augmented reality improves or the times following the first have more chances to work (not always). Enabling these lines every time I exit augmented reality, the error shown in the photo below always appears in the console.
    image

  • if you run augmented reality on the emulator there is a crash caused by a problem in the library (I attach photo of the error):
    image

Should I open another issue for the error on the emulator maybe inside the library and not here?

Emulator:
Pixel 4 API 30 x86

@joaquinlom
Copy link
Owner

Wikitude doesn't works well with the Emulator/Simulator. So for the best always use a Devices to test Wikitude.
For the other issue, I'll keep and eye and I will not close the issue yet.

@GianlucaP99
Copy link

GianlucaP99 commented Jun 1, 2021

perfect thank you very much.
I await news regarding the issues:

  • the tracker is not always loaded, after the first opening of augmented reality with wikitude.
  • there are problems with the onResume and onStop methods.

I believe that the 2 problems are connected and solving the second automatically would also have solved the first, because I believe that augmented reality is not deleted and restored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants