amplitude / unity-plugin

Official Amplitude Unity Plugin
https://developers.amplitude.com/docs/unity
MIT License
44 stars 34 forks source link

Assembly Definition files are missing #116

Closed halfgrey closed 1 week ago

halfgrey commented 1 year ago

Expected Behavior

When Unity developers use assembly definition files they should be able to add a reference to the Amplitude assembly definition files so that they can use the SDK. For example AmplitudeSDKCore.asmdef

Current Behavior

The assembly definition files are missing since they are filtered by the .gitignore file. Only the .meta files are still existing.

Possible Solution

Remove asmdef filter from .gitignore and commit asmdef files again so that developers can reference and use the SDK code.

Steps to Reproduce

  1. Create a new empty Unity Project with an example script.
  2. Create an assembly definition file next to that script and name it whatever you like. For example. com.Company.Example
  3. Import Amplitude via Package Manager and the git url
  4. Try to use amplitude in your script (ERROR: You won't be able to use the amplitude c# code as you would need to reference for example AmplitudeSDKCore.asmdef to com.Company.Example.

Environment

shamruk commented 1 year ago

Had to create asmdef myself. Took me about 1 minute, but should be there in the 1st place. PS if will be fixed, plz add the fix also to v2.6.0-no-edm branch/tag

justin-fiedler commented 1 year ago

Hi @shamruk thanks for the heads up on this. Glad you found a workaround. We have this in our backlog but do not have an ETA for the fix.

lordmortis commented 2 weeks ago

This is still broken and means importing via a package is impossible

izaaz commented 2 weeks ago

This should be fixed in version 2.8.0. @lordmortis - can you please confirm where you're seeing this?

If you're using the unitypackage file, you can find all the different versions here: https://github.com/amplitude/unity-plugin/releases/tag/v2.8

For direct loading from UPM, you can use the following branch main, main-without-edm-and-dependency or main-without-edm

Can you please confirm if you're seeing an issue with these branches as well?

lordmortis commented 2 weeks ago

Looking at the main branch on GitHub, I can see the assembly definitions are back

However I’m not sure using the main branch is ideal as if a new version is marked main it is likely that unity will upgrade the package next time it refreshes (as it will use the branch/tag) - so to make the time-frame more controllable for us, we really need the tags.

2.7.0 and 2.6.0 both have corresponding -no-edm-and-dep and -no-edm tags (but those versions are missing the assembly references)

Do you know what Unity’s behaviour is when the tag/branch specified in the manifest updates in git? Will it just auto-update?

I can just use 33720007dc6dd7a1d0a3f41292554ea504894524 as that’s the main-without-edm-and-dependency for 2.8.0 - but it’s definitely less than ideal.

On 3 Jul 2024, at 0:47, Izaaz Yunus wrote:

This should be fixed in version 2.8.0. @lordmortis - can you please confirm where you're seeing this?

If you're using the unitypackage file, you can find all the different versions here: https://github.com/amplitude/unity-plugin/releases/tag/v2.8

For direct loading from UPM, you can use the following branch main, main-without-edm-and-dependency or main-without-edm

Can you please confirm if you're seeing an issue with these branches as well?

-- Reply to this email directly or view it on GitHub: https://github.com/amplitude/unity-plugin/issues/116#issuecomment-2203812077 You are receiving this because you were mentioned.

Message ID: @.***>

!DSPAM:66842f2a96921247212145!

lordmortis commented 2 weeks ago

Can confirm that using 33720007dc6dd7a1d0a3f41292554ea504894524 at least compiles in unity (though the asset definition changed from the version we were on). I haven't built this just yet, but this is further that I was getting before.

izaaz commented 1 week ago

Using the hash isn't the cleanest thing to do. I've added two new tags

v2.8.0-no-edm-and-dep and v2.8.0-no-edm

lordmortis commented 1 week ago

Thank you! Hopefully that will make it clearer for others!

izaaz commented 1 week ago

Thank you @lordmortis. Please feel free to reopen this issue if you're running into more problems with this.