Closed burhanshakir closed 1 year ago
Hi,
Can you share your build.gradle release section so I can inspect the same configuration on my machine? In addition, I assume that "CNAME" is not the real value here...
Tal
Hey @tal-mi thanks, sure here's the release section:
release {
signingConfig = signingConfigs["upload"]
postprocessing {
proguardFiles += file("proguard-rules.pro")
isRemoveUnusedCode = true
isRemoveUnusedResources = true
isObfuscate = true
isOptimizeCode = true
}
buildConfigField(SapApiKey)
}
Yeah CNAME is just a placeholder and not the real value
And you are encountering this when trying to build the variant or trying to run a release-signed APK file? Just to be sure so I will run the same configuration on my test application. Thanks for the info.
Tal
@tal-mi No, the project builds fine, it's when running the APK on a device that causes the crash, and it's not just limited to a release signed variant, the same happens for any variant with the postprocessing flags enabled. The Dev variant here fails to work too:
create(BuildType.Dev) {
signingConfig = signingConfigs["debug"]
applicationIdSuffix = ".dev"
isDebuggable = true
postprocessing {
proguardFiles += file("proguard-rules.pro")
isRemoveUnusedCode = true
isRemoveUnusedResources = true
isObfuscate = true
isOptimizeCode = true
}
buildConfigField(SapApiKey)
}
Hi @tal-mi any updates on this ?
Updating isRemoveUnusedCode = false
seems to resolve this but this comes with its drawbacks. Can you please confirm if this is the only solution ?
Also this warning is thrown just before the crash occurs:
java.lang.InstantiationException: java.lang.Class<com.gigya.android.sdk.Gigya> has no zero argument constructor
at java.lang.Class.newInstance(Native Method)
at com.gigya.android.sdk.containers.IoCContainer.createInstance(IoCContainer.java:83)
at com.gigya.android.sdk.containers.IoCContainer.createInstance(IoCContainer.java:75)
at com.gigya.android.sdk.Gigya.getInstance(Gigya.java:130)
Not sure why this warning it thrown even though I am passing arguments when calling the getInstance
method
Gigya.setApplication(this)
Gigya.getInstance(UserAccountGigya::class.java).init(BuildConfig.SAP_API_KEY, "eu1.gigya.com", BuildConfig.CNAME)
Hi,
Im looking into it. This may occur because the Android system does not know how to create the Gigya class on runtime due to the "removeUnusedCode" tag. This is new to me so I still need to investigate it further. At this point, I can confirm this is the only solution. It is best to open a support incident for this, as it may require further investigation that cannot be completed through the open source channel. https://developers.gigya.com/display/GD/Opening+A+Support+Incident
The following issue seems to come up when trying to run the build with the Gigya Core SDK v7.0.3 on build variants with these flags:
The following exception is thrown as soon as the app is launched:
The SDK is initialized implicitly in the Application.kt class:
the following rule has also been added to the proguard-rules.pro file
-keep class com.gigya.android.sdk.** { *; }
Are there any more rules that need to be added to the proguard file ?
Gigya core version: core-v7.0.3 Gigya NSS version: nss-v1.7.0