Closed radomir9720 closed 2 years ago
@radomir9720 hi, does it happen on the latest sdk version?
Actually I think it may be an obfuscation issue, since the sdk source code is not split to debug/release, and, as you said, everything worked well in debug
Yes, it happens on latest 1.0.6
version.
Is it reproduced stably in release? Do you use obfuscation?
Yes, stably. And yes, i use obfuscation. In my app build.gradle
in buildTypes
i have set previously minifyEnabled
and shrinkResources
both to true
. Now i tried to comment these lines, built a release apk, and still no positive result. Exactly the same error.
That's strange, we'll try to reproduce the problem.
Btw, do you have the following line in the proguard config?
-keep class com.adapty.** { *; }
I don't have any proguard config at all, but i configured one, and the error persists.
I do not use obfuscation and it also does not work for me in the release, in the debug mode everything is fine.
the error occurs when calling
final GetPaywallsResult getPaywallsResult = await Adapty
.getPaywalls(forceUpdate: false);
[+6696 ms] E/flutter (17291): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: AdaptyError (code null)
[ ] E/flutter (17291): #0 Adapty._invokeMethodHandlingErrors (package:adapty_flutter/adapty_flutter.dart:242)
[ ] E/flutter (17291):
Adapty.getPaywalls (package:adapty_flutter/adapty_flutter.dart:64)
static Future<GetPaywallsResult> getPaywalls({bool forceUpdate = false}) async {
final result = (await _invokeMethodHandlingErrors<String>(Method.getPaywalls, {
Argument.forceUpdate: forceUpdate,
})) as String;
return GetPaywallsResult.fromMap(json.decode(result));
}
Adapty._invokeMethodHandlingErrors (package:adapty_flutter/adapty_flutter.dart:242)
static Future<T?> _invokeMethodHandlingErrors<T>(String method, [dynamic arguments]) async {
try {
return await _channel.invokeMethod<T>(method, arguments);
} on PlatformException catch (e) {
throw e.details != null ? AdaptyError.fromMap(json.decode(e.details)) : e;
}
}
I found the problem nowhere is it written about this, I just had to compare the example code with my project in new versions of flutter in the file.gradle file the following construction is written
subprojects {
project.buildDir = "$ {rootProject.buildDir} / $ {project.name}"
project.evaluationDependsOn (': app')
}
and in the example it is written like this
subprojects {
project.buildDir = "$ {rootProject.buildDir} / $ {project.name}"
}
subprojects {
project.evaluationDependsOn (': app')
}
after replacing the site as in the example, the subscriptions earned in the release.
@shok96 cool, thank you, closing the issue
Hi. I have have set up Adapty SDK and tested in debug with sandbox for android and ios. Everything worked well, as expected, but when i built a release, i started getting exceptions
AdaptyError (code null) . Error thrown null.
. In Profile mode everything works well.The exception is thrown after calling
Adapty.identify()
andAdapty.getPaywalls()
.Tested on
Huawei P20 lite android 9
, andSamsung Galaxy S9 android 9
.Trace
``` Non-fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: AdaptyError (code null) . Error thrown null. at Adapty._invokeMethodHandlingErrors(Adapty.java:242) at Adapty.getPaywalls(Adapty.java:64) at PurchaseBloc._purchase.How i activate adapty
```dart void main() { runZonedGuarded