question

Ashley sands avatar image
Ashley sands asked

PF Party Android Crash when built with SDK API Level 30+

Currently I'm in the process of implementing PlayFab Party for Android targeting SDK API Level 31 (as I believe this is the current minimal version accepted by Google Play Store (and increases to Level 33 in August https://developer.android.com/google/play/requirements/target-sdk )).

We are building for arm64 (arm64-v8a) and the test device is running Android 12 (API Level 31).

Upon calling PartyInitialize it returns a successful status shortly followed by crashing. Running 'Logcat' via adb to get the android log revels Abort message: 'Pointer tag for 0x7695f36700 was truncated, see 'https://source.android.com/devices/tech/debug/tagged-pointers'.' as the reason for the crash.

Full log

 06-14 18:47:51.615 10309 18965 18965 F DEBUG   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
 06-14 18:47:51.615 10309 18965 18965 F DEBUG   : Abort message: 'Pointer tag for 0x7695f36700 was truncated, see 'https://source.android.com/devices/tech/debug/tagged-pointers'.'
 06-14 18:47:51.615 10309 18965 18965 F DEBUG   :     x0  0000000000000000  x1  0000000000004a10  x2  0000000000000006  x3  00000077506a4500
 06-14 18:47:51.615 10309 18965 18965 F DEBUG   :     x4  8080808080808080  x5  8080808080808080  x6  8080808080808080  x7  8080808080808080
 06-14 18:47:51.615 10309 18965 18965 F DEBUG   :     x8  00000000000000f0  x9  59712bef56b51251  x10 0000000000000000  x11 ffffff80fffffbdf
 06-14 18:47:51.615 10309 18965 18965 F DEBUG   :     x12 0000000000000001  x13 0000000100000000  x14 00000076c797c2c4  x15 0000000000000048
 06-14 18:47:51.615 10309 18965 18965 F DEBUG   :     x16 00000079fd95c060  x17 00000079fd938680  x18 000000774ca92000  x19 0000000000004978
 06-14 18:47:51.615 10309 18965 18965 F DEBUG   :     x20 0000000000004a10  x21 00000000ffffffff  x22 00000077506a4858  x23 00000077506a45c8
 06-14 18:47:51.615 10309 18965 18965 F DEBUG   :     x24 b400007805200570  x25 00000077506a5000  x26 00000076dd2d0540  x27 00000076dc7f9d68
 06-14 18:47:51.615 10309 18965 18965 F DEBUG   :     x28 00000076dc7f9e28  x29 00000077506a4580
 06-14 18:47:51.615 10309 18965 18965 F DEBUG   :     lr  00000079fd8e866c  sp  00000077506a44e0  pc  00000079fd8e8698  pst 0000000000000000
 06-14 18:47:51.615 10309 18965 18965 F DEBUG   : backtrace:
 06-14 18:47:51.615 10309 18965 18965 F DEBUG   :       #00 pc 0000000000051698  /apex/com.android.runtime/lib64/bionic/libc.so (abort+168) (BuildId: 6697743033c2bdf7b5a5571266b37e03)
 06-14 18:47:51.615 10309 18965 18965 F DEBUG   :       #01 pc 000000000003dc6c  /apex/com.android.runtime/lib64/bionic/libc.so (free+108) (BuildId: 6697743033c2bdf7b5a5571266b37e03)
 06-14 18:47:51.615 10309 18965 18965 F DEBUG   :       #02 pc 00000000002c65cc  /data/app/~~_anZG3Mz1YTX8Aq0JW1low==/com.AMS.PFPartySL-jQrPOlqwcEsPRsuODxAPsA==/lib/arm64/libparty.so (BuildId: bd482bf360a12322fa96192e08903abda0948348)
 06-14 18:47:51.615 10309 18965 18965 F DEBUG   :       #03 pc 00000000002c6340  /data/app/~~_anZG3Mz1YTX8Aq0JW1low==/com.AMS.PFPartySL-jQrPOlqwcEsPRsuODxAPsA==/lib/arm64/libparty.so (BuildId: bd482bf360a12322fa96192e08903abda0948348)
 06-14 18:47:51.615 10309 18965 18965 F DEBUG   :       #04 pc 00000000003b96d4  /data/app/~~_anZG3Mz1YTX8Aq0JW1low==/com.AMS.PFPartySL-jQrPOlqwcEsPRsuODxAPsA==/lib/arm64/libparty.so (BuildId: bd482bf360a12322fa96192e08903abda0948348)
 06-14 18:47:51.615 10309 18965 18965 F DEBUG   :       #05 pc 0000000000276788  /data/app/~~_anZG3Mz1YTX8Aq0JW1low==/com.AMS.PFPartySL-jQrPOlqwcEsPRsuODxAPsA==/lib/arm64/libparty.so (PlayFabServiceManagerImpl::DoQosWork()+928) (BuildId: bd482bf360a12322fa96192e08903abda0948348)
 06-14 18:47:51.615 10309 18965 18965 F DEBUG   :       #06 pc 00000000002761d4  /data/app/~~_anZG3Mz1YTX8Aq0JW1low==/com.AMS.PFPartySL-jQrPOlqwcEsPRsuODxAPsA==/lib/arm64/libparty.so (PlayFabServiceManagerImpl::DoWork()+108) (BuildId: bd482bf360a12322fa96192e08903abda0948348)
 06-14 18:47:51.615 10309 18965 18965 F DEBUG   :       #07 pc 00000000002567cc  /data/app/~~_anZG3Mz1YTX8Aq0JW1low==/com.AMS.PFPartySL-jQrPOlqwcEsPRsuODxAPsA==/lib/arm64/libparty.so (NetworkManager::DoWork()+188) (BuildId: bd482bf360a12322fa96192e08903abda0948348)
 06-14 18:47:51.615 10309 18965 18965 F DEBUG   :       #08 pc 0000000000252a54  /data/app/~~_anZG3Mz1YTX8Aq0JW1low==/com.AMS.PFPartySL-jQrPOlqwcEsPRsuODxAPsA==/lib/arm64/libparty.so (NetworkManager::StaticThreadProc(void*)+140) (BuildId: bd482bf360a12322fa96192e08903abda0948348)
 06-14 18:47:51.615 10309 18965 18965 F DEBUG   :       #09 pc 00000000002622dc  /data/app/~~_anZG3Mz1YTX8Aq0JW1low==/com.AMS.PFPartySL-jQrPOlqwcEsPRsuODxAPsA==/lib/arm64/libparty.so (BuildId: bd482bf360a12322fa96192e08903abda0948348)
 06-14 18:47:51.615 10309 18965 18965 F DEBUG   :       #10 pc 00000000002629b4  /data/app/~~_anZG3Mz1YTX8Aq0JW1low==/com.AMS.PFPartySL-jQrPOlqwcEsPRsuODxAPsA==/lib/arm64/libparty.so (void* std::__ndk1::__thread_proxy >, unsigned int (*)(std::__ndk1::shared_ptr), std::__ndk1::shared_ptr > >(void*)+76) (BuildId: bd482bf360a12322fa96192e08903abda0948348)
 06-14 18:47:51.615 10309 18965 18965 F DEBUG   :       #11 pc 00000000000b6bac  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+312) (BuildId: 6697743033c2bdf7b5a5571266b37e03)
 06-14 18:47:51.615 10309 18965 18965 F DEBUG   :       #12 pc 00000000000531dc  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+68) (BuildId: 6697743033c2bdf7b5a5571266b37e03)

