Merging Android Ultimate Plugin 1.7.1 on Google Play Services Part 2

Hi Guys, this is the continuation of my last post, last time we try to used both Android Ultimate Plugin version 1.7.1 with google play services that can be found on this link https://github.com/playgameservices/play-games-plugin-for-unity

and we encounter a lot of errors and we spend almost 2 days on finding a way on how to fix this plugin and libraries conflict and we found out the following check list

  1.  make sure all of your Android Manifest file in your project have the same min sdk value and target sdk value , as in every Android Manifest files search your whole project this usually is the caused of conflicts
  2. make sure your Android Manifest File that is using google play services is using this  meta  <meta-data android:name=”com.google.android.gms.version” android:value=”@integer/google_play_services_version” /> take note do not hardcode the version number and make sure that this meta tag is inside <Application TAG> not inside <Activity TAG>
  3.  if you have a values.xml with gms  with hardcoded version number inside just delete it , this values.xml file will just make everything worst
  4. See to it that the Android Plugin that you are using is using provided instead of compile on their Build.gradle dependency settings for classes.jar which is the jar that came from unity3d app directory. because if this is compile it will conflict on Unity3d Classes.jar because i think unity3d put classes.jar automatic when we build on Android

Some optional checklist that people says on stack overflow, unity3d forum and other forums

  1.  Right now  (  Unity3d version 5.5.1f1 ) the max  Android API support is 23 so delete the build tools and please don’t delete the SDK tools 🙂 just build tools greater than 23 API on your Android SDK.
  2.  Make sure your target SDK on your Android Manifest is declare unless unity3d will used the maximum SDK available on your machine.

And that’s the checklist and now back to using  both Android Ultimate Plugin and Google play services these are the steps

  1.  make sure all Android Manifest on your project is using this min sdk  and target sdk  <uses-sdk android:minSdkVersion=”9″ android:targetSdkVersion=”16″ />
  2.  Unity3d Player Settings should be set to minimum API 9 too
  3.  Make sure you use these exact libraries as of now we tested these and it works
  •  appcompat-v7-23.0.1.aar
  • support-v4-23.0.1.aar
  • play-services-games-9.2.1.aar
  • play-services-base-9.2.1.aar
  • play-services-basement-9.2.1

Note: some of these libraries are included when you import the google play services plugin

you can download these new libraries on this link because Unity3d  asset store for sure will not allow this libraries to be included on the plugin  https://drive.google.com/file/d/0Bw14w3QBZaGxek5haDNNeVNTRGc/view?usp=sharing

More Steps

  1.  check all the project.properties files in your project they all should used the same TargetSDK value if not you will have a conflict and it’s very high
  2.  find any values.xml lurking around with hard coded google play services values inside and delete them they create lot’s of problems
  3.  make sure you don’t have any duplicate Libraries jar,aar files and other library files they will introduce conflict as well.

And then after these changes we successfully build our project with both Android Ultimate Plugin and Google play Services and they work 🙂

The Game Sample with Google Play Services, Admob, Android Ultimate Plugin and Firebase Analytics

https://play.google.com/store/apps/details?id=com.gigadrillgames.fingervsants

here in this game we used both google play services and AUP , on share we use our plugin see it works 🙂

That’s it,  i hope this guide can help you find the problems and the conflict when using more android plugin in Unity3d Projects.

 

Update 02/12/2017

We have encounter some errors when building on xcode

Take Note this errors is came from the google play services not from our plugin to make things clear

For more details please follow read this link

http://www.gigadrillgames.com/2017/02/13/google-play-games-plugin-for-unity3d-possible-fixed-for-xcode-project/

 

for more questions or comments or suggestions just email us at gigadrillgames@gmail.com and if you have time please like our page https://www.facebook.com/gigadrillgames

Thanks for visiting and reading 🙂

 

 

 

 

Android Ultimate Plugin Major Changes 1.7.1 Part 1

Hi Guys! our Android Ultimate Plugin have Major Changes 1.7.1 that’s why I’m making this post today but don’t worry this changes only change the structure and the  way you used the plugin is still the same, so no need to worry 🙂

this is the new structure 1st level  Assets/Plugins/Android – in this directory you will see that we added a new folder called aup  where the android ultimate plugin files will move and we remove the old jars and library that we are using and we added a 5 new .aar files these libraries is our new dependencies so please remember them.

you can download these new libraries on this link because Unity3d  asset store for sure will not allow this libraries to be included on the plugin  https://drive.google.com/file/d/0Bw14w3QBZaGxek5haDNNeVNTRGc/view?usp=sharing

2nd level Assets/Plugins/Android/aup – inside this you will see the Android Manifest, libs folder, project.properties file, res folder and SampleAndroidManifest as you can see this is the same things that you see before the only difference is the AUP.jar now is inside the libs folder and we add the project.properties files to tell Unity3d that this directory is an Android Library.

Note: on res folder there’s a values folder inside and  we remove that reason it’s one of the reason why other plugin is not working when combine with Android Ultimate Plugin because it resets the API id to the old one .

Inside the libs folder you will the AUP.jar which is the jar of Android Ultimate Plugin

Note: please read and remember this new .aar libraries

Because of this changes we need to delete the followings files:

  1. google-play-services_lib
  2. android-support-v4.jar
  3. android-support-v7-appcompat.jar

And we add these new 5 .aar files

  1. appcompat-v7-23.0.1.aar
  2. support-v4-23.0.1.aar
  3. play-services-games-9.2.1.aar
  4. play-services-base-9.2.1.aar
  5. play-services-basement-9.2.1.aar

these .aar files can be found inside your Android SDK  the directory is “YOUR ANDROID SDK ROOT FOLDER”/extras/google/m2repository/com/google/android/gms inside these directory there’s a bunch of libraries see below image for reference. just check each one of them and take note the version is important it should be the same to avoid conflicts or any problem when building your project.

these are the libraries inside that directory and it’s a lot just used get what we need that’s why google make it that way because before everything is in one library (google-play-services_lib) and it’s too many if you just used few of them on your project its just a waste of storage and resources

Next the Support .aar files which is  appcompat-v7-23.0.1.aar and support-v4-23.0.1.aar , you can find it on this directory “YOUR_ANDROID_SDK_ROOT_FOLDER”/extras/android/m2repository/com/android/support inside this folder you will also see a lot of support libraries too, see the image below

during this post my next test is too try to used the google play services plugin from this link https://github.com/playgameservices/play-games-plugin-for-unity i know that most of you is using the same plugin for accessing the google play services, i will update this post or post a new one after my test if our plugin will play nice with it or will have a conflict or not

So that’s it for now , i hope this little information will make everything clear to you guys!

Combining Android Ultimate Plugin and Google Play Services continuation part 2 http://www.gigadrillgames.com/2017/01/31/merging-android-ultimate-plugin-1-7-1-on-google-play-services/

for more questions or suggestions or comments just email us at gigadrillgames@gmail.com

Thanks for visiting and reading Till next time! 🙂