distriqt / ANE-Adverts-Mediation

Mediation adapters for the Adverts ANE
https://airnativeextensions.com/extension/com.distriqt.Adverts
12 stars 0 forks source link

iPhone 7 crashes when UnityAds ANE is included. #69

Closed funyamora closed 5 months ago

funyamora commented 5 months ago

iPhone 7 Plus crashes when UnityAds ANE is included. This problem does not occur on iPhone 14.

Environment
Project.apm

project.apm.zip

Logs
Translated Report (Full Report Below)
-------------------------------------

Incident Identifier: B40D28DF-4E51-4FB0-BFD4-A15F9878942B
CrashReporter Key:   f6294c8289fd2c84f05eb830315a9c6f2b335ada
Hardware Model:      iPhone9,2
Process:             MyApplication [58847]
Path:                /private/var/containers/Bundle/Application/569F4ACA-90D3-48AD-8C55-6B54AA6256A8/MyApplication.app/MyApplication

Identifier:          com.example.testapp
Version:             1.0.0 (1.0.0)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.example.testapp [618]

Date/Time:           2024-05-30 16:40:04.7426 +0900
Launch Time:         2024-05-30 16:40:04.7108 +0900
OS Version:          iPhone OS 15.7.1 (19H117)
Release Type:        User
Baseband Version:    9.61.00
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Reason: DYLD 4 Symbol missing
Symbol not found: (_$s7Network11NWInterfaceV13InterfaceTypeO4wifiyA2EmFWC)
Referenced from: '/Volumes/VOLUME/*/MyApplication.app/MyApplication'
Expected in: '/System/Library/Frameworks/Network.framework/Network'
(terminated at launch; ignore backtrace)

Triggered by Thread:  0

Thread 0 Crashed:
0   dyld                                   0x10386f2cc __abort_with_payload + 8
1   dyld                                   0x1038746dc abort_with_payload_wrapper_internal + 99
2   dyld                                   0x10387470c abort_with_payload + 11
3   dyld                                   0x103848aa8 dyld4::halt(char const*) + 575
4   dyld                                   0x103845e44 dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 3107
5   dyld                                   0x1038444b0 start + 411

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000006   x1: 0x0000000000000004   x2: 0x000000016dac9888   x3: 0x00000000000000f0
    x4: 0x000000016dac9488   x5: 0x0000000000000000   x6: 0x0000000000000000   x7: 0x000000016dac8f10
    x8: 0x0000000000000020   x9: 0x0000000000000009  x10: 0x000000016dac9568  x11: 0x0000000000000114
   x12: 0x63696c707041794d  x13: 0x70612e6e6f697461  x14: 0x6c707041794d2f70  x15: 0x006e6f6974616369
   x16: 0x0000000000000209  x17: 0x00000000000000c0  x18: 0x0000000000000000  x19: 0x0000000000000000
   x20: 0x000000016dac9488  x21: 0x00000000000000f0  x22: 0x000000016dac9888  x23: 0x0000000000000004
   x24: 0x0000000000000006  x25: 0x000000016dac9488  x26: 0x0000000000000400  x27: 0x0000000000000400
   x28: 0x00000000000000e0   fp: 0x000000016dac9450   lr: 0x00000001038746dc
    sp: 0x000000016dac9410   pc: 0x000000010386f2cc cpsr: 0x00000000
   far: 0x0000000103630000  esr: 0x56000080  Address size fault

Binary Images:
       0x10382c000 -        0x10387ffff dyld arm64  <f8257149b80f3fad90a4655fa1e964e0> /usr/lib/dyld

EOF

-----------
Full Report
-----------

