Start a new topic

Help with Unity > Android Studio Walkthrough?

Help with Unity > Android Studio Walkthrough?


Hi all,

I just downloaded a Unity package to try the sample project. I had never used Android Studio before, and I do have difficulty trying to build a debug APK which I can transfer it to my Android tablet. Here are the steps that I did:

 1.Open Unity 5.2 (64bits) on Windows 7

2. Import Wikitubde package

3. Switch to Android platform in Build Settings

4. Add "Main" scene to Build Settings

5. Check "Google Android Project" on

6. Hit Export

In the directory, I see two folders are generated. One called "WikitudeUnityExample" and the other one is called "app-debug".

Question: Which folder should I open in Android Studio?

I assume I should use the one called "WikitudeUnityExample", so...

7. I open Android Studio and IMPORT PROJECT (Is it the right option?).

8. Hit "Next" on the import option

9. After the import, I hit Build > Make Project

10. Received error on Gradle Console - 

FAILED

 

FAILURE: Build failed with an exception.

 

* What went wrong:

Execution failed for task ':wikitudeUnityExample:processDebugResources'.

> Error: A library uses the same package as this project: com.wikitude.unityexample

 

* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

 

BUILD FAILED

 

11. Lost and confused

 

Is there a walkthrough document or a video? Specially for people who never use Andoid Studio before.

Building a APK in Unity is easy, it is just a button and APK is then generated. But I don't see any similiar button on Android Studio, do I always need to connect with a Android device to able to generate a APK in my directory? Currently I just want to generate a debug build so that I can run the example on my device. I worry about the release option later on.

 

I hope you guys can help me out in here. Thank you.

Hi Derek,

I'm very sorry but we do have a problem there. I will start to investigate this issue right away.

What you can do for now is, eighter use Unity to build the APK or if you need to use Android Studio make the following changes to your project in Android Studio:


Rename the package of the WikitudeUnityExample from com.wikitude.unityexample to something else by right clicking on the folder / refactor / rename

Open the AndroidManifest.xml and adjust the package in line two

Again in the AndroidManifest search for the line which starts with "<activity ..." and set the property android:name to your.new.package.name.UnityPlayerActivity 

To build an apk without a connected device click on the gradle menu on the right side of the screen, click on wikitude_unity_example (root),  click on build, click on assembleDebug


Best regards,
Simon

Thank you for your answer! That actually save me a lot of work without go through the Android Studio.

I have one more question, what is the target that I should use for that example? Where can I find it?

The target is the image you generate here with Wikitude Studio & that will output a wtc file to your email. That wtc file needs to be selected in the Prefab.

@All

I also tried to use the Unity plugin & haven't used Android Studio for a long time now. It's kind of boring not being able to generate directly from Unity & having to jump to Android Studio.

I'm having an error in Unity when running + no info on the Net :

Could not load type 'UnityEngine.Rendering.GraphicsDeviceType' from assembly 'UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.

I have followed the instruction, putting both Prefabs with the key + selected my wtc file, still wondering the image* value inside the tracker Prefab, but nothing happens on runtime. I see the Wikicamera being disabled when running it in Unity. I can give you more details of what's happening, but for the 1st test, I'm not enjoying the experience.

I'm using Unity Remote 4 + ADB & would like to debug quickly my wikitude test apps.Using other Unity AR solutions, it turned out to be a lot of easier.

Thanks for putting some Unity test scenes in your updated Unitypackages next time + some pdf. If we could directly compile wikitude APKs from Unity without Android Studio, it would be perfect.

Thank you

 

 

 

Hi Max,

I know it is annoying that the project export isn't working like it should, unfortuately we can't do anything about that, other than the guide on how to fix it. 

The error you are having, does it also occure when you install the app directly from Unity on the device without Unity Remote?

Thank you for all the suggestions regarding the Unity package!

Best regards,
Simon
I have the same problem:
Error: A library uses the same package as this project: com.wikitude.unityexample

I run it on my Android device through Unity Editor, and it seems like I renamed everything that could be renamed

 

Hi Aaaamm,


Are you using a stable release of Unity (2017.3 for example)?


Thanks

Eva

Yup.

Actually, the error disappeared when I first duplicated and then dragged the scene to the assets folder.
Thanks
Login or Signup to post a comment