android-ndk

Unicode const char* to JString using JNI and C++

跟風遠走 提交于 2020-03-22 07:31:28
问题 Simple question. How can I get a jstring out of a unicode const char*, using JNI and C++? Here's my issue, and what I have already tried: const char* value = (some value from server); (*env)->NewStringUTF(value); The issue here is that NewStringUTF returns a UTF string, and it does not like some of the non-UTF8 characters (kind of obvious, but worth a simple try). Attempt 2, using NewString: const char* value = (some value from server); (*env)->NewString(value, strlen(value)); While NewString

Android: No version of NDK matched the requested version

半世苍凉 提交于 2020-03-17 06:46:27
问题 After updating to Android Gradle plugin 3.6.0 (released Feb 24, 2020), several project independently started failing with: No version of NDK matched the requested version 20.0.5594570. Versions available locally: 21.0.6113669 It's quite simple to "fix" this locally by installing the older expected ndk version: sdkmanager 'ndk;20.0.5594570' However, my question is: Where and how is this older version specified? And how do I update it so it matches the latest version 21.0.6113669 ? 回答1: Option

How to add Lame 3.99.5 to Android Studio using NDK? [closed]

三世轮回 提交于 2020-03-14 00:58:30
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago . I am new in Android NDK. I need to add the Lame library to Android Studio using NDK. I start my research and find out some useful link: Lame MP3 Encoder compile for Android How to link the “lame” mp3 encoder shared object to an Android studio project I successful but only with

Rsa decryption return error 0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong tag in openssl cpp

末鹿安然 提交于 2020-03-05 04:04:51
问题 I used openssl library for RSA encryption/decrytion in c++ (android ndk) and it's working fine. But when I encrypted data in RSA tester site and decrypted it in c++, openssl return this error: 0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong tag Here is my code: typedef unsigned char byte; char plainText[256] = "Test"; char publicKey[2048] = "-----BEGIN PUBLIC KEY-----\n ..." char privateKey[2048] = "-----BEGIN RSA PRIVATE KEY-----\n" ... RSA *rsa = createRSA(reinterpret_cast<unsigned

NDK is missing a “platforms” directory. while trying to build

巧了我就是萌 提交于 2020-03-05 03:18:13
问题 Executing tasks: [clean] Configuration on demand is an incubating feature. NDK is missing a "platforms" directory. If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to /Users/ishandutta2007/Library/Android/sdk/ndk-bundle. If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning. Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead. FAILURE: Build failed with an

NDK is missing a “platforms” directory. while trying to build

跟風遠走 提交于 2020-03-05 03:17:32
问题 Executing tasks: [clean] Configuration on demand is an incubating feature. NDK is missing a "platforms" directory. If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to /Users/ishandutta2007/Library/Android/sdk/ndk-bundle. If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning. Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead. FAILURE: Build failed with an

Shared memory between NDK and SDK below API Level 26

不打扰是莪最后的温柔 提交于 2020-03-04 05:07:29
问题 Library written in c++ produces continuous stream of data and same has to be ported on different platforms. Now integrating the lib to android application, I am trying to create shared memory between NDK and SDK. Below is working snippet, Native code: #include <jni.h> #include <fcntl.h> #include <sys/mman.h> #include <linux/ashmem.h> #include <android/log.h> #include <string> char *buffer; constexpr size_t BufferSize=100; extern "C" JNIEXPORT jobject JNICALL Java_test_com_myapplication

gradle > Task :app:externalNativeBuildDebug FAILED android_gradle_build.json (No such file or directory)

最后都变了- 提交于 2020-02-28 13:35:07
问题 I am trying to build an android project from the command line using ./gradlew app:assembleDebug However when I build the task fails with: > Task :app:externalNativeBuildDebug FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:externalNativeBuildDebug'. > java.io.FileNotFoundException: /Users/hcwiley/MyProject/app/.externalNativeBuild/cmake/debug/arm64-v8a/android_gradle_build.json (No such file or directory) If I run Sync Project with Gradle

Android NDK sample build error linux

六眼飞鱼酱① 提交于 2020-02-25 10:16:06
问题 Hello I am new to Android and I am trying to build the hello-jni sample that is included in the NDK but I get the error below, any idea how to fix it? 15:57:10 ** Build of configuration Default for project HelloJni ** /media/Project/adt-bundle-linux-x86-20131030/adt-bundle-linux-x86-20131030/android-ndk-r9c/ndk-build all Android NDK: WARNING: APP_PLATFORM android-19 is larger than android:minSdkVersion 3 in ./AndroidManifest.xml [armeabi-v7a] Compile thumb : hello-jni <= hello-jni.c arm-linux

Android: error: use of undeclared identifier 'fseeko'

北慕城南 提交于 2020-02-25 04:00:38
问题 When I am trying to build a boost library in Android using its source code, I am getting below error release|armeabi-v7a : D:/Android/Sdk/ndk->bundle/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1\fstream:969:9: release|armeabi-v7a : error: use of undeclared identifier 'fseeko' release|armeabi-v7a : if (fseeko(__file_, __sp, SEEK_SET)) Below is my CMake externalNativeBuild { cmake { cppFlags "-std=c++14 -frtti -fexceptions -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"