SegmentFault ndk的问题
2022-12-07T09:22:10+08:00
https://segmentfault.com/feeds/tag/ndk
https://creativecommons.org/licenses/by-nc-nd/4.0/
android NDK cmake 编译问题寻找不到库?
https://segmentfault.com/q/1010000042999527
2022-12-07T09:22:10+08:00
2022-12-07T09:22:10+08:00
3p3xtti1
https://segmentfault.com/u/3p3xtti1
0
<p><img src="/img/bVc4AiY" alt="image.png" title="image.png"></p><p>这是脚本内容,</p><p><img src="/img/bVc4Ai2" alt="E5C23074-6815-41c4-ACBC-29C4E533E7DA.png" title="E5C23074-6815-41c4-ACBC-29C4E533E7DA.png"></p><p><img src="/img/bVc4Ai3" alt="A27D4658-0CD7-4e1f-B86B-F97B46AC850E.png" title="A27D4658-0CD7-4e1f-B86B-F97B46AC850E.png"><br>这是cmakelist内容,<br>同样的脚本以及在camkelist,demo能正常编译且顺利运行,但放在实际项目中编译就报以下错误<br>ld: error: unable to find library -lavcodec<br>ld: error: unable to find library -lswresample<br>ld: error: unable to find library -lavdevice<br>ld: error: unable to find library -lavfilter<br>ld: error: unable to find library -lavformat<br>ld: error: unable to find library -lavutil<br>ld: error: unable to find library -lxml2<br> 有人知道 问题是出在哪里吗?(demo环境,脚本。cmake内容写法都是一致的)</p>
ndk如何编译linux系统库?
https://segmentfault.com/q/1010000042984112
2022-12-05T19:11:59+08:00
2022-12-05T19:11:59+08:00
3p3xtti1
https://segmentfault.com/u/3p3xtti1
0
<h2>/bin/bash</h2><p>export ANDROID_NDK=/home/pis/work/ndk/android-ndk-r10d</p><p>rm -r build<br>mkdir build && cd build</p><h2>cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \</h2><p>cmake -DANDROID_ABI="armeabi-v7a" \</p><pre><code> -DANDROID_NDK=$ANDROID_NDK \
-DANDROID_PLATFORM=android-22 \
..
</code></pre><p>make record</p><p>cd ..</p><p>~ <br>我用脚本去跑编译record下面的cmakelist.txt 出现以下错误<br>/usr/bin/ld: CMakeFiles/record.dir/__/share/share_os.c.o: undefined reference to symbol 'pthread_join@@GLIBC_2.2.5'<br>/usr/bin/ld: /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line</p><p>我知道这是没引入系统库libpthread,但是现在不知道用NDK怎么去把libpthread编译</p>
新手求助:NDK_PROJECT_PATH=null?
https://segmentfault.com/q/1010000042917224
2022-11-28T17:41:58+08:00
2022-11-28T17:41:58+08:00
人间小西瓜
https://segmentfault.com/u/renjianxiaoxigua
0
<p><img src="/img/bVc4eTr" alt="d31d5ffd48f0588ff2afdb3a597f843.png" title="d31d5ffd48f0588ff2afdb3a597f843.png"></p>
新手求助:AS ndk-build报错 如何解决?
https://segmentfault.com/q/1010000042913098
2022-11-27T17:43:26+08:00
2022-11-27T17:43:26+08:00
人间小西瓜
https://segmentfault.com/u/renjianxiaoxigua
0
<p><img src="/img/bVc4dON" alt="7832c05a6125bc16a279879a84a79d1.png" title="7832c05a6125bc16a279879a84a79d1.png"></p>
ndk-build使用clang编译器比gcc编译器编出的程序慢很多?
https://segmentfault.com/q/1010000019041981
2019-04-30T16:33:38+08:00
2019-04-30T16:33:38+08:00
闪电
https://segmentfault.com/u/gxyz
0
<h3>ndk-build使用clang编译器比gcc编译器编出的程序慢很多</h3>
<p>经过测试可能是由于openmp未生效(不确定)</p>
Android 平台上的 C 开发该怎么学啊
https://segmentfault.com/q/1010000017025075
2018-11-15T15:44:50+08:00
2018-11-15T15:44:50+08:00
王呆呆
https://segmentfault.com/u/stay_stay_wang
1
<p>老铁们,最近我想学下Android上用C开发一些偏向系统的程序,举个例子<a href="https://link.segmentfault.com/?enc=d5bSKRlQU4vxTFMSLrAc%2BQ%3D%3D.7guNPEwpHySD9kQFBlV3%2F62m28nMjwfGeb7x%2FMCl6t4MhGYAXfaoPR3%2FopNwyA18YWuuFBoxkpPxqKM6PBXgXLhAgQHSEtUpcFVDG%2Fat5ZA%3D" rel="nofollow">git代码链接</a><br>就像这样的,至少得先看懂,能稍微改改。<br>我现在想找点比较系统的书或者视频也行来学习一下但是不知道这个属于哪一个范畴。我看了看linux c一些书的目录,感觉也不太相关。比如说</p>
<pre><code>#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <dirent.h>
#include <signal.h>
#include <sys/mman.h>
// #include <asm/ptrace.h>
#include <sys/wait.h>
#include <sys/ptrace.h></code></pre>
<p>这一堆,sys asm目录下的东西</p>
<p>还有 pid_t这中数据结构,uint32_t这种设备相关的数据类型(貌似)</p>
<p>还有一堆系统调用的方法。</p>
<p>这一坨宏</p>
<pre><code>#if defined(__i386__)
#define pt_regs user_regs_struct
#endif </code></pre>
<p>希望老铁们能给个比较系统的书单,关键词也行。</p>
android studio集成FFmpeg 爆 libavfilter.so', needed by 问题
https://segmentfault.com/q/1010000016847247
2018-10-30T11:00:31+08:00
2018-10-30T11:00:31+08:00
大尾巴狼
https://segmentfault.com/u/gushu
0
<p>第一次,使用FFmpeg框架,我先在deepin上面编译其源码,得到了,include和so文件。然后复制到<code>win10</code>上面,并且建立项目如图:</p>
<p><img src="/img/bVbiQSQ?w=328&h=891" alt="工程目录" title="工程目录"></p>
<p>然后我在<code>CMarkLists.txt</code>中添加了如下代码:</p>
<pre><code># For more information about using CMake with Android Studio, read the
# documentation: https://d.android.com/studio/projects/add-native-code.html
# Sets the minimum version of CMake required to build the native library.
include_directories(libs/include)
set(DIR ../../../../libs)
cmake_minimum_required(VERSION 3.4.1)
# Creates and names a library, sets it as either STATIC
# or SHARED, and provides the relative paths to its source code.
# You can define multiple libraries, and CMake builds them for you.
# Gradle automatically packages shared libraries with your APK.
add_library( # Sets the name of the library.
native-lib
# Sets the library as a shared library.
SHARED
# Provides a relative path to your source file(s).
src/main/cpp/native-lib.cpp )
add_library(avcodec SHARED IMPORTED)
set_target_properties(avcodec PROPERTIES IMPORTED_LOCATION ${DIR}/armeabi-v7a/libavcodec.so)
add_library(avformat SHARED IMPORTED)
set_target_properties(avformat PROPERTIES IMPORTED_LOCATION ${DIR}/armeabi-v7a/libavformat.so)
add_library(avutil SHARED IMPORTED)
set_target_properties(avutil PROPERTIES IMPORTED_LOCATION ${DIR}/armeabi-v7a/libavutil.so)
add_library(swresample SHARED IMPORTED)
set_target_properties(swresample PROPERTIES IMPORTED_LOCATION ${DIR}/armeabi-v7a/libswresample.so)
add_library(swscale SHARED IMPORTED)
set_target_properties(swscale PROPERTIES IMPORTED_LOCATION ${DIR}/armeabi-v7a/libswscale.so)
add_library(avfilter SHARED IMPORTED)
set_target_properties(avfilter PROPERTIES IMPORTED_LOCATION ${DIR}/armeabi-v7a/libavfilter.so)
# Searches for a specified prebuilt library and stores the path as a
# variable. Because CMake includes system libraries in the search path by
# default, you only need to specify the name of the public NDK library
# you want to add. CMake verifies that the library exists before
# completing its build.
find_library( # Sets the name of the path variable.
log-lib
# Specifies the name of the NDK library that
# you want CMake to locate.
log )
# Specifies libraries CMake should link to your target library. You
# can link multiple libraries, such as libraries you define in this
# build script, prebuilt third-party libraries, or system libraries.
target_link_libraries( # Specifies the target library.
native-lib
avfilter
avcodec
avformat
avutil
swresample
swscale
# Links the target library to the log library
# included in the NDK.
${log-lib} )</code></pre>
<p>在<code>gradle.build</code>中添加了如下代码:</p>
<pre><code>apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "cn.lxw.ffmpeg"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
sourceSets{
main{
jniLibs.srcDirs = ['libs']
}
}
externalNativeBuild {
cmake {
cppFlags ""
abiFilters 'armeabi-v7a'
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
</code></pre>
<p>然后在项目默认的一个cpp文件中,调用一下相关方法。<br><code>native-lib.cpp</code></p>
<pre><code>#include <jni.h>
#include <string>
#include <libavcodec/avcodec.h>
extern "C" JNIEXPORT jstring JNICALL
Java_cn_lxw_ffmpeg_MainActivity_stringFromJNI(
JNIEnv* env,
jobject /* this */) {
std::string hello = avcodec_configuration();
return env->NewStringUTF(hello.c_str());
}
</code></pre>
<p>然后我尝试运行项目,却爆出以下错误:</p>
<pre><code>Build native-lib armeabi-v7a
ninja: error: '../../../../libs/armeabi-v7a/libavfilter.so', needed by '../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libnative-lib.so', missing and no known rule to make it
:app:externalNativeBuildDebug FAILED
:app:buildInfoGeneratorDebug
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:externalNativeBuildDebug'.
> Build command failed.
Error while executing process D:\Dev\sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {--build D:\Dev\WorkSpace\FFmpeg\app\.externalNativeBuild\cmake\debug\armeabi-v7a --target native-lib}
ninja: error: '../../../../libs/armeabi-v7a/libavfilter.so', needed by '../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libnative-lib.so', missing and no known rule to make it</code></pre>
<p>请问怎么修复, 谢谢大家~!</p>
NDK项目怎么才能使用iconv
https://segmentfault.com/q/1010000015936647
2018-08-08T19:31:46+08:00
2018-08-08T19:31:46+08:00
Hobr
https://segmentfault.com/u/hobr
0
<p>最近本人的一个ndk项目中出现了数据传输过程中编码不一致导致的乱码(我开发客户端,而服务端不归我管),因此打算使用iconv.h进行转换,但提示</p>
<pre><code>./gui/renderware_imgui.cpp:116:15: error: use of undeclared identifier 'iconv_open'
iconv_t cd = iconv_open(to_charset, source_charset);
^
./gui/renderware_imgui.cpp:128:6: error: use of undeclared identifier 'iconv'
if (iconv(cd, &inbuf, &inlen, &poutbuf,&outlen) == -1)
^
./gui/renderware_imgui.cpp:132:2: error: use of undeclared identifier 'iconv_close'</code></pre>
<p>之后我打开了NDK r17b的iconv.h,发现了这个</p>
<pre><code>#if __ANDROID_API__ >= 28
iconv_t iconv_open(const char* __src_encoding, const char* __dst_encoding) __INTRODUCED_IN(28);
size_t iconv(iconv_t __converter, char** __src_buf, size_t* __src_bytes_left, char** __dst_buf, size_t* __dst_bytes_left) __INTRODUCED_IN(28);
int iconv_close(iconv_t __converter) __INTRODUCED_IN(28);
#endif /* __ANDROID_API__ >= 28 */
</code></pre>
<p>本人的项目sdk api为14 他却要了28(Android 9),但我却不能要求也做不到让所有用户使用Android 9,请问该怎么解决。</p>
<pre><code>NDK版本:r17b
SDK API:28</code></pre>
三星S7 root后连接Android Studio显示 Unknown 设备?
https://segmentfault.com/q/1010000015920619
2018-08-07T18:17:12+08:00
2018-08-07T18:17:12+08:00
didikee
https://segmentfault.com/u/didikee
0
<p><code>在这里问主要是因为这里程序员比较多,android的就更多了。</code></p>
<p>adb能检测到设备:<br><img src="/img/remote/1460000015920622?w=716&h=134" alt="" title=""></p>
<p>但是android studio:<br><img src="/img/remote/1460000015920623?w=1248&h=946" alt="" title=""></p>
<p>当然,一般情况下点击也是可以直接运行app的。但是如果你的app指定了平台的话就会出现无法运行。<br>比如我指定了如下平台:</p>
<pre><code>ndk {
abiFilters 'armeabi-v7a'//'armeabi'//
}</code></pre>
<p><img src="/img/remote/1460000015920624" alt="" title=""><br>无法运行,尴尬啊。<br>不知道有没有经验的遇到告知下如何解决,谢谢。</p>
移植C/C++框架(MLT)到Android平台?
https://segmentfault.com/q/1010000015821955
2018-07-30T21:42:30+08:00
2018-07-30T21:42:30+08:00
oogh
https://segmentfault.com/u/oogh
0
<p><strong>需求:</strong><br>在Android平台上使用MLT开源多媒体框架,如何编译MLT成.so库,供Android使用?</p>
FFmpeg + SDL播放音频问题
https://segmentfault.com/q/1010000014842386
2018-05-13T23:52:02+08:00
2018-05-13T23:52:02+08:00
oogh
https://segmentfault.com/u/oogh
0
<p>使用FFmpeg+SDL播放音频文件,当播放完毕时,不想退出播放器,用户仍然可以通过滑动进度条进行播放,那么程序中,实现的思路是怎么的呢?</p>
<ol>
<li>是在哪里判断文件是否播放完毕,获取数据包,还是使用数据包时?</li>
<li>判断文件已经播放完毕了,那么接下来要怎么做尼?不能关闭播放器。</li>
</ol>
Android Studio调试C语言
https://segmentfault.com/q/1010000013002272
2018-01-26T12:00:18+08:00
2018-01-26T12:00:18+08:00
JDNew
https://segmentfault.com/u/jdnew
0
<p>我有一个module依赖了一个library,这个library是C写的库,用于NDK的。我单纯依赖这个库的话调试是可以进入C代码的。<br>但我现在module需要依赖另外一个库,那个库里是已经有打包好的so包,我发现如果我依赖了这个有so包的库后,我调试的时候,原先那个library就进入不到C代码里面看了?</p>
android NDK 中的prebuilt库会被拷贝到apk中吗?
https://segmentfault.com/q/1010000012945316
2018-01-23T01:32:21+08:00
2018-01-23T01:32:21+08:00
joeee
https://segmentfault.com/u/joeee
0
<p>prebuilt library是在应用运行时链接吗?<br>还是 直接编译到shared library中?</p>
android studio导入so库的项目运行报错 java.lang.UnsatisfiedLinkError
https://segmentfault.com/q/1010000012407321
2017-12-13T14:20:11+08:00
2017-12-13T14:20:11+08:00
艾苏北郡的小铁匠
https://segmentfault.com/u/aisubeijundexiaotiejiang
0
<p>Process: com.sunpanel.testvideoview, PID: 2662</p>
<pre><code> java.lang.UnsatisfiedLinkError: Native method not found: com.sunpanel.video.Video.nativeSetSurface:(Landroid/view/Surface;)V
at com.sunpanel.video.Video.nativeSetSurface(Native Method)
at com.sunpanel.video.Video.SetSuface(Video.java:62)
at com.sunpanel.testvideoview.MainActivity.openVideo(MainActivity.java:146)
</code></pre>
<p>哪位大神遇到过?</p>
java.lang.UnsatisfiedLinkError: No implementation found
https://segmentfault.com/q/1010000012114279
2017-11-22T16:10:03+08:00
2017-11-22T16:10:03+08:00
netstu
https://segmentfault.com/u/netstu
0
<pre><code>package aa;
public class NativeTest {
public static void a(Object obj);
public static string b();
public static string c();
}</code></pre>
<p>jni中的写法如下</p>
<pre><code>#include <jni.h>
#include <cstring>
extern "C" {
JNIEXPORT void JNICALL Java_aa_NativeTest_a (JNIEnv *env, jclass type,jobject obj) {
//todo
}
JNIEXPORT jstring JNICALL Java_aa_NativeTest_b (JNIEnv *env, jclass type) {
return env->NewStringUTF("bb");
}
}</code></pre>
<p>有两点十分搞不明白:<br>1.在android studio中,另一个Module中同样的,完全正常运行,没有任何错误。但此module就是一直提示没有实现NativeTest.a(Object)<br>2.NativeTest.b()在同一个cpp中实现,就能正确运行,只是NativeTest.a(Object)提示找不到C实现</p>
android studio 开发ndk c/c++ 函数无法跳转
https://segmentfault.com/q/1010000012039539
2017-11-16T20:16:35+08:00
2017-11-16T20:16:35+08:00
凸一_一凸
https://segmentfault.com/u/gnaixx
0
<pre><code>externalNativeBuild {
ndkBuild {
path 'src/main/jni/Android.mk'
}
}</code></pre>
<p>通过配置externalNativeBuild时开发ndk 但是 c/c++ 函数无法跳转</p>
gradle如何调用shell脚本(Windows)?
https://segmentfault.com/q/1010000009999449
2017-06-30T16:16:19+08:00
2017-06-30T16:16:19+08:00
AnakinSky
https://segmentfault.com/u/anakinsky
0
<p>想利用gradle调用shell编译;</p>
<pre><code> commandLine "cmd", "/c", "$buildDir/jni/AndroidBuild.sh",</code></pre>
<p>貌似到<code>cmd</code>这里就报错了,</p>
<pre><code>Error:Execution failed for task ':ui_core:ndkBuild'.
> Process 'command 'cmd'' finished with non-zero exit value 1</code></pre>
AndroidStudio 编写C++代码的时候如何实现代码自动补全?
https://segmentfault.com/q/1010000010002412
2017-06-30T19:38:19+08:00
2017-06-30T19:38:19+08:00
AnakinSky
https://segmentfault.com/u/anakinsky
0
<p>如题<del>~</del><del>~</del><del>~</del><del>~</del><del>~</del><del>~</del><del>~</del><del>~</del><del>~</del><del>~</del><del>~</del>~</p>
如何在一个app中混合使用32和64位的.so库
https://segmentfault.com/q/1010000010440256
2017-08-01T09:28:38+08:00
2017-08-01T09:28:38+08:00
DEBUG_
https://segmentfault.com/u/dengmaolin
0
<p>需求:我的app有两个功能需要用so库:录音和编辑pdf,当app运行在32位设备上时只能都用32位so,运行在64位设备时,我希望录音继续用32位so,编辑pdf用64位so。原因在此不解释了</p>
<p>实际结果:我尝试先把32位so放到jnilib,把64位so放到assets,然后开新进程 system.load动态拷贝加载64位so,报错!android不支持在一个app混合使用so,要么全部只用32位,要么只用64位so。因为在安装这个app的时候就已经确定,这个app是运行在32 or 64位的虚拟机。</p>
<p>我在stackoverflow提了一个问题,有个外国大牛回答了此问题,但是我不太明白他说的:“ and run a arm64-v8a executable from Java with Runtime.exec() or from C with system().” 是啥意思,大家帮我看下</p>
<p><a href="https://link.segmentfault.com/?enc=ExWUVe5CZoC0RWBPvtwrlA%3D%3D.eEXez%2Br9mDX6RQVFmosjvstMryq3p%2FQoP6M9v%2BBOUUomY2HHNuV%2FveH2KVFztJY6gvDAdPDTurN0e%2BQ06bPQSSDgVXR%2FcRbl2ofXGODODsZVtoGyiD1C5SF6SrUZpR4x" rel="nofollow">https://stackoverflow.com/que...</a></p>
C 开发 socket 调用 bind 函数 crash
https://segmentfault.com/q/1010000010221278
2017-07-17T16:16:46+08:00
2017-07-17T16:16:46+08:00
凸一_一凸
https://segmentfault.com/u/gnaixx
0
<p>android ndk 开发 socket,在调用 bind 函数的时候 crash。</p>
<pre><code>//绑定端口
static int bindSocketToPort(JNIEnv *env, jobject obj, int sd, unsigned short port) {
struct sockaddr_in address;
memset(&address, 0, sizeof(address));
address.sin_family = PF_INET;
address.sin_addr.s_addr = htonl(INADDR_ANY); //绑定所有地址
address.sin_port = htons(port); //转化为网络编码 big-endian
logMessage(env, obj, "Binding to port %hu.", port);
if (bind(sd, (struct sockaddr *) &address, sizeof(address)) == -1) {
throwErrnoException(env, IOEXCEPTION, errno);
}
}</code></pre>
<p>单步调试 sd 正常 port 设置为0</p>
<p><img src="/img/bVQ3bs?w=1114&h=387" alt="clipboard.png" title="clipboard.png"></p>
ndk 编译后的动态库so 文件具有可执行权限
https://segmentfault.com/q/1010000010150561
2017-07-12T10:29:12+08:00
2017-07-12T10:29:12+08:00
凸一_一凸
https://segmentfault.com/u/gnaixx
0
<p>在开发 NDK 的时候,发现编译出来的静态链接库具有可执行权限。本身是作为一个 lib 来用。</p>
<p><img src="/img/bVQKMP?w=569&h=84" alt="clipboard.png" title="clipboard.png"></p>
<p>所以有两个疑问:</p>
<ol>
<li><p>是否可以去掉可执行权限</p></li>
<li><p>是不是可以在 Android.mk 文件中做相关配置,去掉该执行权限</p></li>
</ol>
cocos2d-x android 打包 显示 In instantiation of 报错
https://segmentfault.com/q/1010000009872525
2017-06-21T15:43:17+08:00
2017-06-21T15:43:17+08:00
lony225
https://segmentfault.com/u/lony225
0
<p>我使用了模板定义多个成员相同,只是个别数组成员的长度不同的类。其中还包含了create的static工厂函数,类似于:</p>
<pre><code>/*a.h*/
template <int size>
Class A
{
int num1[size];
float num2[size];
public:
static A* create();
// ...
}</code></pre>
<p>然后我在AppDelegate.cpp中实例化了这些类。由于实例化模板需要知道函数具体定义,所以我只能把a.cpp中的成员函数定义都移到a.h中去,在vs下是可以编译通过的。</p>
<p>问题在于我之后在通过Eclipse adt打包时,会大量报类似于下图的错。<br><img src="/img/bVPAq5?w=1625&h=108" alt="图片描述" title="图片描述"></p>
<p>报错的具体行数在模板类里的函数调用另一个成员函数的地方。</p>
<p>是否跟Android.mk文件有关?大部分cpp文件的内容都已经移到了h中,所以我把原本的cpp文件都去掉了。</p>
<p>求问~!</p>
最近在测试NDK的时候一直挂在libc
https://segmentfault.com/q/1010000008016269
2017-01-05T10:14:29+08:00
2017-01-05T10:14:29+08:00
凸一_一凸
https://segmentfault.com/u/gnaixx
0
<p>最近在测试NDK的时候发现代码经常挂在libc上面,但是有时候又可以。这个错误又没有指出是那个地方调用导致了错误。毫无头绪</p>
<p>标签<code>TD_NDK</code>是自己打印的日志</p>
<pre><code class="bash">01-04 19:27:09.519 I/TD_NDK (25720): start_init [start_time:1483529229, abi:armeabi, abi_bit:32]
01-04 19:27:09.529 D/dalvikvm(25720): GC_CONCURRENT freed 694K, 27% free 8216K/11112K, paused 4ms+19ms, total 72ms
01-04 19:27:09.529 W/SurfaceFlinger( 127): WARNING: disp 2: connected, non-null list, layers=1
01-04 19:27:09.529 I/brcm-hwc( 127): virtual_display_management: defering composition for virtual display 2...
01-04 19:27:09.529 I/brcm-hwc( 127): update_wfc_scene: Virtual display 2, ignoring WFC scene update
01-04 19:27:09.539 I/TD_NDK (25720): start_init32 [e_entry:0xd, off:0x16438, size:36152]
01-04 19:27:09.539 F/libc (25720): Fatal signal 11 (SIGSEGV) at 0x6157b9b3 (code=1), thread 25720 (roid.armdemo304)
01-04 19:27:09.539 F/libc (25720): Unable to open connection to debuggerd: Connection refused
01-04 19:27:09.539 W/SurfaceFlinger( 127): WARNING: disp 2: connected, non-null list, layers=1</code></pre>
NDK编译时Link Error
https://segmentfault.com/q/1010000007448299
2016-11-11T09:35:07+08:00
2016-11-11T09:35:07+08:00
一懒众衫小
https://segmentfault.com/u/hnyashiro
0
<pre><code>Error:error: linker command failed with exit code 1 (use -v to see invocation)
</code></pre>
<p>在NDK-BUILD使用我的android.mk编译代码时用到了第三方库,出现如上所示错误!<br>在CMD下用NDK编译不报错,在linux下用nm命令查看,三方库函数已引入我自己的库中<br>而在androidstudio中编译,却报如第一行错误,也没有错误提示,不知道应该怎么处理了,求大神指点</p>
<pre><code>########################################################################################################################################################
# LivePublisher Complie
########################################################################################################################################################
include $(CLEAR_VARS)
LOCAL_MODULE := LivePublisher
LOCAL_SRC_FILES := LivePublisher.c
LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(FFInclude)
#$(warning $(LOCAL_C_INCLUDES))
LOCAL_LDLIBS += -llog -lz -lm -landroid -pthread
LOCAL_SHARED_LIBRARIES := avutil swresample avcodec avformat swscale postproc avfilter
include $(BUILD_SHARED_LIBRARY)</code></pre>
在AndroidStudio里编译jni出现ld错误
https://segmentfault.com/q/1010000007300974
2016-10-27T17:08:50+08:00
2016-10-27T17:08:50+08:00
一懒众衫小
https://segmentfault.com/u/hnyashiro
0
<p>遇到一个奇怪的问题,我在as里编译报错,导致我APK无法生成,而在CMD下,则一切正常</p>
<pre><code>在as里提示这个错误</code></pre>
<pre><code>Error:error: linker command failed with exit code 1 (use -v to see invocation)</code></pre>
<pre><code>在CMD下就是没有问题</code></pre>
<pre><code>[armeabi-v7a] Prebuilt : libavformat.so <= jni/ffmpeg/
[armeabi-v7a] Prebuilt : libavcodec.so <= jni/ffmpeg/
[armeabi-v7a] SharedLibrary : libMeetting.so
[armeabi-v7a] Install : libMeetting.so => libs/armeabi-v7a/libMeetting.so
[armeabi-v7a] Install : libavcodec.so => libs/armeabi-v7a/libavcodec.so
[armeabi-v7a] Install : libavformat.so => libs/armeabi-v7a/libavformat.so
</code></pre>
<p>这里是Android.mk的代码,想不出问题出在那里了,唉!请大家指点一下!不胜感激</p>
<pre><code>LOCAL_PATH := $(call my-dir)
FF := ffmpeg
FF_C:= $(FF)/include
########################################################################################################################################################
# FFMPEG into libMeetting.so to invoking
########################################################################################################################################################
#program build FFMPEG to libavformat.so(ffmpeg) in Android-ABI
include $(CLEAR_VARS)
LOCAL_MODULE := avformat
LOCAL_SRC_FILES := $(FF)/libavformat.so
LOCAL_C_INCLUDES := $(FF_C)/libavformat
include $(PREBUILT_SHARED_LIBRARY)
#program build FFMPEG to libavcodec.so(ffmpeg) in Android-ABI
include $(CLEAR_VARS)
LOCAL_MODULE := avcodec
LOCAL_SRC_FILES := $(FF)/libavcodec.so
LOCAL_C_INCLUDES := $(FF_C)/libavcodec
include $(PREBUILT_SHARED_LIBRARY)
########################################################################################################################################################
# Complie Meetting.so
########################################################################################################################################################
include $(CLEAR_VARS)
LOCAL_MODULE:=Meetting
LOCAL_SRC_FILES := Meetting.c
LOCAL_C_INCLUDES+=$(FF_C)/libavformat
LOCAL_C_INCLUDES+=$(FF_C)/libavcodec
LOCAL_SHARED_LIBRARIES := avformat avcodec
LOCAL_LDLIBS := -llog -lz -landroid
include $(BUILD_SHARED_LIBRARY)</code></pre>
androidstudio中用ndk编译的问题
https://segmentfault.com/q/1010000007444734
2016-11-10T18:32:30+08:00
2016-11-10T18:32:30+08:00
一懒众衫小
https://segmentfault.com/u/hnyashiro
0
<p>我在Ubuntu上将已编译好的ffmpeg放入我的androidstudio工程,配置OK后,为什么他提示</p>
<pre><code>Error:(319, 10) fatal error: 'libavcodec/avcodec.h' file not found
</code></pre>
<p>而同样的我在cmd里,进入到项止jni目录,用ndk-build直接编译就不会出现这个问题,求大神指点</p>
<p>这是我gradle的代码</p>
<pre><code>apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.zyt.vm.lp"
minSdkVersion 10
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
jniDebuggable true
}
}
sourceSets.main {
jni.srcDirs = [] // This prevents the auto generation of Android.mk
jniLibs.srcDir 'src/main/libs' // This is not necessary unless you have precompiled libraries in your project.
//jniLibs.srcDirs = ['src/main/libs','src/main/jniLibs']
}
externalNativeBuild{
ndkBuild{
path file('src\\main\\jni\\Android.mk')
}
}
task buildNative(type: Exec, description: 'Compile JNI source via NDK') {
def ndkDir = android.ndkDirectory
commandLine "$ndkDir/ndk-build.cmd",
'-C', file('src/main/jni').absolutePath, // Change src/main/jni the relative path to your jni source
'-j', Runtime.runtime.availableProcessors(),
'all',
'NDK_DEBUG=1',
'NDK_LOG=1'
}
task cleanNative(type: Exec, description: 'Clean JNI object files') {
def ndkDir = android.ndkDirectory
commandLine "$ndkDir/ndk-build.cmd",
'-C', file('src/main/jni').absolutePath, // Change src/main/jni the relative path to your jni source
'clean'
}
clean.dependsOn 'cleanNative'
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn buildNative
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.0'
testCompile 'junit:junit:4.12'
}
</code></pre>
<pre><code>
########################################################################################################################################################
# LivePublisher Complie
########################################################################################################################################################
include $(CLEAR_VARS)
LOCAL_MODULE := LivePublisher
LOCAL_SRC_FILES := LivePublisher.c
#LOCAL_C_INCLUDES := \
#$(FFInclude)
LOCAL_LDLIBS:=-llog -lz -lm -landroid
LOCAL_SHARED_LIBRARIES := avformat avutil avcodec avfilter postproc swresample swscale
#LOCAL_CFLAGS:= "-I$(FF)/ffmpeg/include"
include $(BUILD_SHARED_LIBRARY)</code></pre>
<p>编译好的几个库大体都是这样写的</p>
<pre><code>#libavformat
include $(CLEAR_VARS)
LOCAL_MODULE := avformat
LOCAL_SRC_FILES := $(FF)/libavformat.so
LOCAL_EXPORT_C_INCLUDES := $(FFInclude)
include $(PREBUILT_SHARED_LIBRARY)</code></pre>
哪位大兄弟有用 cMake 开发Android ndk的
https://segmentfault.com/q/1010000007205830
2016-10-18T18:22:07+08:00
2016-10-18T18:22:07+08:00
凸一_一凸
https://segmentfault.com/u/gnaixx
0
<p>一直用 Android studio 开发ndk,但是gradle支持的不是很好,只有<code>experimental</code> 版本支持 配置各种蛋疼。主要每次新建一个module都要修改配置半天。<br>之前也看到过google 开发文档有提到 cmake 但是一直没用。哪位大兄弟用过,说下经验</p>
AndroidStudio调试NDK的问题
https://segmentfault.com/q/1010000007145976
2016-10-12T17:18:46+08:00
2016-10-12T17:18:46+08:00
一懒众衫小
https://segmentfault.com/u/hnyashiro
0
<p>NDK,LLDB都正确安装配置了,连接LLDB也成功了!可是为什么点Debug后进不了断点,同时也导致了Debugger窗口也没有任何数据输出!请指教我应该如何才能调试,我在windows下</p>
android studio 开发NDK,怎么使用第三方的C++代码
https://segmentfault.com/q/1010000006985339
2016-09-23T12:41:06+08:00
2016-09-23T12:41:06+08:00
听见海的声音
https://segmentfault.com/u/cometwang
0
<p>我的android studio 2.2中开发NDK,在jni目录下编写C++代码,我现在想用第三方的C++库(JavaScriptCore),请问应该如何放置这个第三方库,直接放在jni目录下编辑器会出现标红找不到的情况。</p>
VLC报错build
https://segmentfault.com/q/1010000006190135
2016-08-06T16:09:26+08:00
2016-08-06T16:09:26+08:00
devwang_com
https://segmentfault.com/u/devwang_com
0
<p>$ ndk-build</p>
<p>make: <em>*</em> 没有规则可以创建“obj/local/armeabi/objs/vlc/libvlcjni-modules.o”需要的目标“jni/libvlcjni-modules.c”。 停止。</p>
<p>报错,使用everything查找,确实没有【libvlcjni-modules.c】这个文件。</p>
<p>源码来自:<br><a href="https://link.segmentfault.com/?enc=JDb9VMM0FpQo1eMEQqb%2BsA%3D%3D.PZ1uX%2FOzo3rNe%2BHy%2F%2B2og1ORbK%2BqA%2FigyFKuIj7R2%2BQkEfej4jrb6FWCs7hVTajM" rel="nofollow">https://code.videolan.org/vid...</a></p>
Android Studio2.1上搭建ndk环境 Android NDK: Aborting... . Stop.a
https://segmentfault.com/q/1010000006166450
2016-08-04T11:20:19+08:00
2016-08-04T11:20:19+08:00
_skyler
https://segmentfault.com/u/_skyler
0
<p>我在Android Studio上集成ndk环境,直接用内置SDK tools下载的ndk,demo可以通过编译,但是一运行还没进入代码<br>就报这个错误:</p>
<p><img src="/img/bVz2iE" alt="图片描述" title="图片描述"></p>
<p>build中是这样写的:</p>
<pre><code>sourceSets.main {
res.srcDirs = ['src/main/res']
jniLibs.srcDirs = ['src/main/jniLibs']
jni.srcDirs = ['src/main/jni/']
}
buildTypes {
debug {
jniDebuggable = true
ndk {
moduleName "CipherUtils" //生成的so名字
abiFilters "armeabi", "armeabi-v7a", "x86" //输出指定三种abi体系结构下的so库。
}
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
ndk {
moduleName "CipherUtils" //生成的so名字
abiFilters "armeabi", "armeabi-v7a", "x86" //输出指定三种abi体系结构下的so库。
}
}
</code></pre>
<p>网上找了一些方法也都没效果:<br>试过换ndk没用</p>
<p>也试过修改成这样:</p>
<pre><code>sourceSets.main{
jni.srcDirs=[]//据说这样写是防止自动生成,android.mk
}</code></pre>
<p>这样是可以进入代码了,但是在System.loadLibrary("CipherUtils");的时候回崩溃,报找不到so的错误:</p>
<pre><code>java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/upyp.jnitest-2/base.apk"],nativeLibraryDirectories=[/data/app/upyp.jnitest-2/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libCipherUtils.so"</code></pre>
<p>请问有有没有解决方法?</p>
ndk开发 popen函数替代
https://segmentfault.com/q/1010000006107936
2016-07-29T09:54:48+08:00
2016-07-29T09:54:48+08:00
凸一_一凸
https://segmentfault.com/u/gnaixx
0
<p>ndk开发中需要用到 命令获取一些参数信息,目前知道的是有两种方法</p>
<ol>
<li><p>popen</p></li>
<li><p>system</p></li>
</ol>
<p>popen发现在小米商店上不了架,但是system在Android下无法写入文件。<br>比如'ps > /sdcard/.log' 运行后可以发现'.log'文件已经创建 但是文件内并没有任务信息。</p>
<p>具体代码:</p>
<pre><code class="c"> FILE *fp;
char cmd[MAX];
char dir_path[MAX];
sprintf(dir_path, "/sdcard/.log");
sprintf(cmd, "ps > %s", dir_path);
int status;
sighandler_t old_handler;
old_handler = signal(SIGCHLD, SIG_DFL);
status = system(cmd);
signal(SIGCHLD, old_handler);
if(status < 0){
DEBUG_PRINT("cmd: %s\t error: %s", cmd, strerror(errno));
}
fp = fopen(dir_path, "r");
if (fp) {
while (fgets(line, MAX, fp)) {
process_count ++;
DEBUG_PRINT("msg:%s, len:%d", line, strlen(line));
}
}
fclose(fp);
</code></pre>
JNI中写原生c++代码编译,各种 error: 'xxx' does not name a type?
https://segmentfault.com/q/1010000006038133
2016-07-22T08:32:57+08:00
2016-07-22T08:32:57+08:00
ℳα
https://segmentfault.com/u/mango26
0
<pre><code>本人小白,以前是做Android的,现在刚开始做ndk开发,就我一人,使用的是studio,现在一般的java和c++之间的调用和传参没什么问题,但是现在在做的是一个人脸识别的项目,公司使用的是c++写的代码,c++代码很多,然后使用让我使用jni进行调用里面的方法,但是面临一个头疼的问题,就是,写好头文件之后,现在在拷贝他们的c++代码进来,除了调用的几个函数实现的时候用的是JNI的方式,其他的函数都是用的原生的c++代码,结果报了很多错误,先是头文件的错误,include<io.h>,<windows.h>都不行,后来和老大协商一下,改了一些代码,头文件不报错了,但是现在定义的全局变量,在编译的时候报了很多很多类似error: 'map' does not name a type,error: 'vector' does not name a type的错误,还有很多error: 'cout' was not declared in this scope的这种错误,由于对c++不熟悉,所以现在特别头疼,希望各位大神指点一二,江湖救急啊!!
都是报的是原生C++中的错误
</code></pre>
<p>我已经在全局进行声明了</p>
<pre><code>map<int, string> g_id2name;
map<int, int> g_id2line;
int g_numKeypoints = 0;
int g_numObjects = 0;
CvMemStorage* g_storageObj;
vector<int> g_labels;
vector<int> g_laplacians;
CvSeq *g_dbKeypoints = 0;
CvMat* g_objMat;
int g_curObject = 0;
int g_matchFileStatus = 0;
char* g_matchFileName = 0;
</code></pre>
<p>还是报了很多下面这种错误</p>
<pre><code>Error:(48, 1) error: 'map' does not name a type
Error:(53, 1) error: 'vector' does not name a type
Error:(94, 5) error: 'ifstream' was not declared in this scope
Error:(131, 9) error: 'cerr' was not declared in this scope
Error:(158, 5) error: 'cout' was not declared in this scope
Error:(160, 25) error: invalid operands of types 'int' and 'const char [2]' to binary 'operator<<'
Error:(536, 46) error: 'g_id2name' was not declared in this scope
。。。。。。
</code></pre>
Android NDK开发,JNI调用C++程序编译出现error: ld returned 1 exit status?
https://segmentfault.com/q/1010000006044216
2016-07-22T16:09:04+08:00
2016-07-22T16:09:04+08:00
ℳα
https://segmentfault.com/u/mango26
0
<p>各位大神,小弟现在做Android的ndk开发,使用的是Studio,现在是使用jni调用已存在的原生c++代码,生成头文件后,把c++代码拷过来进行调用的时候,编译一直出现Error:error: ld returned 1 exit status,不能编译通过,也加extern "C" 了,ndk路径什么都没问题,而且c++代码在VS上进行编译的时候就能通过,困扰了好久,网上也找不到答案,希望大家帮帮忙。。</p>
<pre><code>Error:error: ld returned 1 exit status
Error:Execution failed for task ':showbaby01:ndkBuild'.
> Process 'command 'D:\.../ndk-build.cmd'' finished with non-zero exit value 2</code></pre>
Android Studio 开发NDK 的两种方式选择
https://segmentfault.com/q/1010000005785075
2016-06-23T16:30:17+08:00
2016-06-23T16:30:17+08:00
凸一_一凸
https://segmentfault.com/u/gnaixx
0
<p>Android Studio 在很早就支持NDK开发了,但是一直没有正式版本的gradle支持。 <br>现在官方最新的<strong>experimental</strong>版本应该到了<a href="https://link.segmentfault.com/?enc=VfV%2FO9KL%2FRTS0di2vY%2F5mg%3D%3D.37xGpdnazchhuSera0MPINzSf9hHHnbDDlkLKBcDyzMlCoSS332zMwkuebQeFaDC2C9VDFDTDirOllWMLYuvKxk%2Bl2SR%2FOReKt7Il%2B7foe0%3D" rel="nofollow">0.7.0-alpha4</a></p>
<p>但是<strong>experimental</strong>版本各种不方便啊,之前也写过一篇教程<a href="https://segmentfault.com/a/1190000005174889">NDK开发 - Android Studio环境搭建</a></p>
<p>后来发现另外一种方式:在项目下建一个jni目录用配置好<code>Android.mk</code>,<code>Application.mk</code>,写好<code>C/C++</code>文件。最后用脚本编译生成并复制到相应的目录下,当然也可以用gradle的task,一次编译。 <br>第二种方式优点是可以不用修改<code>build.gradle</code>文件了。缺点可能是编译调试优点麻烦。</p>
<p>所以开发NDK的大神们 你们是用哪种方式开发的。或者有更好的开发方式。(先不考虑eclipse)</p>
不同NDK版本编译问题
https://segmentfault.com/q/1010000005811803
2016-06-27T17:22:44+08:00
2016-06-27T17:22:44+08:00
凸一_一凸
https://segmentfault.com/u/gnaixx
0
<p><strong>android-ndk-r9d</strong>版本只能编译</p>
<ul>
<li><p>armeabi</p></li>
<li><p>armeabi-v7a</p></li>
<li><p>mips</p></li>
<li><p>x86</p></li>
</ul>
<p>但是现在有很多64位的手机出现了,所以9d版本已经不够用了</p>
<p><strong>android-ndk-r11b</strong> 多了</p>
<ul>
<li><p>arm64-v8a</p></li>
<li><p>mips64</p></li>
<li><p>x86_64</p></li>
</ul>
<p>三个64位的cpu架构。</p>
<p>但是我发现11b编译的so在一些手机上无法运行比如我的华为c8813Q,所以我现在的解决方案是用9d编译的四个+11b编译多的三个。但是这样太特么麻烦了。</p>
集成so,安装的时候so大小变成0
https://segmentfault.com/q/1010000005724705
2016-06-15T14:04:01+08:00
2016-06-15T14:04:01+08:00
凸一_一凸
https://segmentfault.com/u/gnaixx
0
<p>项目里面集成了so目录如下<br><img src="/img/bVybpt" alt="clipboard.png" title="clipboard.png"><br>运行的时候发现安装后的so大小竟然变成了0,导致运行失败。</p>
<p><strong>解压apk发现编译后所有cpu架构的so大小都变成了0字节了</strong></p>
<p><strong>错误提示:</strong><br><code>java.lang.UnsatisfiedLinkError: dlopen failed: file offset for the library "/data/app/com.lomocoin.lomocoin-1/lib/arm/libfraudmetrix.so" >= file size: 0 >= 0</code></p>
<p><strong>调用:</strong></p>
<p><img src="/img/bVybp3" alt="clipboard.png" title="clipboard.png"></p>
Android ndk11b编译无法运行 9d正常
https://segmentfault.com/q/1010000005597007
2016-05-30T17:49:59+08:00
2016-05-30T17:49:59+08:00
凸一_一凸
https://segmentfault.com/u/gnaixx
0
<p>有没有遇到NDK-r11b编译的apk无法在一些机子上面运行,我手上的红米跟华为c8813Q都无法运行,但是nexus 5是可以正常运行的。但是用NDK-r9d编译的又都是正常的。不过NDK-r9d无法编译64位的SO。</p>
能不能用eclipse开发so文件 导入到android studio使用
https://segmentfault.com/q/1010000005069916
2016-05-06T09:59:19+08:00
2016-05-06T09:59:19+08:00
xuanxin
https://segmentfault.com/u/xuanxin
1
<p>android studio 2.0 不支持NDK的开发,或者说AS只能支持实验板的NDK开发,不确定是否实用,还要更改gradle语法,所以能不能使用eclipse开发出来so文件后导入到AS中使用,有没有这样做的同学,或者有更好的方法的,共享一下。尤其是生成头文件的处理,详细的说一下呢。</p>
求教NDK里边怎么执行安装手机内存里边的apk
https://segmentfault.com/q/1010000004941935
2016-04-14T22:08:45+08:00
2016-04-14T22:08:45+08:00
jennrcheng
https://segmentfault.com/u/jennrcheng
0
<p>求教NDK里边怎么执行安装手机内存里边的apk</p>
<p>现在在网上找到的都是在android应用里边安装apk。我现在fork了一个子进程,如果在c里边调用安装手机上的apk。调用apk的安装界面就可以了。</p>
<p>应该是什么命令呢,谢谢。</p>
android ndk
https://segmentfault.com/q/1010000004544671
2016-03-05T12:02:49+08:00
2016-03-05T12:02:49+08:00
丘处机秋
https://segmentfault.com/u/qiuchujiqiu
0
<p>cmd里ndk-build生成了os文件,然后把os文件放到另一个项目,在那个项目里的代码写static{system.loadlibrary(“hello-jni”);}<br>public native String stringFromJNI()<br>报错找不到native方法</p>
android ndk的demo
https://segmentfault.com/q/1010000004544680
2016-03-05T12:10:54+08:00
2016-03-05T12:10:54+08:00
丘处机秋
https://segmentfault.com/u/qiuchujiqiu
0
<p>下了ndk的插件,把hello-jni的demo 在cmd里ndk-build生成os文件,再把该文件放其它项目里运行,报错说找不到native方法</p>
关于Android中JNI使用的两个问题?
https://segmentfault.com/q/1010000004332429
2016-01-19T15:54:01+08:00
2016-01-19T15:54:01+08:00
杨辉
https://segmentfault.com/u/yanghui
0
<ol>
<li><p>加载so的时候,System.loadLibrary(""); 函数能放在子线程进行吗?<br>因为,放在主线程,发现有小概率发生ANR。</p></li>
<li><p>调用native方法能放在子线程吗?</p></li>
</ol>
Android NDK 运行时如下错误怎么破
https://segmentfault.com/q/1010000004094218
2015-12-04T09:48:00+08:00
2015-12-04T09:48:00+08:00
zhiyong357
https://segmentfault.com/u/zhiyong357
0
<p>build 成功,但是运行时提示如下错误,求方法</p>
<pre><code>12-04 01:41:53.511: E/AndroidRuntime(941): FATAL EXCEPTION: main
12-04 01:41:53.511: E/AndroidRuntime(941): java.lang.ExceptionInInitializerError
12-04 01:41:53.511: E/AndroidRuntime(941): at com.secneo.android.hijacked.demoui.MainApplication.onCreate(MainApplication.java:12)
12-04 01:41:53.511: E/AndroidRuntime(941): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:969)
12-04 01:41:53.511: E/AndroidRuntime(941): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3954)
12-04 01:41:53.511: E/AndroidRuntime(941): at android.app.ActivityThread.access$1300(ActivityThread.java:123)
12-04 01:41:53.511: E/AndroidRuntime(941): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1185)
12-04 01:41:53.511: E/AndroidRuntime(941): at android.os.Handler.dispatchMessage(Handler.java:99)
12-04 01:41:53.511: E/AndroidRuntime(941): at android.os.Looper.loop(Looper.java:137)
12-04 01:41:53.511: E/AndroidRuntime(941): at android.app.ActivityThread.main(ActivityThread.java:4424)
12-04 01:41:53.511: E/AndroidRuntime(941): at java.lang.reflect.Method.invokeNative(Native Method)
12-04 01:41:53.511: E/AndroidRuntime(941): at java.lang.reflect.Method.invoke(Method.java:511)
12-04 01:41:53.511: E/AndroidRuntime(941): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
12-04 01:41:53.511: E/AndroidRuntime(941): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
12-04 01:41:53.511: E/AndroidRuntime(941): at dalvik.system.NativeStart.main(Native Method)
12-04 01:41:53.511: E/AndroidRuntime(941): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1285]: 37 cannot locate '_ZN8UiHijack8InstanceEv'...
12-04 01:41:53.511: E/AndroidRuntime(941): at java.lang.Runtime.loadLibrary(Runtime.java:370)
12-04 01:41:53.511: E/AndroidRuntime(941): at java.lang.System.loadLibrary(System.java:535)
12-04 01:41:53.511: E/AndroidRuntime(941): at com.bangcle.plugin.ahsdk.AHUtil.<clinit>(AHUtil.java:229)
12-04 01:41:53.511: E/AndroidRuntime(941): ... 13 more
</code></pre>
Windows是否适合ndk开发?
https://segmentfault.com/q/1010000004077183
2015-12-01T15:59:51+08:00
2015-12-01T15:59:51+08:00
TYZRPVX
https://segmentfault.com/u/tyzrpvx
0
<p>刚开始学习ndk开发,希望能得到一些建议。</p>
微信分享显示为null?
https://segmentfault.com/q/1010000004005577
2015-11-17T11:46:38+08:00
2015-11-17T11:46:38+08:00
梅罗
https://segmentfault.com/u/markliang
0
<p>NDK开发 android<br>问题描述:在游戏大厅里分享游戏,能分享成功。文字内容正确(你点击文字也会跳到下载链接)。<br>当进入游戏房间分享时:能分享成功,但文字内容为null<br>请问:可能出现的原因是什么,因为是个项目,所以只能请大家猜一下可能出现的原因。</p>
命令行程序如何获取系统(Android)已安装应用信息?
https://segmentfault.com/q/1010000003970708
2015-11-09T15:47:27+08:00
2015-11-09T15:47:27+08:00
aqtata
https://segmentfault.com/u/aqtata
0
<p>C++开发android命令行程序,如何获取本机已安装应用列表以及应用相关信息,比如名称版本号等。</p>
Android开发中用到的c++代码依赖其他第三方库,应该怎么编译?
https://segmentfault.com/q/1010000003844025
2015-10-11T21:55:21+08:00
2015-10-11T21:55:21+08:00
TangJiong
https://segmentfault.com/u/tangjiong
0
<p>最近在做一个计算机视觉方面的Android项目,其中的核心的图形处理算法是用c++写的,现在需要做的是把这部分c++代码移植到Android上,然后再加一些UI,方便测试。google了解到通过NDK和JNI的方式是可以在Android里使用c++代码的。现在的问题是这部分算法的c++代码依赖很多第三方的库,如opencv, g2o, boost等,我应该怎么来编译整个项目?</p>
<p>由于之前没怎么做过c++的项目,对c++项目编译过程中的依赖关系完全搞不懂。请问一下,我应该怎么解决这个问题?</p>
使用NDK 时 无法生成 x86的so包
https://segmentfault.com/q/1010000003691229
2015-08-31T19:08:10+08:00
2015-08-31T19:08:10+08:00
LiShuai
https://segmentfault.com/u/lishuai_61d5c98ddc832
0
<p>在使用ndk的时候 发现不能生成 x86的so包,而armeabi和armeabi-v7a的so包可以正常生成。</p>
<p>报错信息如下图所示:</p>
<p><img src="/img/bVpEp6" alt="图片描述" title="图片描述"></p>
AndroidStudio 搭建混合编程环境
https://segmentfault.com/q/1010000003502098
2015-08-27T18:49:42+08:00
2015-08-27T18:49:42+08:00
子晓_believe
https://segmentfault.com/u/zixiao_believe
0
<p>操作系统: Mac OS X 10.10.4<br>软件:Android Studio 1.3(2015.7.28 更新)</p>
<p>问题描述:如何搭建混合编程环境,据文档描述,Android studio是在1.3之后支持c语言的,但是不知道具体搭建步骤<img src="/img/bVoRdz" alt="图片描述" title="图片描述"></p>
<p>我在这里点击安装ndk 但是一支下载失败(sdk可以更新,不是墙的问题)</p>
<p>感谢回复</p>