{"id":21110114,"url":"https://github.com/stroeer/firebase-taboola-arn-example","last_synced_at":"2025-03-14T09:42:07.021Z","repository":{"id":253241997,"uuid":"842906099","full_name":"stroeer/firebase-taboola-arn-example","owner":"stroeer","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-25T16:48:24.000Z","size":16668,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-19T19:15:09.514Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stroeer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-15T11:07:26.000Z","updated_at":"2024-09-23T11:38:11.000Z","dependencies_parsed_at":"2024-08-15T13:04:44.316Z","dependency_job_id":"4009adcc-d554-4f12-8696-242b406e820c","html_url":"https://github.com/stroeer/firebase-taboola-arn-example","commit_stats":null,"previous_names":["stroeer/firebase-taboola-arn-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stroeer%2Ffirebase-taboola-arn-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stroeer%2Ffirebase-taboola-arn-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stroeer%2Ffirebase-taboola-arn-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stroeer%2Ffirebase-taboola-arn-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stroeer","download_url":"https://codeload.github.com/stroeer/firebase-taboola-arn-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234892724,"owners_count":18902907,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T00:57:49.827Z","updated_at":"2025-01-21T04:13:01.099Z","avatar_url":"https://github.com/stroeer.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reproducible example for [firebase-android-sdk#4831](https://github.com/firebase/firebase-android-sdk/issues/4831)\n\n\u003e ANR on app launch at com.google.firebase.perf.config.ConfigResolver.getInstance\n\nThe bug is also known at Taboola, [see archived thread in their support forums](https://web.archive.org/web/20240418075027/https://developers.taboola.com/taboolasdk/discuss/6513fe7b5b7e16002aaf8a44).\n\n## What happens\n\nThis is an app that renders a webview. When you open the app once, everything looks alright.\n\nWhen you open the app a second time, it will freeze upon starting and crash at some point.\n\nFrom this point on you can never open the app again.\n\n**Expected behavior** You can open the app more than once\n\n**Actual behavior** When you open the app for a second time you get a freeze and an eventual crash. This behaviour then persists.\n\n## Steps to reproduce\n\nTo reproduce the bug we use\n\n- Expo (react-native)\n- Firebase Performance SDK\n- Taboola Android SDK\n- A WebView\n- TCF Consent (probably to permit specific network requests)\n\n### Build the app\n\n```sh\n# Install dependencies\nyarn\n\n# Create Andoid project at `example-app/android`\nyarn prebuild:android\n\n# Build the android object as an debuggable apk\n# The apk will be written to\n# `example-app/android/app/build/outputs/apk/debug/app-debug.apk`\nyarn build:android\n```\n\n### Start the app\n\n1. Open an Android Emulator\n1. Install the apk. For convenience, you can use `yarn install:android`\n1. Start the react-native dev server (Metro) `yarn dev`\n1. Open the app on the emulator\n1. Close the app\n1. Open the app again\n1. 💥\n\n---\n\n# Additional information\n\nWe can reproduce this be using the Taboola SDK with a WebView that gets rendered at startup (which cused this issue for us).\n\nIf you take any of these components away\n\n- Firebase Performance SDK\n- Taboola\n- The WebView\n- TCF Consent\n\nThe app will work.\n\nThe original issue suggests that this is caused by network requests happending before Firebase gets initialized.\n\nTaboola knows about this issue and suggests changing the Android init order as a workaround (see [linked support thread](https://web.archive.org/web/20240418075027/https://developers.taboola.com/taboolasdk/discuss/6513fe7b5b7e16002aaf8a44)), which points in the same direction.\n\n\u003e My personal interpretation here is that after the app has started once, Taboola has been established and will start a\n\u003e network request during the next start before Firebase is fully initialized and the app will run into a deadlock.\n\n- Firebase is the issue\n- Taboola will cause the network request but only via WebView and only with consent (TCF)\n\n#### ANR File from a tombstone\n\nBy inpsecting the Android tombstone, you will find a potential deadlock that in the main thread caused by the Firebase Performance SDK.\n\nThis file from a Tombstone after a freeze / crash is included in this repo: [`anr_2024-09-12-15-22-21-145`](./anr_2024-09-12-15-22-21-145)\n\n```\n----- pid 15409 at 2024-09-12 15:22:21.145074474+0200 -----\nCmd line: com.lukasbombachstroeer.firebasetaboolaarnexample\nBuild fingerprint: 'google/sdk_gphone64_arm64/emu64a:15/AP31.240617.003/12088229:user/release-keys'\nABI: 'arm64'\nBuild type: optimized\nDebug Store: 1,0,4107366::\nsuspend all histogram:\tSum: 33us 99% C.I. 0.080us-8us Avg: 2.538us Max: 8us\nDALVIK THREADS (25):\n\"main\" prio=5 tid=1 Blocked\n  | group=\"main\" sCount=1 ucsCount=0 flags=1 obj=0x71c6a9b8 self=0xb4000076de662380\n  | sysTid=15409 nice=-10 cgrp=top-app sched=0/0 handle=0x78f5a76d20\n  | state=S schedstat=( 252827325 15285081 198 ) utm=22 stm=2 core=1 HZ=100\n  | stack=0x7ff2d22000-0x7ff2d24000 stackSize=8188KB\n  | held mutexes=\n  at com.google.firebase.perf.config.ConfigResolver.getInstance(unavailable:2)\n  - waiting to lock \u003c0x02d05d9f\u003e (a java.lang.Class\u003ccom.google.firebase.perf.config.ConfigResolver\u003e) held by thread 18\n  at com.google.firebase.perf.FirebasePerfEarly.\u003cinit\u003e(FirebasePerfEarly.java:41)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstroeer%2Ffirebase-taboola-arn-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstroeer%2Ffirebase-taboola-arn-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstroeer%2Ffirebase-taboola-arn-example/lists"}