[英]Unable to select JNI build variant after upgrading Android Studio to version 3.3
I have a Java Android project that includes JNI code written in C.我有一个 Java Android 项目,其中包含用 C 编写的 JNI 代码。
I often need to debug into the native code and before upgrading Android Studio to version 3.3
it was working.我经常需要调试到本机代码中,在将 Android Studio 升级到3.3
版之前,它可以正常工作。
Now in my project view I don't have any code in my cpp folder.现在在我的项目视图中,我的 cpp 文件夹中没有任何代码。 I have confirmed that all of the C libraries
are in the folder on my HDD.我已经确认所有的C libraries
都在我的硬盘上的文件夹中。 The CMAKE file is also missing from the project view but is also in the correct place on my HDD. CMAKE 文件也从项目视图中丢失,但也在我的硬盘上的正确位置。
I have not changed any code from my source control since upgrading.自升级以来,我没有更改源代码管理中的任何代码。
I am using我在用
'com.android.tools.build:gradle:3.3.0'.
In the Build Variants section next to my JNI module I just have five dashes instead of the debug/production options.在 JNI 模块旁边的 Build Variants 部分中,我只有五个破折号而不是调试/生产选项。
I have uninstalled and reinstalled android studio too.我也卸载并重新安装了android studio。
Is it possible after upgrading I need to add something to my configuration to correct including CMAKE?升级后是否有可能我需要在我的配置中添加一些东西来纠正包括 CMAKE?
I had the same issue, just figured it out.我有同样的问题,只是想通了。 In AndroidStudio 3.3.1, they changed things around a bit I guess.在 AndroidStudio 3.3.1 中,我猜他们改变了一些东西。 Now you have to link your NDK build to the app you are building it as part of.现在,您必须将 NDK 构建链接到您正在构建它的应用程序。
This is documented at: https://developer.android.com/studio/projects/gradle-external-native-builds这记录在: https : //developer.android.com/studio/projects/gradle-external-native-builds
The section, "Use the Android Studio UI" is what you want. “使用 Android Studio UI”部分正是您想要的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.