According to the link in the logs Tagged Pointers where introduced in Android SDK 30 and I've noticed that the mainifest.xml in the AAR is build with min SDK 26 Target SDK 28, so assume this is the cause of the error.

Furthermore, the link in the logs suggests that adding android:allowNativeHeapPointerTagging="false" to the application element may resolve the issue. However that results in Abort message: 'Scudo ERROR: corrupted chunk header at address 0x2000076968f5800

Full log

 06-15 15:56:02.765 10312  2099  2099 F DEBUG   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   : Abort message: 'Scudo ERROR: corrupted chunk header at address 0x2000076968f5800
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   : '
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   :     x0  0000000000000000  x1  0000000000000821  x2  0000000000000006  x3  0000007750751460
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   :     x4  0080808080808080  x5  0080808080808080  x6  0080808080808080  x7  8080808080808080
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   :     x8  00000000000000f0  x9  59712bef56b51251  x10 0000000000000000  x11 ffffff80fffffbdf
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   :     x12 0000000000000001  x13 0000000000000030  x14 0000000000000030  x15 0000000000000010
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   :     x16 00000079fd95c060  x17 00000079fd938680  x18 000000774fdc0000  x19 00000000000006c4
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   :     x20 0000000000000821  x21 00000000ffffffff  x22 0000000000000000  x23 00000077507515c8
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   :     x24 00000078052026b0  x25 0000007750752000  x26 00000076de6ce0f0  x27 00000076ddbf7918
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   :     x28 00000076ddbf79d8  x29 00000077507514e0
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   :     lr  00000079fd8e866c  sp  0000007750751440  pc  00000079fd8e8698  pst 0000000000000000
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   : backtrace:
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   :       #00 pc 0000000000051698  /apex/com.android.runtime/lib64/bionic/libc.so (abort+168) (BuildId: 6697743033c2bdf7b5a5571266b37e03)
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   :       #01 pc 0000000000041670  /apex/com.android.runtime/lib64/bionic/libc.so (scudo::die()+12) (BuildId: 6697743033c2bdf7b5a5571266b37e03)
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   :       #02 pc 0000000000041d88  /apex/com.android.runtime/lib64/bionic/libc.so (scudo::ScopedErrorReport::~ScopedErrorReport()+36) (BuildId: 6697743033c2bdf7b5a5571266b37e03)
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   :       #03 pc 0000000000041e5c  /apex/com.android.runtime/lib64/bionic/libc.so (scudo::reportHeaderCorruption(void*)+64) (BuildId: 6697743033c2bdf7b5a5571266b37e03)
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   :       #04 pc 0000000000043654  /apex/com.android.runtime/lib64/bionic/libc.so (scudo::Allocator::deallocate(void*, scudo::Chunk::Origin, unsigned long, unsigned long)+304) (BuildId: 6697743033c2bdf7b5a5571266b37e03)
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   :       #05 pc 00000000002c65cc  /data/app/~~gQAu8LrfVyabogDcPk4iRA==/com.AMS.PFPartySL-iOh3r7OkqawoX2-DY7ZLyg==/lib/arm64/libparty.so (BuildId: bd482bf360a12322fa96192e08903abda0948348)
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   :       #06 pc 00000000002c6340  /data/app/~~gQAu8LrfVyabogDcPk4iRA==/com.AMS.PFPartySL-iOh3r7OkqawoX2-DY7ZLyg==/lib/arm64/libparty.so (BuildId: bd482bf360a12322fa96192e08903abda0948348)
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   :       #07 pc 00000000003b96d4  /data/app/~~gQAu8LrfVyabogDcPk4iRA==/com.AMS.PFPartySL-iOh3r7OkqawoX2-DY7ZLyg==/lib/arm64/libparty.so (BuildId: bd482bf360a12322fa96192e08903abda0948348)
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   :       #08 pc 0000000000276788  /data/app/~~gQAu8LrfVyabogDcPk4iRA==/com.AMS.PFPartySL-iOh3r7OkqawoX2-DY7ZLyg==/lib/arm64/libparty.so (PlayFabServiceManagerImpl::DoQosWork()+928) (BuildId: bd482bf360a12322fa96192e08903abda0948348)
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   :       #09 pc 00000000002761d4  /data/app/~~gQAu8LrfVyabogDcPk4iRA==/com.AMS.PFPartySL-iOh3r7OkqawoX2-DY7ZLyg==/lib/arm64/libparty.so (PlayFabServiceManagerImpl::DoWork()+108) (BuildId: bd482bf360a12322fa96192e08903abda0948348)
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   :       #10 pc 00000000002567cc  /data/app/~~gQAu8LrfVyabogDcPk4iRA==/com.AMS.PFPartySL-iOh3r7OkqawoX2-DY7ZLyg==/lib/arm64/libparty.so (NetworkManager::DoWork()+188) (BuildId: bd482bf360a12322fa96192e08903abda0948348)
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   :       #11 pc 0000000000252a54  /data/app/~~gQAu8LrfVyabogDcPk4iRA==/com.AMS.PFPartySL-iOh3r7OkqawoX2-DY7ZLyg==/lib/arm64/libparty.so (NetworkManager::StaticThreadProc(void*)+140) (BuildId: bd482bf360a12322fa96192e08903abda0948348)
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   :       #12 pc 00000000002622dc  /data/app/~~gQAu8LrfVyabogDcPk4iRA==/com.AMS.PFPartySL-iOh3r7OkqawoX2-DY7ZLyg==/lib/arm64/libparty.so (BuildId: bd482bf360a12322fa96192e08903abda0948348)
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   :       #13 pc 00000000002629b4  /data/app/~~gQAu8LrfVyabogDcPk4iRA==/com.AMS.PFPartySL-iOh3r7OkqawoX2-DY7ZLyg==/lib/arm64/libparty.so (void* std::__ndk1::__thread_proxy >, unsigned int (*)(std::__ndk1::shared_ptr), std::__ndk1::shared_ptr > >(void*)+76) (BuildId: bd482bf360a12322fa96192e08903abda0948348)
 06-15 15:56:02.766 10312  2099  2099 F DEBUG   :       #14 pc 00000000000b6bac  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+312) (BuildId: 6697743033c2bdf7b5a5571266b37e03)

Just for completeness, I decided to call CreateLocalUser to see if its any different, of which it returns error code 4096 (`The Party library must be initialized.`) as expected and does NOT crash.

sdksandroid
1 comment
10 |1200

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

Xiao Zha avatar image Xiao Zha commented ·

Have you tested our party demo? If not, you can give it a try to see if the problem persists.

0 Likes 0 ·

1 Answer

·
Ashley sands avatar image
Ashley sands answered

Hi @Xiao Zha , so we had not tried it, however we decided to give it go to see if we could repo our issue.

To get the sample project to build has taken us the most part of 2 days, since the documention is lacking many details and seems to be fairly out of date. (On both learn.microsoft.com and in the repo itself (For both Android and iOS)). It was really quite a mission to get it to launch on my phone.

It’s a bit unclear where to put library files, there’s no mention of any of the files found in android-releases.zip in the documentation [https://learn.microsoft.com/en-us/gaming/playfab/features/multiplayer/networking/android-specific-requirements].

We started out with Android Studio 4, as it was already installed on my system. However I couldn’t get Gradle to sync, I tried updating Gradle and its plugin version, but nothing worked. It kept giving me some can’t find method error. With that said though, updating to Android Studio 2022.2 resolved the issue once we set the Gradle version to 7.6.1 and the plugin Version to 7.3.1. (Later, once I got it to compile, I received this warning Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.)

Once I got it sync and attempted to run it on my phone useing the default config and NDK version 23.1, I was immediately given a linting error regarding the target API level.

\android\PartySample\demo\build.gradle:9: Error: Google Play requires that apps target API level 31 or higher.

And I was also given a linker error to error: undefined symbol: PlayFabInternal::PlayFabSettings::titleId We just had to declare it in PlayfabManager.cpp.

I disabled the linting just to get it to deploy to my phone, and found that i could not enter my full title ID as the input only allows for 4 chars. I proceeded anyway hitting 'Android_User_1' which crashed my device as libParty.so was missing from the APK. This required me to add jniLibs.srcDirs '../../bin/release' to the sourceSets > main section of the build.gradle (:demo) file.

I also decided to bump the SDK versions numbers to that suggested by the linting error. (compile/targetSdkVersion: 31, minSdkVersion 26). And there where a few errors and warning, however I found none of them prevented it from building.

(for reference) 6064-31-issues.png

Instead when building I got Manifest merger failed with multiple errors => Apps targeting Android 12 and higher are required to specify an explicit value for 'android:exported'

I found that this had to be set to true to support the latest version of Android. Otherwise it wont launch.

Launching the app and pressing 'Android_User_1' now results in java.lang.ClassNotFoundException: Didn't find class "com.microsoft.playfab.utilities.AndroidJniHelper" on path: DexPathList[ ... ]

I tried a few things but was unable to get passed this point. The thing that worked in my own implementation was to include the classes.jar found in the AAR. However it just didn't work here. And to be honest at this point i should of attempted to include the AAR, however i just dont have enough time at the moment to continue.

I do believe that once you get passed this error, you will be able to reproduce my error using NDK 25.1 (NDK 25b) and going by the NDK revision history you might be able to reproduce it with NDK 24 too. [https://developer.android.com/ndk/downloads/revision_history] (TBH, I forgot to mention this in my OP, mb)

This has been a bit of mission and TBH not what I expect from an example project


31-issues.png (111.6 KiB)
a12-exported.png (50.0 KiB)
2 comments
10 |1200

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

Xiao Zha avatar image Xiao Zha commented ·

Thank you for the test information. I will do some research.

0 Likes 0 ·
Ashley sands avatar image Ashley sands Xiao Zha commented ·

Hi Xiao Zha, thanks for your response. I really appreciate that you will have a look into it!

On a reflection, I do have to apologise for the tone of my original response (which I’ve now amended). It was written in moment, while I was still quite frustrated and feeling no closer to getting my issue resolved.

I would be quite happy open a PR on GitHub with my changes, however someone would have to fix the final issue to get it working again.

1 Like 1 ·

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.