• [android ndk] -android studio中编译生成so文件


    1.android.useDeprecatedNdk=true

    Error:Execution failed for task ':app:compileDebugNdk'.
    > Error: NDK integration is deprecated in the current plugin. Consider trying the new experimental plugin. For details, see http://tools.android.com/tech-docs/new-build-system/gradle-experimental. Set "android.useDeprecatedNdk=true" in gradle.properties to continue using the current NDK integration.

    该问题是需要在工程目录下的gradle.properties文件下,加上android.useDeprecatedNdk=true即可

     ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    2.build.gradle少了配置

    Warning:Native C/C++ source code is found, but it seems that NDK option is not configured. Note that if you have an Android.mk, it is not used for compilation. The recommended workaround is to remove the default jni source code directory by adding:
    android {
    sourceSets {
    main {
    jni.srcDirs = []
    }
    }
    }
    to build.gradle, manually compile the code with ndk-build, and then place the resulting shared object in src/main/jniLibs.
    make.exe: *** No rule to make target `E:as_workspacesIntentDemoappuildintermediates dkdebugobj/local/armeabi-v7a/objs/app/E_as_workspacesIntentDemoappsrcmainjni', needed by `E:as_workspacesIntentDemoappuildintermediates dkdebugobj/local/armeabi-v7a/objs/app/E_as_workspacesIntentDemoappsrcmainjniJNI_Demo.o'. Stop.
    :app:compileDebugNdk FAILED

    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    3.

    make.exe: *** No rule to make target `E:as_workspacesIntentDemoappuildintermediates dkdebugobj/local/armeabi-v7a/objs/JNI_Demo/E_as_workspacesIntentDemoappsrcmainjni', needed by `E:as_workspacesIntentDemoappuildintermediates dkdebugobj/local/armeabi-v7a/objs/JNI_Demo/E_as_workspacesIntentDemoappsrcmainjniJNI_Demo.o'.  Stop.

    Error:Execution failed for task ':app:compileDebugNdk'.
    > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:Androidandroid-ndk-r10 dk-build.cmd'' finished with non-zero exit value 2

    ------------------------------------------------------------------------------- 

    4.关于Eclipse中始终无法编译通过的问题

    如果觉得JNI的代码都没有错,就先clean一下项目清下缓存,然后把命令行窗口关闭,重新再打开。再试一下即可。

    ------------------------------------------------------------------------------- 

    5.Android NDK: WARNING: APP_PLATFORM android-19 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml

    如果.mk文件里没有定义APP_PLATFORM android-19,那么会使用默认的。所以加上后,把project.properties里面也改成target=android-19。AndroidManifest.xml里面android:minSdkVersion可以不改

    ------------------------------------------------------------------------------- 

    6.Android NDK: LOCAL_MODULE definition in jni/Android.mk must not contain space

    这个问题是因为.mk文件里面有空格字符,你可以把里面的中文注释都去掉,把中文空格都改成英文空格,或者干脆都去掉。

    ------------------------------------------------------------------------------- 

    7.

    http://www.th7.cn/Program/Android/201509/550864.shtml

    http://blog.csdn.net/lamp_zy/article/details/48976737

    http://blog.k-res.net/archives/1788.html

    http://www.cnblogs.com/flyme/p/4431762.html

    http://blog.k-res.net/archives/1788.html

  • 相关阅读:
    DNS
    NTP服务
    DHCP服务
    NFS服务、SSHD服务
    samba 、 FTP 、 lrzsz工具
    centos7系统忘记root密码
    linux系统rpm和yum软件包管理
    linux系统命令(调试命令)(nmtui,ip a、ss、ps、uptime、top、lsof、grep,iotop、iftop)
    浅聊TCP的三次握手和四次挥手
    C语言学习笔记--动态库和静态库的使用
  • 原文地址:https://www.cnblogs.com/royi123/p/5168268.html
Copyright © 2020-2023  润新知