Travis Griggs
08/18/2021, 11:49 PMBase64.decode("eF4Nzr1NBDEQQGEjQXot3FZw8nj8mxIcyUIAghTNeMawWsHB7SJ0HVABvdEANRDi_HvSO9s-0ki3o77vp7s8PrT7WU_m_Pfv5-v7Qj7UbKyiUCGEQiASLETHDBI4i8ekIXOBVCNgspxraYKIvrYQsYSKVIEzOxsokDbffZHCyQljlqjFJ3HNN6kdFK-xiPfJZhbHVYmsBfNGy9KnwGw92F5WdMm21neeD8s6idnsrk_D5fQ07Gkdro6q83Cj6-fhOJtXelFj_gHcOkP7", Base64.NO_PADDING or Base64.NO_WRAP or Base64.URL_SAFE)
In an InstrumentTest (so runs on the device) works fine. But run it from a simple unit test (which runs on the development box--mac os in this case--i believe), and it fails. returns null every time. Gives me the heeby jeebies about relying on unit tests.Panini
08/19/2021, 12:46 AMephemient
08/19/2021, 12:56 AMandroid.testOptions.unitTests.returnDefaultValues = false
(the default), the stub Android framework will throw exceptions in local unit tests. you must have set it to true
somewhere, which will cause those framework stub methods to return 0/null. see https://developer.android.com/training/testing/unit-testing/local-unit-tests for more detailstrevjones
08/19/2021, 1:35 AMephemient
08/19/2021, 2:11 AMjava.util.Base64
which will work the same on desktop jvm and android. but okio.Base64 is nice and plays well with other okio constructs, if you're already using them that's an obvious choiceTravis Griggs
08/19/2021, 2:23 AMTower Guidev2
08/23/2021, 8:31 AMokio.Base64
in my current Android project, however I cannot identify which gradle dependency I require to include it in my project. Where am I going wrong???
I guessed it would be here implementation group: 'com.squareup.okio', name: 'okio', version: '3.0.0-alpha.9'