Flutter release build on an Android device then getting the value of a counter with getValue() call, this works fine in the simulator and in a Fultter run build, I can also upload an IPA to the app store and there is no problem getting the counter value.
In Flutter run --release build the following code crashes at the int? count = await counter.getValue(); call then error is as follows and the full log is below, the app runs fine with all the other Backendless calls, it is only the counter that is crashing in release mode on an Android device.
E/AndroidRuntime(26839): FATAL EXCEPTION: main
E/AndroidRuntime(26839): Process: com.codefab.ph.alona_beach_guide, PID: 26839
E/AndroidRuntime(26839): java.lang.RuntimeException: unsupported data type. Cannot adapt counter value to type - class java.lang.Object
E/AndroidRuntime(26839): at com.backendless.Counters.convertToType(Unknown Source:97)
E/AndroidRuntime(26839): at com.backendless.atomic.AtomicCallback.handleResponse(Unknown Source:31)
E/AndroidRuntime(26839): at com.backendless.async.message.AsyncMessage$ResponseHandler.handle(Unknown Source:6)
E/AndroidRuntime(26839): at com.backendless.async.message.AsyncMessage.handleCallback(Unknown Source:2)
E/AndroidRuntime(26839): at com.backendless.core.AndroidCarrier$1.handleMessage(Unknown Source:4)
E/AndroidRuntime(26839): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(26839): at android.os.Looper.loopOnce(Looper.java:226)
E/AndroidRuntime(26839): at android.os.Looper.loop(Looper.java:313)
E/AndroidRuntime(26839): at android.app.ActivityThread.main(ActivityThread.java:8762)
E/AndroidRuntime(26839): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(26839): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
E/AndroidRuntime(26839): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
This kicked off a whole list of Dart Analysis warnings
error: The expression doesnât evaluate to a function, so it canât be invoked. (invocation_of_non_function_expression at [alona_beach_guide] lib/common_code/app/app_initializer.dart:73)
error: The method âsetUrlâ isnât defined for the type âBackendlessâ. (undefined_method at [alona_beach_guide] lib/common_code/app/app_initializer.dart:74)
error: Too many positional arguments: 0 expected, but 1 found. (extra_positional_arguments_could_be_named at [alona_beach_guide] lib/common_code/support/instances/guide_data_instance.dart:389)
error: The getter âcountersâ isnât defined for the type âBackendlessâ. (undefined_getter at [alona_beach_guide] lib/common_code/support/instances/guide_data_instance.dart:485)
error: Undefined class âIAtomicâ. (undefined_class at [alona_beach_guide] lib/common_code/support/instances/guide_data_instance.dart:490)
error: Too many positional arguments: 0 expected, but 1 found. (extra_positional_arguments_could_be_named at [alona_beach_guide] lib/common_code/support/instances/guide_data_instance.dart:514)
error: Too many positional arguments: 0 expected, but 1 found. (extra_positional_arguments_could_be_named at [alona_beach_guide] lib/common_code/support/instances/guide_data_instance.dart:590)
error: The getter âcountersâ isnât defined for the type âBackendlessâ. (undefined_getter at [alona_beach_guide] lib/common_code/ui/views/support_views/guide_entry_view/main/guide_entry_view_model.dart:93)
error: Undefined class âIAtomicâ. (undefined_class at [alona_beach_guide] lib/common_code/ui/views/support_views/guide_entry_view/main/guide_entry_view_model.dart:99)
warning: The operand canât be null, so the condition is always âtrueâ. (unnecessary_null_comparison at [alona_beach_guide] lib/common_code/ui/views/support_views/guide_entry_view/main/guide_entry_view_model.dart:101)
We that is not good when do you plan on supporting counters in 8.0? Look at all the functions I am, currently using that are not supported, do yo plan on supporting counters in 8.0? How are is 8.0 form being a actual release?
error: The expression doesnât evaluate to a function, so it canât be invoked. (invocation_of_non_function_expression at [alona_beach_guide] lib/common_code/app/app_initializer.dart:73)
error: The method âsetUrlâ isnât defined for the type âBackendlessâ. (undefined_method at [alona_beach_guide] lib/common_code/app/app_initializer.dart:74)
error: Too many positional arguments: 0 expected, but 1 found. (extra_positional_arguments_could_be_named at [alona_beach_guide] lib/common_code/support/instances/guide_data_instance.dart:389)
error: The getter âcountersâ isnât defined for the type âBackendlessâ. (undefined_getter at [alona_beach_guide] lib/common_code/support/instances/guide_data_instance.dart:485)
error: Undefined class âIAtomicâ. (undefined_class at [alona_beach_guide] lib/common_code/support/instances/guide_data_instance.dart:490)
error: Too many positional arguments: 0 expected, but 1 found. (extra_positional_arguments_could_be_named at [alona_beach_guide] lib/common_code/support/instances/guide_data_instance.dart:514)
error: Too many positional arguments: 0 expected, but 1 found. (extra_positional_arguments_could_be_named at [alona_beach_guide] lib/common_code/support/instances/guide_data_instance.dart:590)
error: The getter âcountersâ isnât defined for the type âBackendlessâ. (undefined_getter at [alona_beach_guide] lib/common_code/ui/views/support_views/guide_entry_view/main/guide_entry_view_model.dart:93)
error: Undefined class âIAtomicâ. (undefined_class at [alona_beach_guide] lib/common_code/ui/views/support_views/guide_entry_view/main/guide_entry_view_model.dart:99)
warning: The operand canât be null, so the condition is always âtrueâ. (unnecessary_null_comparison at [alona_beach_guide] lib/common_code/ui/views/support_views/guide_entry_view/main/guide_entry_view_model.dart:101)
@Alan_Cook I will add counters to SDK as soon as possible. It was my mistake, I missed the counters in the new version of the SDK.
Many features in 8.0.0 can be called slightly differently. For example, the Backendless.setUrl(value) function is replaced with property: Backendless.url = value.
Ok, that is good to hear, as counters are a main part of our application since the issue is only on. release build I will keep developing with the 7.3.7, if you can let me know when the beta has counters. working and I will retest everything, we are at least a month away from needing a release build.