当前位置:网站首页>Error:Execution failed for task ':app:buildNative'. & gt; A problem occurred'x/x/x/'NDK build' error resolution
Error:Execution failed for task ':app:buildNative'. & gt; A problem occurred'x/x/x/'NDK build' error resolution
2022-06-11 05:37:00 【Cockroach bully BBQ】
The background of the story is like this The function of the project to scan the license plate number , I found one on the Internet demo( There are N Much of the .so and ram、x86、.h 、.cpp、.mk And so on ), Import android studio This error is reported when running , Then go and see yourself ndk route That's right! , And then over the wall googole After reading the relevant 66 Bar result It's still useless .
Finally, I had no choice but to see Local my ndk-build This thing , Two files with similar names were found , One is
ndk-build.cmd The other is ndk-buildand Stack Overflow There is a very good answer on it as follows :

It seems to distinguish , If it is windows The system will use tape .cmd Suffixed files run ( Don't android studio Can't you distinguish yourself ? doubt ....);
Finally, I put my own project build.gradle The file is changed to this as follows :
task buildNative(type: Exec, description: 'Compile JNI source via NDK') { def ndkDir = android.ndkDirectory if (Os.isFamily(Os.FAMILY_WINDOWS)) { commandLine "$ndkDir/ndk-build.cmd", '-C', file('src/main/jni').absolutePath, // Change src/main/jni the relative path to your jni source '-j', Runtime.runtime.availableProcessors(), 'all', 'NDK_DEBUG=0' } else { commandLine "$ndkDir/ndk-build", '-C', file('src/main/jni').absolutePath, // Change src/main/jni the relative path to your jni source '-j', Runtime.runtime.availableProcessors(), 'all', 'NDK_DEBUG=0' } }Pay attention to is if Inside Os You need to import a class :
import org.apache.tools.ant.taskdefs.condition.OsThis is written in build.gradle Just the first few lines of the file ...
And then compile 、 function 2 Minutes later ok No more mistakes Problem solving !
边栏推荐
- Wxparse parsing iframe playing video
- Flask develops and implements the like comment module of the online question and answer system
- 49. grouping of acronyms
- NDK learning notes (VIII) thread related
- Get the third-party interface
- YOLOv5的Tricks | 【Trick8】图片采样策略——按数据集各类别权重采样
- 20多种云协作功能,3分钟聊透企业的数据安全经
- Why is the smart door lock so popular? What about the smart door locks of MI family and zhiting?
- Opencv learning path (2-5) -- Deep parsing imwrite function
- 27、移除元素
猜你喜欢

深度学习分布式训练

NDK learning notes (13) create an avi video player using avilib+opengl es 2.0

Multithreading tutorial (XXI) double checked locking problem

Maximum number of points on the line ----- hash table solution

WinForm (I) introduction to WinForm and use of basic controls

Restoration of binary tree -- number restoration

Click the icon is not sensitive how to adjust?

Bert knowledge distillation

Multithreading tutorial (XXVII) CPU cache and pseudo sharing

lower_ Personal understanding of bound function
随机推荐
Convert result set of SQL to set
Redis setup (sentinel mode)
高斯白噪声(white Gaussian noise,WGN)
35. search insertion position
MySQL string to array, merge result set, and convert to array
Use acme SH automatically apply for a free SSL certificate
ImageView supporting single finger sliding and double finger scaling
Flask develops and implements the like comment module of the online question and answer system
Section II: structural composition characteristics of asphalt pavement (1) structural composition
Recherche sur l'optimisation de Spark SQL basée sur CBO pour kangourou Cloud Stack
Preliminary understanding of DFS and BFS
Chapter I: Net architecture (1)
NDK learning notes (14) create an avi video player using avilib+window
Section IV: composition and materials of asphalt mixture (2) -- main materials of asphalt
[go deep into kotlin] - flow advanced
Preliminary understanding of multi task learning
NDK learning notes (II)
Opencv learning path (2-2) -- Deep parsing namedwindow function
NDK learning notes (V)
Multithreading tutorial (XXIII) thread safety without lock