[X] This is not a Security Disclosure, otherwise please follow the guidelines in Security Policy.
[X] I have searched in this repository's issues to see if it has already been reported.
[X] I have updated to the latest released version of the SDK and the issue still persists.
Bug summary
Working on an app where exceptions are occasionally reported when calling the this API. What's logged is that a null check was used on a null value on the following lines
[✓] Flutter (Channel stable, 3.24.2, on macOS 15.0.1 24A348 darwin-arm64, locale
en-AU)
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
✗ cmdline-tools component is missing
Run path/to/sdkmanager --install "cmdline-tools;latest"
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/to/macos-android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.93.1)
[✓] Connected device (3 available)
! Error: Browsing on the local area network for Michael’s iPad. Ensure the
device is unlocked and attached with a cable or associated with the same
local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code
-27)
[✓] Network resources
Steps to reproduce
N/A
Current behavior
Null check operator used on a null value error being thrown
Expected behavior
SDK throws a PlatformException containing details of the from the native side
Prerequisites
Bug summary
Working on an app where exceptions are occasionally reported when calling the this API. What's logged is that a null check was used on a null value on the following lines
https://github.com/adobe/aepsdk_flutter/blob/e385131d4f26ee4774fd19fd64ccd35c39fc1053/plugins/flutter_aepcore/lib/flutter_aepidentity.dart#L76 https://github.com/adobe/aepsdk_flutter/blob/e385131d4f26ee4774fd19fd64ccd35c39fc1053/plugins/flutter_aepcore/lib/flutter_aepidentity.dart#L43
This means the plugin itself expected a non-nullable values. Don't have steps to reproduce as tracing through the source code of the plugin shows that it does not check the
error
object on the iOS side and assumes calling the native iOS SDK works https://github.com/adobe/aepsdk_flutter/blob/e385131d4f26ee4774fd19fd64ccd35c39fc1053/plugins/flutter_aepcore/ios/Classes/FlutterAEPIdentityPlugin.m#L93. This effectively means the plugin is swallowing any errors being reported on the native and makes it difficult to know what went wrong. The following is an example of dealing with a NSError object on the iOS side can be done https://github.com/flutter/packages/blob/aa741d164ccd24aaaaee5fe4b4c1dcf9df931799/packages/camera/camera_avfoundation/ios/camera_avfoundation/Sources/camera_avfoundation/CameraPlugin.m#L19. This would allow the plugin to throw a PlatformException on Dart/Flutter side that apps can catch and get more detailed information on what went wrong. Note the docs for AEP also refer to catching a PlatformException (e.g. here), however it's not possible on iOS with how the plugin hasn't properly handled errors. This is in turn means it's not possible to see the AEPError codeEnvironment
[✓] Flutter (Channel stable, 3.24.2, on macOS 15.0.1 24A348 darwin-arm64, locale en-AU) [!] Android toolchain - develop for Android devices (Android SDK version 35.0.0) ✗ cmdline-tools component is missing Run
path/to/sdkmanager --install "cmdline-tools;latest"
See https://developer.android.com/studio/command-line for more details. ✗ Android license status unknown. Runflutter doctor --android-licenses
to accept the SDK licenses. See https://flutter.dev/to/macos-android-setup for more details. [✓] Xcode - develop for iOS and macOS (Xcode 16.0) [✓] Chrome - develop for the web [✓] Android Studio (version 2024.1) [✓] VS Code (version 1.93.1) [✓] Connected device (3 available) ! Error: Browsing on the local area network for Michael’s iPad. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac. The device must be opted into Developer Mode to connect wirelessly. (code -27) [✓] Network resourcesSteps to reproduce
N/A
Current behavior
Null check operator used on a null value error being thrown
Expected behavior
SDK throws a PlatformException containing details of the from the native side
Anything else?
No response