简体   繁体   English

Android工作室中的NDK集成

[英]NDK integration in Android studio

Today I updated my android studio to 1.3 and I enter the NDK (android-ndk-r10e NDK version) path in local.properties (ndk.dir=C:\\AndroidNDK\\android-ndk-r10e\\android-ndk-r10e) but I got this error. 今天我将我的android工作室更新为1.3,然后在local.properties中输入NDK(android-ndk-r10e NDK版本)路径(ndk.dir = C:\\ AndroidNDK \\ android-ndk-r10e \\ android-ndk-r10e)但是我收到了这个错误。

Error:Execution failed for task ':app:compileDebugNdk'. 错误:任务':app:compileDebugNdk'的执行失败。

Error: NDK integration is deprecated in the current plugin. 错误:当前插件中不推荐使用NDK集成。 Consider trying the new experimental plugin. 考虑尝试新的实验插件。 For details, see http://tools.android.com/tech-docs/new-build-system/gradle-experimental . 有关详细信息,请参阅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”以继续使用当前的NDK集成。

please help me to solve this issue 请帮我解决这个问题

Set android.useDeprecatedNdk=true in gradle.properties to continue using the current NDK integration. gradle.properties设置android.useDeprecatedNdk=true以继续使用当前的NDK集成。

You just have to follow the instruction which is given to you in the error. 您只需按照错误中给出的指令进行操作即可。

Add following code in your build.gradle 在build.gradle中添加以下代码

 sourceSets {
        main {
            jni.srcDirs = []
        }
    }

This may solve your problem.. 这可以解决你的问题..

r10e is fine on CLI with gradlew. 在使用gradlew的CLI上r10e很好。

r10e is fine with androidStudio's version of gradle (gradl-2.4 in AS-1.3) r10e适用于androidStudio的gradle版本(AS-1.3中的gradl-2.4)

as long as you still use the approach mention here by 'ph0b'. 只要你仍然使用'ph0b' 这里提到方法 see the 'sample .gradle file' and note that IMO and maybe in his view as well - u still dont want the default AS ndk process ( you want to do some extra config work and maintain full control yourself ).Ph0b blogs on ndk show how to do it all yourself and not to rely on the android.mk gen'd by AS. 看看'示例.gradle文件',并注意到IMO,也许在他看来 - 你仍然不想要默认的AS ndk进程(你想做一些额外的配置工作并自己保持完全控制).Ph0b博客在ndk上显示如何自己完成所有操作,而不是依赖于AS的android.mk。 I still use my own exec for ndk and my own make files as explain by ph0b. 我仍然使用我自己的exec为ndk和我自己的make文件作为ph0b的解释。 All good with r10e / AS 1.3 on linux. 在linux上使用r10e / AS 1.3都很好。

my CLI stdout.... 我的CLI标准....

