Category : android-ndk

Error Logs External native generate JSON release: executing ndkBuild Executable : /Users/nidhinagvanshi/Library/Android/sdk/ndk/20.0.5594570/ndk-build arguments : NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/Users/nidhinagvanshi/Downloads/VirtualApp-master-2/VirtualApp/lib/src/main/jni/Android.mk NDK_APPLICATION_MK=/Users/nidhinagvanshi/Downloads/VirtualApp-master-2/VirtualApp/lib/src/main/jni/Application.mk APP_ABI=x86 NDK_ALL_ABIS=x86 NDK_DEBUG=0 APP_PLATFORM=android-16 NDK_OUT=/Users/nidhinagvanshi/Downloads/VirtualApp-master-2/VirtualApp/lib/build/intermediates/ndkBuild/release/obj NDK_LIBS_OUT=/Users/nidhinagvanshi/Downloads/VirtualApp-master-2/VirtualApp/lib/build/intermediates/ndkBuild/release/lib APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -n jvmArgs : /Users/nidhinagvanshi/Library/Android/sdk/ndk/20.0.5594570/build/core/add-application.mk:178: *** Android NDK: APP_STL gnustl_static is no longer supported. Please switch to either c++_static or c++_shared. See https://developer.android.com/ndk/guides/cpp-support.html for more information. . Stop. External native generate ..

Read more

On ${CMAKE_CURRENT_SOURCE_DIR}/JUCE, there is: option(JUCE_BUILD_EXTRAS "Add build targets for the Projucer and other tools" OFF) if(JUCE_BUILD_EXTRAS) add_subdirectory(extras) endif() link: https://github.com/juce-framework/JUCE/blob/master/CMakeLists.txt#L57 So this is what I did: set(JUCE_BUILD_EXTRAS OFF) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/JUCE) However it still tries to build extras. I’m on Android Studio. What should I do? I also tried set(JUCE_BUILD_EXTRAS OFF) The default value is OFF and ..

Read more

I am building an Android executable using the cmake and ninja: cmake -H../ -DCMAKE_CXX_FLAGS=-std=c++11 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=$ABI -DANDROID_NDK=$NDK -DANDROID_PLATFORM=android-$MIN_SDK_VERSION -DCMAKE_ANDROID_ARCH_ABI=$ABI -DCMAKE_ANDROID_NDK=$NDK -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=$ABI -DCMAKE_MAKE_PROGRAM=$SDK_PATH/cmake/$CMAKE_VERSION/bin/ninja.exe -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=$MIN_SDK_VERSION -DANDROID_STL=c++_static -B$BUILD_DIR -GNinja ninja The project has some very large variables declared in a global space of a file: BCCH_BCH_Message bcch_bch_Message; BCCH_DL_SCH_Message bcch_dl_sch_Message; DL_CCCH_Message dl_ccch_Message; DL_DCCH_Message dl_dcch_Message; PCCH_Message pcch_Message; ..

Read more

We have a ndk library with initializing code like these: extern GL_APICALL void (*GL_APIENTRY glReadBuffer)(GLenum mode); glReadBuffer = (void*) eglGetProcAddress("glReadBuffer"); However, some android apps with this library always crash at function call eglGetProcAddress. Other apps with the same library won’t. eglGetProcAddress is a funciton provided by android system, generally in libegl.so. So I suppose that ..

Read more

I cannot figure out why this solution will let me open and modify files bytes with ofstream/ifstream, but reads/writes will not update the pointer accessed through tellp / tellg function calls. This is a sample that does not work: std::ofstream oStream(path,std::fstream::beg | std::fstream::binary); int test = 98; LOGI("OSTREAM POINTf :: %d", oStream.tellp()); oStream.write((char *)&test,4); LOGI("OSTREAM ..

Read more

I was thinking of studying OpenGL ES with Android Native Activity, but when I use the API of OpenGL ES 2.0 even though I can use OpenGL ES 1.0, I get a message saying "Undefined symbo l !!" OpenGL ES 2.0 png 1>ANDROID_HOME=D:aruzeMicrosoftAndroidSDK 1>ANT_HOME=C:Program Files (x86)Microsoft Visual Studio19CommunityAppsapache-ant-1.9.3 1>JAVA_HOME=C:Program FilesAndroidjdkmicrosoft_dist_openjdk_1.8.0.25 1>NDK_ROOT=D:aruzeMicrosoftAndroidNDK64android-ndk-r16b 1>pch.h 1>android_native_app_glue.c 1>startup.cpp 1>System.cpp ..

Read more

I’m bad in C++. I have the following object: class Test{ typedef std::function<void(float)> MyCallback; public: void setCallback(MyCallback myCallback); private: MyCallback mycallback = nullptr; }; Now I have this method: extern "C" JNIEXPORT void JNICALL Java_app_path_Activity_setCallback(JNIEnv *env, jobject obj) { } The question is how can I set callback to get value in my Activity? Source: ..

Read more

I’m new to Android NDK. I have project in C++ which draws a triangle using OpenGL. Also this project has some custom libraries. I’ve added it to my src/main/cpp folder and wrote CMakeLists.txt cmake_minimum_required(VERSION 3.10.2) project("triangleapp") add_library( gl2jni SHARED tr.cpp) add_library( tr_lib SHARED IMPORTED ) set_target_properties( tr_lib PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/tr_lib/tr_lib.c ) find_library( log-lib log) target_link_libraries( ..

Read more

I followed the TensorFlow docs for how to open a saved model from a file: std::unique_ptr<tflite::FlatBufferModel> model = tflite::FlatBufferModel::BuildFromFile("./models/converted_model.tflite"); My C++ code can not find the TFLite model file. I put it in the /src/main/cpp/ and tried to reference it. I got the error E/tflite: Could not open ‘converted_model.tflite’. This may be a really silly ..

Read more