{"app_name":"MyApplication","timestamp":"2024-05-30 16:40:05.00 +0900","app_version":"1.0.0","slice_uuid":"8b8b98bc-641f-3cdb-be20-3e89f122b6f7","build_version":"1.0.0","platform":"2","bundleID":"com.example.testapp","share_with_app_devs":"1","is_first_party":"0","bug_type":"309","os_version":"iPhone OS 15.7.1 (19H117)","incident_id":"B40D28DF-4E51-4FB0-BFD4-A15F9878942B","name":"MyApplication"}
{
"uptime": 650000,
"procLaunch": "2024-05-30 16:40:04.7108 +0900",
"procRole": "Foreground",
"version": 2,
"userID": 501,
"deployVersion": 210,
"modelCode": "iPhone9,2",
"procStartAbsTime": 15780057528146,
"coalitionID": 618,
"osVersion": {
"isEmbedded": true,
"train": "iPhone OS 15.7.1",
"releaseType": "User",
"build": "19H117"
},
"captureTime": "2024-05-30 16:40:04.7426 +0900",
"incident": "B40D28DF-4E51-4FB0-BFD4-A15F9878942B",
"bug_type": "309",
"pid": 58847,
"procExitAbsTime": 15780058255396,
"cpuType": "ARM-64",
"procName": "MyApplication",
"procPath": "/private/var/containers/Bundle/Application/569F4ACA-90D3-48AD-8C55-6B54AA6256A8/MyApplication.app/MyApplication",
"bundleInfo": {
"CFBundleShortVersionString": "1.0.0",
"CFBundleVersion": "1.0.0",
"CFBundleIdentifier": "com.example.testapp"
},
"storeInfo": {
"deviceIdentifierForVendor": "40516D6F-445B-4384-B357-D223E4A52A25",
"thirdParty": true
},
"parentProc": "launchd",
"parentPid": 1,
"coalitionName": "com.example.testapp",
"crashReporterKey": "f6294c8289fd2c84f05eb830315a9c6f2b335ada",
"basebandVersion": "9.61.00",
"isCorpse": 1,
"exception": {
"codes": "0x0000000000000000, 0x0000000000000000",
"rawCodes": [
0,
0
],
"type": "EXC_CRASH",
"signal": "SIGABRT"
},
"termination": {
"code": 4,
"flags": 518,
"namespace": "DYLD",
"indicator": "Symbol missing",
"details": [
"(terminated at launch; ignore backtrace)"
],
"reasons": [
"Symbol not found: (_$s7Network11NWInterfaceV13InterfaceTypeO4wifiyA2EmFWC)",
"Referenced from: '/Volumes/VOLUME/*/MyApplication.app/MyApplication'",
"Expected in: '/System/Library/Frameworks/Network.framework/Network'"
]
},
"faultingThread": 0,
"threads": [
{
"triggered": true,
"id": 2171656,
"threadState": {
"x": [
{
"value": 6
},
{
"value": 4
},
{
"value": 6134995080
},
{
"value": 240
},
{
"value": 6134994056
},
{
"value": 0
},
{
"value": 0
},
{
"value": 6134992656
},
{
"value": 32
},
{
"value": 9
},
{
"value": 6134994280
},
{
"value": 276
},
{
"value": 7163375912484960589
},
{
"value": 8097804656839324769
},
{
"value": 7813868779998097264
},
{
"value": 31084746152960873
},
{
"value": 521
},
{
"value": 192
},
{
"value": 0
},
{
"value": 0
},
{
"value": 6134994056
},
{
"value": 240
},
{
"value": 6134995080
},
{
"value": 4
},
{
"value": 6
},
{
"value": 6134994056
},
{
"value": 1024
},
{
"value": 1024
},
{
"value": 224
}
],
"flavor": "ARM_THREAD_STATE64",
"lr": {
"value": 4354164444
},
"cpsr": {
"value": 0
},
"fp": {
"value": 6134994000
},
"sp": {
"value": 6134993936
},
"esr": {
"value": 1442840704,
"description": " Address size fault"
},
"pc": {
"value": 4354142924,
"matchesCrashFrame": 1
},
"far": {
"value": 4351787008
}
},
"frames": [
{
"imageOffset": 275148,
"symbol": "__abort_with_payload",
"symbolLocation": 8,
"imageIndex": 0
},
{
"imageOffset": 296668,
"symbol": "abort_with_payload_wrapper_internal",
"symbolLocation": 99,
"imageIndex": 0
},
{
"imageOffset": 296716,
"symbol": "abort_with_payload",
"symbolLocation": 11,
"imageIndex": 0
},
{
"imageOffset": 117416,
"symbol": "dyld4::halt(char const*)",
"symbolLocation": 575,
"imageIndex": 0
},
{
"imageOffset": 106052,
"symbol": "dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*)",
"symbolLocation": 3107,
"imageIndex": 0
},
{
"imageOffset": 99504,
"symbol": "start",
"symbolLocation": 411,
"imageIndex": 0
}
]
}
],
"usedImages": [
{
"source": "P",
"arch": "arm64",
"base": 4353867776,
"size": 344064,
"uuid": "f8257149-b80f-3fad-90a4-655fa1e964e0",
"path": "/usr/lib/dyld",
"name": "dyld"
}
],
"sharedCache": {
"base": 6443909120,
"size": 2342535168,
"uuid": "5d76184b-f468-3f74-ba07-4fbba8fe5eb4"
},
"vmSummary": "ReadOnly portion of Libraries: Total=780.5M resident=0K(0%) swapped_out_or_unallocated=780.5M(100%)\nWritable regions: Total=3328K written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=3328K(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nSTACK GUARD                         16K        1 \nStack                             1008K        1 \nVM_ALLOCATE                         16K        1 \n__CTF                               756        1 \n__DATA                            21.6M      632 \n__DATA_CONST                      55.2M      651 \n__DATA_DIRTY                      2558K      546 \n__FONT_DATA                          4K        1 \n__LINKEDIT                       187.1M        3 \n__OBJC_RO                         92.1M        1 \n__OBJC_RW                         3536K        1 \n__TEXT                           593.4M      657 \n__UNICODE                          592K        1 \ndyld private memory               2048K        2 \n===========                     =======  ======= \nTOTAL                            958.9M     2499 \n",
"legacyInfo": {
"threadTriggered": {}
},
"trialInfo": {
"rollouts": [
{
"rolloutId": "610d4ab6fc54bc33898403cd",
"factorPackIds": {
"SIRI_UNDERSTANDING_MORPHUN": "6201e7dc295c182621ecf027"
},
"deploymentId": 240000268
},
{
"rolloutId": "63582c5f8a53461413999550",
"factorPackIds": {},
"deploymentId": 240000002
}
],
"experiments": []
}
}
marchbold commented 5 months ago

