PoseEstimationForMobile icon indicating copy to clipboard operation
PoseEstimationForMobile copied to clipboard

"SIMPLE: Error configuring" Android Studio build issue

Open mgarbade opened this issue 6 years ago • 3 comments

I cannot run the code for the "android_demo/demo_tflite", as it fails during building with the above mentioned error message (marked as "External Native Build Issues"). My hunch is that it comes from the openCVLibrary341, but I wouldn't know how to find out where exactly it's coming from.

Screenshot from 2019-07-16 14-26-10_BuidError_Android

Note: I previously had changed

    ext.buildConfig = [
    'compileSdk': 26,
    'buildTools': '26.0.1',
    'minSdk': 23,
    'targetSdk': 26,
]

to

    ext.buildConfig = [
    'compileSdk': 27,
    'buildTools': '27.0.3',
    'minSdk': 23,
    'targetSdk': 26,
]

to get rid of some warnings:

    WARNING: The specified Android SDK Build Tools version (26.0.1) is ignored, as it is below 
    the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.2.
    Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
Remove Build Tools version and sync project
Affected Modules: app, openCVLibrary341

the build issue continued...

mgarbade avatar Jul 16 '19 12:07 mgarbade

Do you have ninja installed ?

rohanbhatia56 avatar Aug 01 '19 12:08 rohanbhatia56

I'm using Android Studio version 3.4.2 ... But I assume you don't mean the ninja IDE but rather some library?

mgarbade avatar Aug 01 '19 13:08 mgarbade

So the trick was to use a different NDK version than the one provided along Android Studio 3.4.2
I downloaded NDK r17c and configured it by clicking File -> Project Structure -> SDK Location -> Choose the custom NDK location.

However the app is still not building. The next error is

Gradle sync failed: Already disposed: Module: 'android_demo-demo_tflite' (2 s 378 ms)

and also

WARNING: The specified Android SDK Build Tools version (26.0.1) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.2.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
Remove Build Tools version and sync project
Affected Modules: app, openCVLibrary341

mgarbade avatar Aug 01 '19 18:08 mgarbade