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

Android: Trouble pulling in unity classes #34

Open
ivanmayes opened this issue Aug 17, 2018 · 7 comments
Open

Android: Trouble pulling in unity classes #34

ivanmayes opened this issue Aug 17, 2018 · 7 comments

Comments

@ivanmayes
Copy link

ivanmayes commented Aug 17, 2018

I just couldn't seem to figure this out. Did everything on the list, but i'm getting this error in my build:
screen shot 2018-08-17 at 4 52 35 pm

After some searching around, I ended up adding the unity-classes.jar to the main android project as a library, but then I receive this error, which seems like its trying to add it in twice. I've tried different combinations of where to implement this, but I keep getting one error or the other:
screen shot 2018-08-17 at 4 52 15 pm

The Unity build works by itself without the plugin, so I'm not sure what is going wrong here.
Any help would be much appreciated!

@yasirkula
Copy link
Owner

You shouldn't add unity-classes.jar to your dependencies. Does uncommenting the implementation fileTree(include: '*.jar', dir: 'libs') line resolve the issue?

@ivanmayes
Copy link
Author

Unfortunately not, that had been commented out just because I was trying all combinations of loading in the unity classes. Just building the project clean and following your instructions, I get the first screenshot I sent, which is the same as below when uncommenting the *.jar line. I've gone back and started another ionic boilerplate project, and refollowed the steps with the same result.

screen shot 2018-08-17 at 4 52 35 pm

@yasirkula
Copy link
Owner

Why do you comment that line?

@juan9506
Copy link

I was just trying all the ways possible.
I managed to solve my problem by downgrading Gradle to 3.5 (I didn't see the other closed issue with my same error)
Now, my ionic app closes by itself without erros or logs, but I think this is due to my javascript implementation in the ionic side (I'm a newbie with ionic and typescript).
Do you have some sample project so we can see how exactly do we call unity's funcionalities from typescript?
I have read many times the instructions but I don't get how to launch the vuforia view from ionic.

@yasirkula
Copy link
Owner

@juan9506 Assuming that you plan to launch Unity from the homepage, you should insert the openUnity function (that can be found in the documentation) to home.ts and call that function whenever you want to launch Unity. You can e.g. bind it to a button's click event in home.html.

@juan9506
Copy link

I keep getting the same error that unityARCaller is undefined.

@yasirkula
Copy link
Owner

Don't forget this line:

// Should put declare before any @Component's
declare let unityARCaller: any;

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

No branches or pull requests

3 participants