PTCInc / vuforia-engine

Bug and feedback issue tracker for the Vuforia Engine SDK
https://developer.vuforia.com
20 stars 0 forks source link

Vuforia License Error in Unity when building for android #120

Closed MirakoolDev closed 5 months ago

MirakoolDev commented 6 months ago

Summarize the bug: Whenever I build for android, I get that error(note that, I've not tried building for iOS because I don't have Xcode or a MacOS device) when I clear out the license key, I don't get the error but when I add and build the error comes back.

Observed problem When attempting to build an APK for my Unity project that uses Vuforia, I encounter the following error message: "Invalid AssetDatabase path: C:/Users/GU502/.../Assets\VuforiaLicense.cs. Use path relative to the project folder." This error occurs only when the Vuforia license key is entered in the Vuforia Configuration settings. If the license key is removed, the build completes successfully without any errors. This issue seems to be related to the Vuforia Engine's handling of the license key and the AssetDatabase, atleast that's what have gotten from searching the web but I'm yet to find a solution

Expected result The build process should complete successfully without errors, including when the Vuforia license key is entered. The APK should be built and include all necessary Vuforia components, I wouldn't mind if the app works but the error I'm getting, I just need it for a school project.

Other observations The error occurs specifically during the build process when the Vuforia license key is present. Deleting the Library folder and allowing Unity to rebuild does not resolve the issue. The error does not appear during the build process if the license key is not entered, indicating that the problem is directly related to the license key handling just my observation. even when I start with the vuforia project from unity asset store it's the same issue.

Reproducible steps Steps to reproduce the behavior: Open the Unity with 3D-core project. add Vuforia via asset-importpackage-custom... Go to Window -> Vuforia Configuration. Enter a valid Vuforia license key in the App License Key field. Go to File -> Build Settings. I can attach screenshot of my settings image image image image

same regular way of building... Select Android as the target platform. Click Build and choose a location to save the APK. Observe the error message in the Console during the build process.

Affected Vuforia Engine version: E.g. v10.22.5.

Affected platform:

Affected device: I didn't bother testing on devices, would it work fine even with that error? I just need it for a school project

Screenshots / Video Recordings image

Affected database I'm not sure it affects the database, the project works just find in the simulator. it even said Vuforia intialized and all 3 targets are tracked.

Device or platform logs I don't have these

Workaround I've tried for days, I've been unable to find a work around

Additional comments Add any other details about the problem here.

MirakoolDev commented 6 months ago

why doesn't anyone know how to fix this problem? I uninstalled Unity from my PC and started all over, but I still got the error. also when I add the Vuforia package to the project and create the AR camera it doesn't ask me to accept an agreement. it works on other PCs just fine, just not my own.

ptc-pscheper commented 6 months ago

Hey there, can you create a new project and try to build the Core Samples with your license key? That way we can narrow down the issue.

MirakoolDev commented 6 months ago

just did that, still getting the same error image Invalid AssetDatabase path: C:/Users/GU502/AppData/Local/Temp/5488dc742249612429451b428414ea65/Assets\VuforiaLicense.cs. Use path relative to the project folder. UnityEngine.StackTraceUtility:ExtractStackTrace () Vuforia.EditorClasses.LicenseKeyObfuscationTask:Execute () BuildObserver/<>c:b__3_0 (Vuforia.EditorClasses.VuforiaLifeCycleTask) System.Collections.Generic.List1<Vuforia.EditorClasses.VuforiaLifeCycleTask>:ForEach (System.Action1) BuildObserver:OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport) UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

ptc-epassaro commented 6 months ago

Hi @MirakoolDev, the team is aware of this and a fix will be published with the upcoming release of Vuforia. That said, the message you're seeing is a warning that has no effect on the functionality of either Vuforia or your app, so feel free to test it on a device and verify that everything works as expected.

also when I add the Vuforia package to the project and create the AR camera it doesn't ask me to accept an agreement.

The request to accept the developer agreement is only shown the first time you use Vuforia in Unity. Once you accept it the first time, Vuforia will ask you to accept it again only if you update to a newer version of Vuforia.

MirakoolDev commented 6 months ago

okay, I appreciate the feedback. I'm looking forward to the upcoming release. amazing work, y'all are doing. so Vuforia functions normally inside the Unity environment, I was building an Indoor Navigation app, with Unity's AI Navigation. It works perfectly fine in the simulator but when I build an .apk file, it does work(tested on multiple devices). so I used another PC to build the same project and it works.

ptc-epassaro commented 6 months ago

It works perfectly fine in the simulator but when I build an .apk file, it does work(tested on multiple devices).

I assume you wanted to say it doesn't work when you build from that machine? In that case, do you see any error message in logcat? One small trick I use for filtering the logcat output is to use adb.exe with these arguments: adb.exe logcat 'AndroidRuntime:V AR:V Unity:V *:F'

Some additional tips for debugging can be found here: https://developer.vuforia.com/library/troubleshooting/troubleshooting-your-app#debugging

ptc-thesbyro commented 5 months ago

Hi,

The fix for the warnings reported by the VuforiaLicense.cs at build time is fixed with the release of Vuforia Engine 10.24

I will close this ticket, but feel free to re-open it if the problem persists.

jenzhou commented 4 months ago

Thanks,I had the same problem. So I need to download 10.24 vuforia. Right?