:app:ndkBuild
make: Entering directory `/home/rob/src/speechnw/app/src/main/jni'
[armeabi-v7a] Compile thumb  : audioboo-ogg <= bitwise.c
[armeabi-v7a] Compile thumb  : audioboo-ogg <= framing.c
[armeabi-v7a] StaticLibrary  : libaudioboo-ogg.a
[armeabi-v7a] Compile thumb  : audioboo-flac <= bitmath.c
[armeabi-v7a] Compile thumb  : audioboo-flac <= bitreader.c
[armeabi-v7a] Compile thumb  : audioboo-flac <= cpu.c
[armeabi-v7a] Compile thumb  : audioboo-flac <= crc.c
[armeabi-v7a] Compile thumb  : audioboo-flac <= fixed.c
[armeabi-v7a] Compile thumb  : audioboo-flac <= float.c
[armeabi-v7a] Compile thumb  : audioboo-flac <= format.c
[armeabi-v7a] Compile thumb  : audioboo-flac <= lpc.c
[armeabi-v7a] Compile thumb  : audioboo-flac <= md5.c
[armeabi-v7a] Compile thumb  : audioboo-flac <= memory.c
[armeabi-v7a] Compile thumb  : audioboo-flac <= metadata_iterators.c
[armeabi-v7a] Compile thumb  : audioboo-flac <= metadata_object.c
[armeabi-v7a] Compile thumb  : audioboo-flac <= ogg_decoder_aspect.c
[armeabi-v7a] Compile thumb  : audioboo-flac <= ogg_encoder_aspect.c
[armeabi-v7a] Compile thumb  : audioboo-flac <= ogg_helper.c
[armeabi-v7a] Compile thumb  : audioboo-flac <= ogg_mapping.c
[armeabi-v7a] Compile thumb  : audioboo-flac <= stream_decoder.c
[armeabi-v7a] Compile thumb  : audioboo-flac <= stream_encoder.c
[armeabi-v7a] Compile thumb  : audioboo-flac <= stream_encoder_framing.c
[armeabi-v7a] Compile thumb  : audioboo-flac <= window.c
[armeabi-v7a] Compile thumb  : audioboo-flac <= bitwriter.c
[armeabi-v7a] StaticLibrary  : libaudioboo-flac.a
[armeabi-v7a] Compile++ thumb: audioboo-native <= FLACStreamEncoder.cpp
[armeabi-v7a] Compile++ thumb: audioboo-native <= FLACStreamDecoder.cpp
[armeabi-v7a] Compile++ thumb: audioboo-native <= util.cpp
[armeabi-v7a] StaticLibrary  : libstdc++.a
[armeabi-v7a] SharedLibrary  : libaudioboo-native.so
[armeabi-v7a] Install        : libaudioboo-native.so => libs/armeabi-v7a/libaudioboo-native.so
[x86] Compile        : audioboo-ogg <= bitwise.c
[x86] Compile        : audioboo-ogg <= framing.c
[x86] StaticLibrary  : libaudioboo-ogg.a
[x86] Compile        : audioboo-flac <= bitmath.c
[x86] Compile        : audioboo-flac <= bitreader.c
[x86] Compile        : audioboo-flac <= cpu.c
[x86] Compile        : audioboo-flac <= crc.c
[x86] Compile        : audioboo-flac <= fixed.c
[x86] Compile        : audioboo-flac <= float.c
[x86] Compile        : audioboo-flac <= format.c
[x86] Compile        : audioboo-flac <= lpc.c
[x86] Compile        : audioboo-flac <= md5.c
[x86] Compile        : audioboo-flac <= memory.c
[x86] Compile        : audioboo-flac <= metadata_iterators.c
[x86] Compile        : audioboo-flac <= metadata_object.c
[x86] Compile        : audioboo-flac <= ogg_decoder_aspect.c
[x86] Compile        : audioboo-flac <= ogg_encoder_aspect.c
[x86] Compile        : audioboo-flac <= ogg_helper.c
[x86] Compile        : audioboo-flac <= ogg_mapping.c
[x86] Compile        : audioboo-flac <= stream_decoder.c
[x86] Compile        : audioboo-flac <= stream_encoder.c
[x86] Compile        : audioboo-flac <= stream_encoder_framing.c
[x86] Compile        : audioboo-flac <= window.c
[x86] Compile        : audioboo-flac <= bitwriter.c
[x86] StaticLibrary  : libaudioboo-flac.a
[x86] Compile++      : audioboo-native <= FLACStreamEncoder.cpp
[x86] Compile++      : audioboo-native <= FLACStreamDecoder.cpp
[x86] Compile++      : audioboo-native <= util.cpp
[x86] StaticLibrary  : libstdc++.a
[x86] SharedLibrary  : libaudioboo-native.so
[x86] Install        : libaudioboo-native.so => libs/x86/libaudioboo-native.so
make: Leaving directory `/home/rob/src/speechnw/app/src/main/jni'
:app:compileDebugJava

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM