I have setup a native module where we manage the download lifecycle when a video downloads. The code haven’t change so far and after testing the app in virtual and physical devices with android version 12 and 13 a NullPointer Exceptions comes up and checking the debugger after passing the _offlineSourceConfig to _player.load(), and printing out what the player loaded, it returns null. However this not happen with online playback neither happen with android with version below or same of 11.
So I start answering the second numbered list, the steps are as follows:
We have a native module were we manage the downloads done in the react native layer, this works the way that when a user tab on download icon. a @ReactMethod in the native code triggers an instance of an OfflineContentManager that starts the listeners when getOptions() is called. When a download is successful, the offlineSourceConfig in send up through an event to React Native to eventually being kept in a database. When the user tabs on the downloaded videos and press on any video, the BitmovinVideoPlayerManager is called, passing in the @ReactProps the necessary config to play the video, in this case we send over the OfflineSourceConfigas a react prop, this is loaded in the player when is not null. Here the snippet code of that part:
This is working normally for android devices with android version lower that 11. however when I tested on an android phone with Android 12 or 13, I can see from logs (putting some printing outs everywhere) that when printing out _player.getSource() after runing _player.load(source); it returns a null value.
The curren bitmovin version SDK we are using is com.bitmovin.player:player:3.6.0
The compile and the Target SDK version we point to is 31.
The logcat using a virtual device with android 12.
12-06 11:41:13.419 7505 7529 W BugleRcsEngine: [46] alsz.g: Carrier Services Apk was not found.
12-06 11:41:13.419 7505 7529 I BugleRcsEngine: [46] alsz.e: Cannot get service version because CS.apk was not found, not pre-loaded or disabled.
12-06 11:41:13.420 7505 7529 W BugleRcsEngine: [46] alsz.e: Service with meta data key: JibeServiceApiVersions is not compatible. Service Version 1 is not supported. Supported versions: []
12-06 11:41:13.420 7505 7529 I BugleRcsEngine: [46] alsz.c: Not using CS JibeService because it is not compatible with AM.
12-06 11:41:13.422 6705 6748 I BugleRcsEngine: [57] ProvisioningEventReceiver.d: Received Provisioning Event: [Bugle information (100)]
12-06 11:41:13.422 6705 6748 I BugleRcsEngine: [57] ProvisioningEventReceiver.d: JibeService is running, passing event to provisioning engine.
12-06 11:41:13.426 1304 1304 D BoundBrokerSvc: onBind: Intent { act=com.google.android.gms.measurement.START pkg=com.google.android.gms }
12-06 11:41:13.426 1304 1304 D BoundBrokerSvc: Loading bound service for intent: Intent { act=com.google.android.gms.measurement.START pkg=com.google.android.gms }
12-06 11:41:13.428 1218 7764 W TapAndPay: platformSupportsGooglePay: true [CONTEXT service_id=79 ]
12-06 11:41:13.429 1218 7764 W TapAndPay: hasManagedProfile: false [CONTEXT service_id=79 ]
12-06 11:41:13.429 1218 7764 W TapAndPay: isChromeOsDevice: false [CONTEXT service_id=79 ]
12-06 11:41:13.429 1218 7764 W TapAndPay: isUncertifiedDevice: false [CONTEXT service_id=79 ]
12-06 11:41:13.429 1218 7764 W TapAndPay: deviceSupportsTokenization: true [CONTEXT service_id=79 ]
12-06 11:41:13.429 1218 7764 W TapAndPay: isGooglePayEnabled: true [CONTEXT service_id=79 ]
12-06 11:41:13.484 7505 7535 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.484 7505 7808 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.486 7505 7808 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.486 7505 7808 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.486 7505 7808 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.486 7505 7808 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.487 7505 7808 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.487 7505 7808 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.487 7505 7808 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.487 7505 7808 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.487 7505 7808 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.488 7505 7808 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.488 7505 7808 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.488 7505 7808 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.488 7505 7808 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.488 7505 7808 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.488 7505 7808 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.488 7505 7808 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.489 7505 7808 E bcdt : RuntimeException while executing runnable bcgm{arwo@65f27c2} with executor MoreExecutors.directExecutor()
12-06 11:41:13.489 7505 7808 E bcdt : java.lang.NullPointerException: Attempt to read from field 'java.lang.String aqxn.b' on a null object reference
12-06 11:41:13.489 7505 7808 E bcdt : at arwo.b(PG:2)
12-06 11:41:13.489 7505 7808 E bcdt : at bcgm.run(PG:7)
12-06 11:41:13.489 7505 7808 E bcdt : at bcfq.execute(PG:1)
12-06 11:41:13.489 7505 7808 E bcdt : at bcdt.p(PG:1)
12-06 11:41:13.489 7505 7808 E bcdt : at bcdt.a(PG:6)
12-06 11:41:13.489 7505 7808 E bcdt : at bcgs.q(PG:2)
12-06 11:41:13.489 7505 7808 E bcdt : at arwq.h(PG:16)
12-06 11:41:13.489 7505 7808 E bcdt : at thv.h(PG:2)
12-06 11:41:13.489 7505 7808 E bcdt : at arcm.p(PG:3)
12-06 11:41:13.489 7505 7808 E bcdt : at arcm.q(PG:1)
12-06 11:41:13.489 7505 7808 E bcdt : at arcm.h(PG:1)
12-06 11:41:13.489 7505 7808 E bcdt : at arxl.a(PG:1)
12-06 11:41:13.489 7505 7808 E bcdt : at bcib.c(PG:1)
12-06 11:41:13.489 7505 7808 E bcdt : at bchf.run(PG:4)
12-06 11:41:13.489 7505 7808 E bcdt : at bcid.run(PG:1)
12-06 11:41:13.489 7505 7808 E bcdt : at aosz.run(PG:1)
12-06 11:41:13.489 7505 7808 E bcdt : at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
12-06 11:41:13.489 7505 7808 E bcdt : at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
12-06 11:41:13.489 7505 7808 E bcdt : at aosl.run(PG:2)
12-06 11:41:13.489 7505 7808 E bcdt : at aory.run(PG:3)
12-06 11:41:13.489 7505 7808 E bcdt : at java.lang.Thread.run(Thread.java:920)
12-06 11:41:13.489 7505 7808 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.489 7505 7808 E bcdt : RuntimeException while executing runnable bcgm{arwo@b921910} with executor MoreExecutors.directExecutor()
12-06 11:41:13.489 7505 7808 E bcdt : java.lang.NullPointerException: Attempt to read from field 'java.lang.String aqxn.b' on a null object reference
12-06 11:41:13.489 7505 7808 E bcdt : at arwo.b(PG:2)
12-06 11:41:13.489 7505 7808 E bcdt : at bcgm.run(PG:7)
12-06 11:41:13.489 7505 7808 E bcdt : at bcfq.execute(PG:1)
12-06 11:41:13.489 7505 7808 E bcdt : at bcdt.p(PG:1)
12-06 11:41:13.489 7505 7808 E bcdt : at bcdt.a(PG:6)
12-06 11:41:13.489 7505 7808 E bcdt : at bcgs.q(PG:2)
12-06 11:41:13.489 7505 7808 E bcdt : at arwq.h(PG:16)
12-06 11:41:13.489 7505 7808 E bcdt : at thv.h(PG:2)
12-06 11:41:13.489 7505 7808 E bcdt : at arcm.p(PG:3)
12-06 11:41:13.489 7505 7808 E bcdt : at arcm.q(PG:1)
12-06 11:41:13.489 7505 7808 E bcdt : at arcm.h(PG:1)
12-06 11:41:13.489 7505 7808 E bcdt : at arxl.a(PG:1)
12-06 11:41:13.489 7505 7808 E bcdt : at bcib.c(PG:1)
12-06 11:41:13.489 7505 7808 E bcdt : at bchf.run(PG:4)
12-06 11:41:13.489 7505 7808 E bcdt : at bcid.run(PG:1)
12-06 11:41:13.489 7505 7808 E bcdt : at aosz.run(PG:1)
12-06 11:41:13.489 7505 7808 E bcdt : at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
12-06 11:41:13.489 7505 7808 E bcdt : at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
12-06 11:41:13.489 7505 7808 E bcdt : at aosl.run(PG:2)
12-06 11:41:13.489 7505 7808 E bcdt : at aory.run(PG:3)
12-06 11:41:13.489 7505 7808 E bcdt : at java.lang.Thread.run(Thread.java:920)
12-06 11:41:13.489 7505 7535 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.489 7505 7535 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.489 7505 7535 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.490 7505 7535 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.490 7505 7535 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.490 7505 7535 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.490 7505 7535 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.490 7505 7535 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.491 7505 7535 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.491 7505 7535 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.491 7505 7535 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.491 7505 7535 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.498 7505 7535 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.499 7505 7535 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.499 7505 7535 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.499 7505 7535 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.499 7505 7535 E bcdt : RuntimeException while executing runnable bcgm{arwo@6f8104b} with executor MoreExecutors.directExecutor()
12-06 11:41:13.499 7505 7535 E bcdt : java.lang.NullPointerException: Attempt to read from field 'java.lang.String aqxn.b' on a null object reference
12-06 11:41:13.499 7505 7535 E bcdt : at arwo.b(PG:2)
12-06 11:41:13.499 7505 7535 E bcdt : at bcgm.run(PG:7)
12-06 11:41:13.499 7505 7535 E bcdt : at bcfq.execute(PG:1)
12-06 11:41:13.499 7505 7535 E bcdt : at bcdt.p(PG:1)
12-06 11:41:13.499 7505 7535 E bcdt : at bcdt.a(PG:6)
12-06 11:41:13.499 7505 7535 E bcdt : at bcgs.q(PG:2)
12-06 11:41:13.499 7505 7535 E bcdt : at arwq.h(PG:16)
12-06 11:41:13.499 7505 7535 E bcdt : at thv.h(PG:2)
12-06 11:41:13.499 7505 7535 E bcdt : at arcm.p(PG:3)
12-06 11:41:13.499 7505 7535 E bcdt : at arcm.q(PG:1)
12-06 11:41:13.499 7505 7535 E bcdt : at arcm.h(PG:2)
12-06 11:41:13.499 7505 7535 E bcdt : at arxl.a(PG:1)
12-06 11:41:13.499 7505 7535 E bcdt : at bcib.c(PG:1)
12-06 11:41:13.499 7505 7535 E bcdt : at bchf.run(PG:4)
12-06 11:41:13.499 7505 7535 E bcdt : at bcid.run(PG:1)
12-06 11:41:13.499 7505 7535 E bcdt : at aosz.run(PG:1)
12-06 11:41:13.499 7505 7535 E bcdt : at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
12-06 11:41:13.499 7505 7535 E bcdt : at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
12-06 11:41:13.499 7505 7535 E bcdt : at aosl.run(PG:2)
12-06 11:41:13.499 7505 7535 E bcdt : at aory.run(PG:3)
12-06 11:41:13.499 7505 7535 E bcdt : at java.lang.Thread.run(Thread.java:920)
12-06 11:41:13.500 7505 7535 E PhFileGroupPop: Failed to add file group
12-06 11:41:13.500 7505 7535 E bcdt : RuntimeException while executing runnable bcgm{arwo@edde341} with executor MoreExecutors.directExecutor()
12-06 11:41:13.500 7505 7535 E bcdt : java.lang.NullPointerException: Attempt to read from field 'java.lang.String aqxn.b' on a null object reference
12-06 11:41:13.500 7505 7535 E bcdt : at arwo.b(PG:2)
12-06 11:41:13.500 7505 7535 E bcdt : at bcgm.run(PG:7)
12-06 11:41:13.500 7505 7535 E bcdt : at bcfq.execute(PG:1)
12-06 11:41:13.500 7505 7535 E bcdt : at bcdt.p(PG:1)
12-06 11:41:13.500 7505 7535 E bcdt : at bcdt.a(PG:6)
12-06 11:41:13.500 7505 7535 E bcdt : at bcgs.q(PG:2)
12-06 11:41:13.500 7505 7535 E bcdt : at arwq.h(PG:16)
12-06 11:41:13.500 7505 7535 E bcdt : at thv.h(PG:2)
12-06 11:41:13.500 7505 7535 E bcdt : at arcm.p(PG:3)
12-06 11:41:13.500 7505 7535 E bcdt : at arcm.q(PG:1)
12-06 11:41:13.500 7505 7535 E bcdt : at arcm.h(PG:2)
12-06 11:41:13.500 7505 7535 E bcdt : at arxl.a(PG:1)
12-06 11:41:13.500 7505 7535 E bcdt : at bcib.c(PG:1)
12-06 11:41:13.500 7505 7535 E bcdt : at bchf.run(PG:4)
12-06 11:41:13.500 7505 7535 E bcdt : at bcid.run(PG:1)
12-06 11:41:13.500 7505 7535 E bcdt : at aosz.run(PG:1)
12-06 11:41:13.500 7505 7535 E bcdt : at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
12-06 11:41:13.500 7505 7535 E bcdt : at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
12-06 11:41:13.500 7505 7535 E bcdt : at aosl.run(PG:2)
12-06 11:41:13.500 7505 7535 E bcdt : at aory.run(PG:3)
12-06 11:41:13.500 7505 7535 E bcdt : at java.lang.Thread.run(Thread.java:920)
12-06 11:41:13.500 344 7818 D resolv : GetAddrInfoHandler::run: {100 786532 100 983140 10097 0}
12-06 11:41:13.500 344 7818 D resolv : resolv_getaddrinfo: explore_fqdn(): ai_family=0 ai_socktype=1 ai_protocol=6
12-06 11:41:13.501 344 7820 D resolv : doQuery: (1, 1)
12-06 11:41:13.501 344 7820 D resolv : res_nmkquery: (QUERY, IN, A)
12-06 11:41:13.501 344 7820 D resolv : res_nsend
12-06 11:41:13.501 344 7820 I resolv : resolv_cache_lookup: lookup
12-06 11:41:13.501 344 7820 I resolv : resolv_cache_lookup: NOT IN CACHE (STALE ENTRY 0x7a7b77053770DISCARDED)
12-06 11:41:13.501 344 7820 I resolv : _cache_remove_p: entry 41 removed (count=54)
12-06 11:41:13.501 344 7820 I resolv : resolv_populate_res_for_net: netid=100
12-06 11:41:13.502 344 7819 D resolv : doQuery: (1, 28)
12-06 11:41:13.502 344 7819 D resolv : res_nmkquery: (QUERY, IN, AAAA)
12-06 11:41:13.503 344 7819 D resolv : res_nsend
12-06 11:41:13.503 344 7819 I resolv : resolv_cache_lookup: lookup
12-06 11:41:13.503 344 7819 I resolv : resolv_cache_lookup: NOT IN CACHE (STALE ENTRY 0x7a7b8704c450DISCARDED)
12-06 11:41:13.503 344 7819 I resolv : _cache_remove_p: entry 40 removed (count=53)
12-06 11:41:13.503 344 7819 I resolv : resolv_populate_res_for_net: netid=100
12-06 11:41:13.503 344 7819 I resolv : res_stats_usable_server: NS stats: S 54 + E 0 + T 10 + I 0 = 64, rtt = 41, min_samples = 8
12-06 11:41:13.503 344 7819 I resolv : res_stats_usable_server: success rate 84
12-06 11:41:13.503 344 7819 D resolv : res_nsend: Querying server (# 1) address = 10.0.2.3:53
12-06 11:41:13.503 344 7819 D resolv : send_dg: new DG socket
12-06 11:41:13.510 344 7820 I resolv : res_stats_usable_server: NS stats: S 54 + E 0 + T 10 + I 0 = 64, rtt = 41, min_samples = 8
12-06 11:41:13.510 344 7820 I resolv : res_stats_usable_server: success rate 84
12-06 11:41:13.510 344 7820 D resolv : res_nsend: Querying server (# 1) address = 10.0.2.3:53
12-06 11:41:13.511 344 7820 D resolv : send_dg: new DG socket
12-06 11:41:13.511 344 7820 I resolv : get_timeout: using timeout of 5000 msec
12-06 11:41:13.512 344 7820 I resolv : retrying_poll: 57 retrying_poll
12-06 11:41:13.512 344 7819 I resolv : get_timeout: using timeout of 5000 msec
12-06 11:41:13.512 344 7819 I resolv : retrying_poll: 56 retrying_poll
So after some testing we realised that when the compile and target SDK java version was updated to 31 (which we needed in order that our app gets published in the play store) the issue is present, however when downgrade the SDK version (both compile and target) to 30 (it was the previous we were using), the offline playback was working correctly.
Hi @technology , thanks for providing additional insights. The mentioned behaviour could be related to a previously found Download functionality related bug when targeting Android SDK 31.
The bug is already fixed in Bitmovin player. Can you please test with latest Bitmovin player SDK 3.26.0 and verify if the issue is still happening?
Hi @technology , thanks for sharing this. The above error encountered with latest SDK seems related to the build environment and dependencies specially Kotlin and Gradle plugin.
Latest Bitmovin SDK has Kotlin 1.7.20 as dependency
The player version 3.18.0 which has the fix for Download use case for target API 31 has Kotlin 1.6.10 as dependency
The player version 3.6.0 used in your app has Kotlin 1.5.10 as dependency.
Upgrading Kotlin and/or gradle plugin to later version may help resolve the build issue. You can also try with version 3.18.0 (if the build works) instead of latest SDK and check the Download use case behaviour when targeting API 31.