Closed felipefujioka closed 4 years ago
Hello, could you tell me what steps do you do when you're doing integration? And what errors you're seeing?
Also, thee Unity version our SDK is based on is: 2019.3.11f. Please try to update your Unity version too.
Hi,
The steps we followed were:
The Unity version is kinda of mandatory right now, as the update to the 2019 version would be pretty expensive for the whole project.
Thanks for sharing. How's your XXXDependencies.xml look like?
I created a Dependencies.xml file in Assets/Editor/Dependencies.xml, it looks like this.
<dependencies>
<androidPackages>
<repositories>
<repository>https://repo.maven.apache.org/maven2</repository>
</repositories>
<androidPackage spec="com.amplitude:android-sdk:2.27.0">
<repositories>
<repository>https://maven.google.com</repository>
</repositories>
</androidPackage>
<androidPackage spec="com.squareup.okhttp3:okhttp:4.2.2">
<repositories>
<repository>https://maven.google.com</repository>
</repositories>
</androidPackage>
</androidPackages>
<iosPods>
</iosPods>
</dependencies>
Everything look alright. It should be there're some task which will clean up all the libraries in your project. Does your project depend on any other dependency management tool?
We use Google Depency Resolver and Unity Package Manager. There are other third-party libraries that import AAR and JAR files that work just fine. I really can't find a reason why Amplitude's binaries would be removed like this. I will start a clean example project to see if it happens without other tools.
Is there any architecture limitation in the aar targets?
Just found out the error.
"Some users use unity-jar-resolver themselves. When they force resolve dependencies, it will clean up Amplitude related jars. For this case, what you would need to do is to declare those dependencies in your *Dependency.xml file."
In the integration guide that we followed in our first attempt indicated that the dependency file should be Dependency.xml not Dependencies.xml and that caused the confusion. The aar are not imported in the project and that is fine, because we are using a gradle build, and gradle will take care of the dependencies on the build process.
It might be good to fix the text in the integration guide though.
Thanks for the support!
Glad you figured it out. However I wonder why it's Dependency.xml for your case, since even google official doc said it's Dependencies.xml
It is wrong on amplitude unity integration guide actually.
@felipefujioka Oh! Thank you for catching it! We've fixed it.
As described in the unity plugin integration guide, in section 6 there is a known issue that causes aar and jar files associated with Amplitude to be removed from the unity project. The troubleshoot does not seem to work properly as adding a Dependency.xml file describing the android packages does not change the Resolver behavior.
Unity version: 2018.4.18f Google Dependency Resolver version: 1.2.153 Amplitude SDk version: 2.27.0