简体   繁体   English

将 Android Studio 升级到版本 3.3 后无法选择 JNI 构建变体

[英]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.

相关问题 Android Studio 无法选择构建变体 - Android Studio Unable to Select Build Variant 无法在Android Studio 3.3中构建签名的APK - Unable to Build Signed APK in Android Studio 3.3 无法在 Android Studio 中切换到调试构建变体 - Unable to switch to debug build variant in Android Studio 升级到Gradle 5和Android插件3.3之后,我的构建失败了“Metaspace” - After upgrading to Gradle 5 and Android Plugin 3.3, my build fails with “Metaspace” 从 Android Studio 3.3 升级后,Android Studio 3.4 在加载项目时冻结 - Android Studio 3.4 freezing on loading project after upgrading from Android Studio 3.3 错误:找不到 com.android.tools.build:gradle:3.3。 升级 splunk:mint-android-sdk 的 gradle 版本后引发问题 - Error:Could not find com.android.tools.build:gradle:3.3. Issue raise after upgrading gradle version for splunk:mint-android-sdk Android Studio 3.6 总是选择第一个构建变体 - Android Studio 3.6 always select the first build variant 升级Android Studio后,Android Studio构建错误 - Android Studio Build Error After Upgrading Android Studio Android Studio陈旧APK for xml更改后的构建变体 - Android Studio stale APK for build variant after xml changes 升级构建工具版本android studio有哪些优缺点 - What advantages and disadvantages of upgrading build tools version android studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM