Code Monkey home page Code Monkey logo

Comments (9)

anuar2k avatar anuar2k commented on May 22, 2024

Hi,
following line from the log file you provided:

-- Could NOT find mbedTLS (missing: MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY MBEDTLS_CRYPTO_LIBRARY MBEDTLS_X509_LIBRARY MBEDTLS_LIBRARIES MBEDTLS_VERSION)

suggest that you don't have mbedTLS installed.
Please install it by executing the command appropriate for your operating system, as described here: https://github.com/AVSystem/Anjay#dependencies

from anjay-java.

Kushma avatar Kushma commented on May 22, 2024

Hi, following line from the log file you provided:

-- Could NOT find mbedTLS (missing: MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY MBEDTLS_CRYPTO_LIBRARY MBEDTLS_X509_LIBRARY MBEDTLS_LIBRARIES MBEDTLS_VERSION)

suggest that you don't have mbedTLS installed. Please install it by executing the command appropriate for your operating system, as described here: https://github.com/AVSystem/Anjay#dependencies

Hi. What if I do not want to include mbedTLS in my module? What all changes will be required in that case?

from anjay-java.

anuar2k avatar anuar2k commented on May 22, 2024

Hi,
Anjay-java was designed to be compiled with security enabled by default. You can compile-in the TLS library, but keep using basic NoSec communication in the runtime. What holds you back from including mbedTLS into the library?

from anjay-java.

Kushma avatar Kushma commented on May 22, 2024

Thank you for your reply. Ya currently I am using NoSec communication.

Can I get some information on Anjay Java's documentation, if any? I see that in Anjay C, there is a complete document. It would be really helpful if we get all 1:1 API mappings and other details in one document.

from anjay-java.

Kushma avatar Kushma commented on May 22, 2024

Hi, I am trying to compile "libanjay-jni.so" separately. And I am seeing this error.

_[100%] Linking CXX shared library libanjay-jni.so
/usr/bin/ld: CMakeFiles/anjay-jni.dir/src/native_access_control.cpp.o: relocation R_X86_64_PC32 against undefined symbol `ZZN3jni16MakeNativeMethodIZNS_17NativeMethodMakerIMZNKS_16NativePeerHelperI19NativeAccessControlS3_FSt10unique_ptrIS3_St14default_deleteIS3_EER7JNIEnv_RNS_6ObjectI11NativeAnjayEEEE15MakeInitializerERKNS_5FieldIS3_lEEPKcPSE_EUlS9_RNSA_IS3_EESD_E_KFvS9_SO_SD_EJEEclISP_EEDaSL_RKT_EUlPS8_PNS_7jobjectESZ_E_EEDaSL_SL_SW_PNSt9enable_ifIXsrSt8is_classISU_E5valueEvE4typeEE6method' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
CMakeFiles/anjay-jni.dir/build.make:511: recipe for target 'libanjay-jni.so' failed
make[2]: *** [libanjay-jni.so] Error 1
CMakeFiles/Makefile2:81: recipe for target 'CMakeFiles/anjay-jni.dir/all' failed
make[1]: *** [CMakeFiles/anjay-jni.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

Can you please help me address this issue?

from anjay-java.

kFYatek avatar kFYatek commented on May 22, 2024

Hi Kushma,

We cannot reproduce your issue. The library should compile cleanly when configured through just cmake . (or cmake -DJAVA_HOME=<path_to_your_jdk> . if your JDK isn't available in its default location) and it does so on my system.

The CMAKE_POSITION_INDEPENDENT_CODE variable is set in the project's CMakeLists, which should set the -fPIC flag mentioned in the warning appropriately - so it looks that CMake isn't handling your system properly for some reason. This is probably an OS-specific issue.

What operating system are you using? If it's a Linux system, please tell us what distribution in which version it is. Please also tell us the exact command you're using to invoke cmake, and the versions of CMake and JDK if they're not the default ones for the distribution in question.

from anjay-java.

Kushma avatar Kushma commented on May 22, 2024

Hello, thank you for the reply.

I am sticking to using " ./gradlew -Pandroid :library:build" command to build.
I observed that when I change the DTLS_BACKEND to another value other than mbedtls in "native-library/deps/anjay/CMakeLists.txt", and give a build. The DTLS_BACKEND value is not updating in my CMakeCache.txt.

I also observed that the DTLS_BACKEND variable is not getting updated, confirmed from the gradle logs.

Can you pls explain why this is happening? Is there a way I can give a clean build using gradlew?

from anjay-java.

kFYatek avatar kFYatek commented on May 22, 2024

Hi Kushma,

The values specified in CMakeLists.txt for so-called "cache variables" are just defaults, see CMake documentation for set(... CACHE ...) and option().

The specific rules for variable handling in CMake are rather complex, but the general rule is that variables specified on the command line (i.e. cmake -DVAR=value - within the context of Anjay-java this is specified in the Gradle scripts) have the highest priority, then the values already in CMakeCache.txt, if any, then the defaults in CMakeLists.txt. This is designed so that re-running cmake will not change the configuration that you have already set.

Removing CMakeCache.txt (note that there may sometimes be more than one in different directories) is the way to go if you want to reset to the default settings.

from anjay-java.

Kushma avatar Kushma commented on May 22, 2024

Hello, thank you for the clarification.

From Anjay Java to Anjay C++ there is a JNI Iayer and I was working on writing a callback from native back to java. For this, I will need both "JNIEnv *" and "jobject" in arguments but I only see JNIEnv.

Can you please let me know how I can go ahead with writing this JNI callback? And is there a callback in the existing code for reference?

from anjay-java.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.