https://www.growthbook.io/ logo
#announcements
Title
# announcements
a

able-tomato-67285

12/22/2022, 7:41 PM
Hi! I have a problem in release build of Android app, when i test debug version all work fine and I can retrieve my configuration data from feature.value field. But when I prepare release build for store, I always receive null inside feature.value field. Can you suggest what could be the problem? Thanks.
f

fresh-football-47124

12/22/2022, 7:42 PM
Do you have multiple environments?
a

able-tomato-67285

12/22/2022, 7:45 PM
Yes I have two flavour dev / release in project and for every of them i config environments development and production
f

fresh-football-47124

12/22/2022, 7:46 PM
okay, so the feature endpoint is different for the testing and the release? are you sure the feature flag rules are the same for each environment?
a

able-tomato-67285

12/22/2022, 7:51 PM
No, feature endpoint is now configured the same for each environment, i set only default value. I test builds for every environments dev/prod. But issue appear only in signed release build that going with the flag debuggable false in gradle
Also I add configuration for proguard, same as described in your documentation
f

fresh-football-47124

12/22/2022, 7:58 PM
Which SDK are you using? Kotlin?
a

able-tomato-67285

12/22/2022, 8:01 PM
yes
Copy code
implementation 'io.growthbook.sdk:GrowthBook:<version>'
f

fresh-football-47124

12/22/2022, 8:01 PM
Let me ask that team if someone can help
a

able-tomato-67285

12/22/2022, 8:03 PM
Ok, thanks
f

fresh-football-47124

12/22/2022, 8:08 PM
I think its the middle of the night for them, but they’ll reach out soon
in the mean time, is there any extra debugging you can add? like do the user attributes get set before you’re calling to get the flag values?
a

able-tomato-67285

12/22/2022, 8:16 PM
In case it is release build any logs I can not see, but i try send report in configured instabug - i not see any errors there, only my log with value of feature that is null I not set any attributes, only apiKey = key_prod_be7a4d62202239e9 and hostUrl = https://cdn.growthbook.io/ I can add example of code that I add in project
Copy code
val growthBookSDK = GBSDKBuilderApp(apiKey = BuildConfig.GROWTHBOOK_API_KEY,
        hostURL = "<https://cdn.growthbook.io/>",
        attributes = HashMap()) { gbExperiment: GBExperiment?, gbExperimentResult: GBExperimentResult? ->
}.initialize()
val feature = growthBookSDK.feature("android_pricing_screen")
and then I use feature.value field
f

fresh-football-47124

12/22/2022, 8:19 PM
can you verify that from that API_KEY endpoint, that there is a feature called ‘android_pricing_screen’ and paste what the rules are?
a

able-tomato-67285

12/22/2022, 8:33 PM
Do you mean that for this feature enabled every environments? Every environment is enabled .
this response contain android_pricing_screen
f

fresh-football-47124

12/22/2022, 10:06 PM
I see
m

most-spoon-61816

12/23/2022, 10:37 AM
Hi @able-tomato-67285 we will look what might be the issue, and will back to you asap
a

able-tomato-67285

12/23/2022, 10:37 AM
Hi, thanks
m

most-spoon-61816

12/23/2022, 10:42 AM
@able-tomato-67285 what version are you using?
a

able-tomato-67285

12/23/2022, 10:50 AM
Copy code
1.1.18
m

most-spoon-61816

12/23/2022, 4:13 PM
@able-tomato-67285 may you please clarify as well if this is happening all the time, or only on first launch in release mode?
a

able-tomato-67285

12/23/2022, 5:33 PM
it happening all the time for release build, i also find that it work if i set in gradle flag debugable = true and prepare signed apk
but I could not upload this vesrion to google play
Maybe something wrong with proguard configuration file? I add this code for proguard
Copy code
-keep class com.sdk.growthbook.** { *; }

-keepattributes *Annotation*, InnerClasses
-dontnote kotlinx.serialization.SerializationKt
-keep,includedescriptorclasses class com.sdk.growthbook.**$$serializer { *; }
-keepclassmembers class com.sdk.growthbook.** {
    *** Companion;
}
m

most-spoon-61816

12/23/2022, 6:25 PM
We tried in release mode on our side and everything works well (with your feature config) Yes it might be related to configs Have you tried on test project, is it also not working?
a

able-tomato-67285

12/23/2022, 7:43 PM
Do you try in release mode with config
Copy code
minifyEnabled true
shrinkResources true
debuggable false 
? 

I not try in test project, because i testing  debug build / release with debuggable true and it works fine.
But when I upload build on google play store for beta testing I receive feedback that app not show settings that we config in Growthbook. Maybe you can help me with add additional config for proguard ?
m

most-spoon-61816

12/23/2022, 8:06 PM
Yes, we may try to help We will check it out with your config and back to you
Hello @able-tomato-67285 we have a temporal fix for you • Please copy content from https://github.com/growthbook/growthbook-kotlin/blob/main/GrowthBook/growthbook-proguard-rules.txt and paste into your project file called “proguard-rules.pro” We are working on fixing it in the next release. Let me know please if it helps @able-tomato-67285
19 Views