I just started exploring the platform channel feature of Flutter. After successfully retrieving the remaining battery level, I wanted to go further to integrate an external library. To be specific, I wanted to integrate the PayPal (now Braintree) SDK to native code and call it from Flutter. I only tried doing this on Android, I thought it would be less difficult as I could use the same IDE (Android Studio) to write and test the code on both sides.
So I added the dependency to build.gradle and added some code to MainActivity.java. Then I experienced two issues:
1) The SDK I added in build.gradle can be downloaded successfully. However, Android Studio seems not aware of the new external dependency, thus I could not take advantage of code hinting nor import completion, as the symbols of the SDK library could not be resolved. This makes development painful. I would like to know if it is just me or a known issue - I am actually quite surprised when I found no similar report of this issue.
2) I am unable to set breakpoints on native (Java) code. This is understandable, as it's now Flutter who is running the game. But still it's inconvenient. I would like to know if there's a way to debug native code on a Flutter application. Now I can only think of creating a separate native project, write (and debug) the code, and copy it back to Flutter when done.
Thanks again.
Edmund