Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android build errors #344

Open
petabyt opened this issue Sep 19, 2024 · 5 comments
Open

Android build errors #344

petabyt opened this issue Sep 19, 2024 · 5 comments

Comments

@petabyt
Copy link

petabyt commented Sep 19, 2024

C:/Users/brikb/AndroidStudioProjects/fudge/third_party/SimpleBLE/simpleble/src/backends/android/PeripheralBase.cpp:114:12: error: no matching constructor for initialization of 'SimpleBLE::ByteArray' (aka 'kvn::bytearray')
C:/Users/brikb/AndroidStudioProjects/fudge/third_party/SimpleBLE/simpleble/../external/include\external/kvn_bytearray.h:37:5: note: candidate constructor not viable: no known conversion from 'std::vector<unsigned char>::iterator' (aka '__wrap_iter<unsigned char *>') to 'const uint8_t *' (aka 'const unsigned char *') for 1st argument
C:/Users/brikb/AndroidStudioProjects/fudge/third_party/SimpleBLE/simpleble/../external/include\external/kvn_bytearray.h:50:5: note: candidate constructor not viable: no known conversion from 'std::vector<unsigned char>::iterator' (aka '__wrap_iter<unsigned char *>') to 'const char *' for 1st argument
C:/Users/brikb/AndroidStudioProjects/fudge/third_party/SimpleBLE/simpleble/../external/include\external/kvn_bytearray.h:30:5: note: candidate constructor not viable: requires single argument 'vec', but 2 arguments were provided
C:/Users/brikb/AndroidStudioProjects/fudge/third_party/SimpleBLE/simpleble/../external/include\external/kvn_bytearray.h:43:5: note: candidate constructor not viable: requires single argument 'byteArr', but 2 arguments were provided
C:/Users/brikb/AndroidStudioProjects/fudge/third_party/SimpleBLE/simpleble/../external/include\external/kvn_bytearray.h:56:5: note: candidate constructor not viable: requires single argument 'byteArr', but 2 arguments were provided
C:/Users/brikb/AndroidStudioProjects/fudge/third_party/SimpleBLE/simpleble/../external/include\external/kvn_bytearray.h:19:7: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
C:/Users/brikb/AndroidStudioProjects/fudge/third_party/SimpleBLE/simpleble/../external/include\external/kvn_bytearray.h:19:7: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 2 were provided
C:/Users/brikb/AndroidStudioProjects/fudge/third_party/SimpleBLE/simpleble/../external/include\external/kvn_bytearray.h:24:5: note: candidate constructor not viable: requires 0 arguments, but 2 were provided

I added an extra constructor: bytearray(std::vector<unsigned char>::iterator ptr, std::vector<unsigned char>::iterator size) : data_(ptr, size) {}

And... I don't have nativehelper. I don't know where/how you got it for the NDK.

@felixdollack
Copy link
Contributor

Same here...

ld: error: unable to find library -lnativehelper

@kdewald can you point us in the right direction?

@Andrey1994
Copy link
Contributor

nativehelper is available since 31, builds ok for me with -DANDROID_NATIVE_API_LEVEL=android-31

@kdewald
Copy link
Member

kdewald commented Nov 18, 2024

Hey all, thanks for all the enthusiasm around Android support!

Please be patient as things are still in an early alpha stage, but don't hesitate to highlight any issues.

@felixdollack
Copy link
Contributor

I am actually using it natively (C-lang) through Flutter, so it is still different from using Android/Kotlin ^^;

@Andrey1994
Copy link
Contributor

I am also trying to use it slightly differently.
Just started and dont fully understand how it should work.
I have a C++ codebase with existing Java binding, and I already have JNIenv pointer in Cpp code. And it currently uses SimpleBLE for desktop. So, I dont need any methods from SimpleBLE to be available from Java, its 100% on Cpp level.

So afaiu I need a way to pass this pointer into SimpleBLE. @kdewald I dont see how to do this wo patching, do you have any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants