Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When i try to build apk(s) on android studio 3 it gives me error

I'm trying to make LPR app on android studio. I'm using OpenCV 3.1.0 and Tesseract for recognition and when i try to build apk it gives me this

Error: Flag android.useDeprecatedNdk is no longer supported and will be removed in the next version of Android Studio. Please switch to a supported build system. Consider using CMake or ndk-build integration. For more information, go to: https://d.android.com/r/studio-ui/add-native-code.html#ndkCompile To get started, you can use the sample ndk-build script the Android plugin generated for you at: C:\Users\m\Desktop\TestTmp\LPR\app\build\intermediates\ndk\debug\Android.mk Alternatively, you can use the experimental plugin: https://developer.android.com/r/tools/experimental-plugin.html To continue using the deprecated NDK compile for another 60 days, set android.deprecatedNdkCompileLease=1510879276001 in gradle.properties

Does anyone know how to fix this error?

like image 267
Skeet.Fly Avatar asked Nov 17 '17 01:11

Skeet.Fly


2 Answers

If you still want to use deprecated NDK version add following into your gradle.properties

android.useDeprecatedNdk=true

you will be able to build the project and APK file.

like image 80
Muhammad Hannan Avatar answered Sep 22 '22 15:09

Muhammad Hannan


AndroidStudio 3.0

// Remove this line android.useDeprecatedNdk = true

you can get more detail by:
https://developer.android.com/studio/projects/add-native-code?utm_source=android-studio#ndkCompile

like image 35
KentJimmy Avatar answered Sep 22 '22 15:09

KentJimmy