Hi! I have a problem in release build of Android a...
# announcements
a
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
Do you have multiple environments?
a
Yes I have two flavour dev / release in project and for every of them i config environments development and production
f
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
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
Which SDK are you using? Kotlin?
a
yes
Copy code
implementation 'io.growthbook.sdk:GrowthBook:<version>'
f
Let me ask that team if someone can help
a
Ok, thanks
f
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
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
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
Do you mean that for this feature enabled every environments? Every environment is enabled .
this response contain android_pricing_screen
f
I see
m
Hi @able-tomato-67285 we will look what might be the issue, and will back to you asap
a
Hi, thanks
m
@able-tomato-67285 what version are you using?
a
Copy code
1.1.18
m
@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
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
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
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
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