question

contact@dojo-arcade.com avatar image
contact@dojo-arcade.com asked

Push Notifications problem, PlayFabAndroidPlugin.Init(senderID) Restarts the app when called.

Hello, 

I am setting up push notifications system in my game. I have succeeded enabling GCM and I had a successful response from Admin API SetupPushNotification.

I am trying to setup the client side and when I call PlayFabAndroidPlugin.Init(senderID); with a declared senderID the game is closed and opened again automatically. I tried to track it with the Dalvik Device Monitor Service (DDMS) and there is not any error. 

I had an unable to convert to dex file issue when building so I deleted a copy of support-v4.jar and play-services-7.8.0.jar, can this procedure create the error?

Thank You.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Zac Bragg avatar image
Zac Bragg Deactivated answered

Yes that will absolutely cause issues. It sounds like your application is trying to initialize the PushPlugin, and to do so, the app thinks it needs to restart, to reload the service, but then the files to load the service are not there. 

You need both of those files; however, Google recently made some changes that have introduced some complexity into getting push working. This is only an issue when using newer Android plugins / libraries. 

A couple questions:

  • Are you using our latest push plugin?
  • Your dex issue, is due to having 2 copies of the same android library in your project. What other plugins are you using?
  • Are your other plugins using .AAR or .JAR files?

 

 

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

contact@dojo-arcade.com avatar image
contact@dojo-arcade.com answered

Yes I am using the latest push plugin.

I am using google playgames plugin, playfab plugin and chartboost plugin, I think they are using both AAR and JAR files.

I have reimported the pplugin and on the build I get this error in the Unity console:

CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
C:/Program Files/Java/jdk1.8.0_40\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/MyUser/AppData/Local/Android/android-sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -

stderr[
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/actions/ItemListIntents;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/actions/NoteIntents;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/actions/ReserveIntents;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/actions/SearchIntents;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/ads/identifier/AdvertisingIdClient;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/ads/identifier/AdvertisingIdClient$Info;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/ads/identifier/AdvertisingIdClient$zza;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/auth/AccountChangeEvent;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/auth/AccountChangeEventsRequest;

UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Translation has been interrupted
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:608)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at SDKMain.main(SDKMain.java:129)
Caused by: java.lang.InterruptedException: Too many errors
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:600)
... 9 more
]
stdout[
processing archive C:\Users\MyFolder\Temp\StagingArea\android-libraries\ChartboostSDK\libs\.\chartboost.jar...
ignored resource META-INF/MANIFEST.MF
processing com/chartboost/sdk/CBImpressionActivity.class...
processing com/chartboost/sdk/CBImpressionActivity$1.class...
processing com/chartboost/sdk/CBImpressionActivity$2.class...
processing com/chartboost/sdk/CBLocation.class...
processing com/chartboost/sdk/Chartboost.class...

 

and a lot more of chartboost connected classes.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Zac Bragg avatar image
Zac Bragg Deactivated answered

Great!

Thanks for that information.

 

We are already looking into how best to restructure our plugin to be as accommodating as possible with other plugins. 

Thanks for your patience while we figure out how best to get your issue resolved as well as fix this issue at large. 

 

I  have not tried this yet, but look into this plugin for resolving your conflicts: https://github.com/googlesamples/unity-jar-resolver

Keep me posted if you get a chance to try it. I will be going through the code as well as time allows.

 

Best regards,

Zac 

 

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

contact@dojo-arcade.com avatar image
contact@dojo-arcade.com answered

I have contacted chartboost developers and the problem is that it is using play-services-9 while the playfab push plugin is using play-games-7.8.0 and this two jar files are clashing because they have classes in common.

Is there a way to let the playfab plugin use the latest play-services version instead of the play-games-7.8.0?

Thank you

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Zac Bragg avatar image
Zac Bragg Deactivated answered

Hello,

We rebuilt our plugin last week, to make our archives much easier to substitute. I have tested up to google-play-services 8.4. When testing with 9.0+ we have ran into issues. I am continuing to refactor our plugin to be more robust with the latest 9.2 releases.

Thanks for your patience,

Zac

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

contact@dojo-arcade.com avatar image
contact@dojo-arcade.com answered

I have downloaded the latest plugin version and it fixed the dex format issue. Thank you

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.