2016年5月2日月曜日

Include GooglePlayServices aar library to the Titanium Module

On Android development, there is a limit of methods 64k.

If you want to include GooglePlayServices, it easy to reach the limit.
Basically using Gradle on the Android Studio, it is common to build GooglePlayServices partially, but if you are making Titanium Module, it's a bit difficult to include that.

At first install Android SDK, see the folder $SDK_ROOT/extras/google/m2repository/com/google/m2repository/com/google/android/gms/

Maybe you want to include some of these libraries. You must include
play-services-base and play-services-basement.

For example use play-services-base.

Open the folder inside that, ok, use 8.4.0 folder. open it.

Copy play-services-base-8.4.0.aar to the other folder and rename .aar to zip.
and extract that.
We use only classes.jar file and res folder. Rename classes.jar to play-services-base-8.4.0.jar

Try these steps to the another libraries you want to include.


Next, open  Appcelerator Studio and create new Module Project for GooglePlayServices.

Open the module folder and copy all .jar file we created the first step to the lib folder.

Copy all res folder to the platform folder inside the module folder as well.
(if there are multiple libs merge res folders instead of overwrite)

Ok, it's ready. run build.xml with Ant Build and include the module to your project.


0 件のコメント:

コメントを投稿