且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将Visual C ++库导入Android Studio项目?

更新时间:2023-11-13 16:56:22

您可以使用Visual Studio内置的libRandString.so;您不需要 build.gradle 中的externalNativeBuild块,而无需ndkBuild任务,也不需要nativeLibsToJar任务. Android Studio将从 jniLibs 目录中提取预构建的文件,然后将其打包到APK中.

You can use the libRandString.so which was built with Visual Studio; you don't need the externalNativeBuild block and not ndkBuild task and not the nativeLibsToJar task in your build.gradle. Android Studio will pick up the prebuilt files from jniLibs directory and pack them into the APK for you.