When exactly does this crash occur? Can you give us some hints as to how to replicate?

funyamora commented 5 months ago

When I tap on the app icon it crashes immediately.

fix89 commented 5 months ago

The same with us, with a lot of devices. Seems with iOS 16

marchbold commented 5 months ago

What is the minimum version you are supporting? Have you increased this to 12? i.e. have the following in your info additions:

<key>MinimumOSVersion</key>
<string>12.0</string>
marchbold commented 5 months ago

Could you try this build for me:

https://drive.google.com/file/d/1gdD4Ug1WpDosPAxsIAdnt6uF-FSo14F6/view?usp=sharing

funyamora commented 5 months ago

Thnaks. The crash on startup has been fixed. However, the sample app still crashes when calling the UnityAdsTests#init method.

https://github.com/distriqt/ANE-Adverts-Mediation/assets/1825639/47e92330-ac77-4c15-85bf-ad3cd8ed64d6

marchbold commented 5 months ago

Can you post the logs from the device please?

funyamora commented 5 months ago

Sorry. Here is the device logs.

MyApplication-2024-06-07-100212.ips.txt

cleverbeapps commented 5 months ago
MinimumOSVersion

this does not help me. Still have a crash on startup. Device: iPhone14ProMax OS: 16.2 SDK: 51.0.1.2 Log: crash.txt

marchbold commented 5 months ago

@cleverbeapps Did you try the updated extension as well as the minimum os version?

cleverbeapps commented 5 months ago

@marchbold Yes, I've tried

In the descriptor:

MinimumOSVersion 12.0

In the project.apm: { "version": "4.11.300", "id": "com.distriqt.admob.UnityAds" }, { "version": "15.1.1", "id": "com.distriqt.Adverts" }

cleverbeapps commented 5 months ago

@marchbold this is correct crash logs: crash.txt

cleverbeapps commented 5 months ago

@marchbold Seems this is the reason: "ASI found [dyld] (sensitive) 'Symbol not found: _$s7Network11NWInterfaceV13InterfaceTypeO4wifiyA2EmFWC Referenced from: <27C59932-9C00-3349-A2C6-D405F60978CE> /private/var/containers/Bundle/Application/7B562144-FE1D-42AD-BCA3-05D53502D096/MySuperGame.app/MySuperGame Expected in: <0B5F0378-B7CD-350A-8E30-D60D2B74466D> /System/Library/Frameworks/Network.framework/Network'"

marchbold commented 5 months ago

@cleverbeapps Did you replace the ane from apm with the one above? Its a beta version that should solve that issue.

cleverbeapps commented 5 months ago

@marchbold Oh, I missed this one. Yes, with this build, the startup crash disappears. Could you help me, please, I have questions:

1) I saw in your example consent sdk calls: Adverts.service.consent.addEventListener( ConsentEvent.STATUS_UPDATED, statusUpdatedHandler ); Adverts.service.consent.addEventListener( ConsentEvent.STATUS_ERROR, statusErrorHandler ); Adverts.service.consent.getConsentStatus( Config.admob_publisherId ); so, there are two handlers, but both never triggered for me. Is it normal? In general, is it crucial to add getConsentStatus/askForConsent logic, or ads can be served without consent? Is there any relation between IDFA and Consent or these things are different and not dependent on each other?

2) as I understood, the only way how to check if mediation is implemented and works correctly on the device, is to call Adverts.service.openAdInspector(); and check statuses there. Is it correct? (by the way, Adverts.service.openAdInspector() leads to crash for now, if you invoke it after any ads were shown)

3) What is the need to call AdMobUnityAds.instance.setConsent(true); AdMobIronSource.instance.setConsent(true) I mean is it optional or it is better always to have this call? Is there any chaining in logic, for example, first to call getConsentStatus() then call setConsent('value form getConsentStatus')

These things are a little bit confusing. Thank you.

marchbold commented 5 months ago

@cleverbeapps Can you post your questions in a separate issue?

funyamora commented 5 months ago

@marchbold This issue is not resolved. I hope it doesn't close yet. Always occurs on iOS15

marchbold commented 5 months ago

@funyamora Can you elaborate? Our tests with the latest release have resolved this issue.

funyamora commented 5 months ago

@marchbold It is not resolved even with the latest release v7.0.1. The situation remains the same, and it crashes when I run the sample project UnityAdsTests#init. This always occurs on iOS15, but there is no problem on iOS17. https://github.com/distriqt/ANE-Adverts-Mediation/issues/69#issuecomment-2151535401

Here are the logs and apm. apm_and_logs.zip

marchbold commented 5 months ago

@funyamora Okay, I'll open a new issue with these details, as this is a different issue to the original one around the Network dependency.