Common Issues
1. SDK Initialization Fails
Problem: IllegalArgumentException during initialization
// ❌ Common mistakesAlphynSDK.initialize(null); // Null contextAlphynSDK.initialize(); // Missed contextSolution:
// ✅ Correct initializationtry { AlphynSDK.initialize(getApplicationContext());} catch (IllegalArgumentException e) { Log.e("Byteria", "Invalid initialization parameters: " + e.getMessage());}2. Native Library Not Found
Problem: UnsatisfiedLinkError when loading native library
Solution:
The SDK ships native libraries for arm64-v8a, armeabi-v7a, and x86_64. If your app restricts ABIs with ndk.abiFilters, make sure the filter includes an ABI the device supports (or remove the filter). The SDK links its C++ runtime statically and ships no shared libc++_shared.so, so no pickFirst rule is needed for it.
3. Memory Leaks from Listeners
Problem: Activity/Fragment leaks due to listener references
Solution:
public class LeakSafeListener implements AlphynSecurityListener { private final WeakReference<Activity> activityRef;
public LeakSafeListener(Activity activity) { this.activityRef = new WeakReference<>(activity); }
@Override public void onSuccess(AlphynCallbackResult result) { Activity activity = activityRef.get(); if (activity != null && !activity.isFinishing()) { // Handle result } }
// Always remove listeners @Override protected void onDestroy() { super.onDestroy(); AlphynSDK.removeSecurityListener(listener); }}4. ProGuard/R8 Obfuscation Issues
Problem: SDK classes get obfuscated and break functionality
Note: The Alphyn AAR ships consumer ProGuard rules that R8 applies to your app automatically, so this should not happen with a standard Gradle build. Add the rules below manually only if your build pipeline strips consumer rules.
Solution:
# Byteria SDK - Keep all classes and methods-keep class com.byteria.sdk.** { *; }
# Keep classes with @Keep annotation-keep @androidx.annotation.Keep class * { *; }-keepclassmembers class * { @androidx.annotation.Keep <methods>;}
# Keep native methods-keepclasseswithmembernames class * { native <methods>;}