Android NDK system mismatch - Android and Windows - android

I get this error in the CMakeOutput.log:
The target system is: Android - 1 - armv7-a
The host system is: Windows - 10.0.17134 - AMD64
when I try to build my project with NDK.
this is the build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "org.my.tester"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags "-frtti -fexceptions -std=c++14"
arguments "-DANDROID_TOOLCHAIN=clang", "-DANDROID_STL=c++_shared"
}
ndk {
abiFilters 'armeabi-v7a'
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
sourceSets {
main {
jniLibs.srcDirs 'MySDK'
}
}
}
dependencies {
implementation fileTree(dir: 'MySDK', include: ['*.aar'])
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

Related

android.support:appcompat-v7 and android.support:design is not working for api 30

hello i am making a app that requires api 29+ but
'com.android.support:appcompat-v7:28.0.0'
'com.android.support:design:28.0.0'
this two library is not supported api 29 or 30 how can i fix my issue?
heres my build.gradle (:app)
......................................................................................................................................................................................
android {
compileSdkVersion 30
defaultConfig {
applicationId "uk.lgl.modmenu"
minSdkVersion 17
//noinspection ExpiredTargetSdkVersion
targetSdkVersion 30
versionCode 1
versionName "1.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86'
}
signingConfig signingConfigs.debug
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
ndkBuild {
path file('src/main/jni/Android.mk')
}
}
ndkVersion = '23.1.7779620'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
}
}
You should switch to using the AndroidX versions of those libraries. Such as:
androidx.appcompat:appcompat:1.4.1

unable to import paart-parslemouth in android

i am trying to install paart-parselmouth in android but unable to install I am getting the following error
How can I install it or how can I install its tar file?
Failed to install praat-parselmouth from https://files.pythonhosted.org/packages/a0/80/533a7330d7ed612628656f9aaee115076c578330039bc179c09fb8423251/praat-parselmouth-0.4.0.tar.gz.
here is my gradle
apply plugin: 'com.android.application'
apply plugin: 'com.chaquo.python'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.example.live_audio"
minSdkVersion 25
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
sourceSets {
main {
python {
srcDirs = ["src/main/python"]
}
}
}
python {
// buildPython "/usr/local/bin/python3"
// buildPython "python3"
pip {
install "praat-parselmouth"
install "numpy"
install "six"
}
}
ndk {
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}

It says "Trying to load lib" and then application quit without any information

I have download an android program which used tensorflow to realized the emotion recognition. I have finished the work of configuration of environment. And I find that when I use the recognition the application the log says that "Trying to load lib /data/app-lib/com.example.alex.opencvdemo-1/libtensorflow_inference.so 0xa4f77c88" and then application will quit. I don't know how to solve this problem
Here is my code for loadLibrary
static {
//load libtensorflow_inference.so
//System.load("/app/com.example.alex.opencvdemo/libs/libtensorflow_interface.so");
System.loadLibrary("tensorflow_inference");
Log.e("tensorflow","libtensorflow_inference.so is successfully load");
}
And following is my build.gradle of app:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.alex.opencvdemo"
minSdkVersion 18
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags ""
}
}
multiDexEnabled true
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
buildTypes {
debug {
ndk { abiFilters "armeabi-v7a","x86"}
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets{
main {
jni.srcDirs = []
//jni库的调用会到资源文件夹下libs里面找so文件
jniLibs.srcDirs = ['libs']
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(dir: "$buildDir/native-libs", include: 'native-libs.jar')
implementation 'com.android.support:appcompat-v7:28.0.0-beta01'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
compile project(':openCVLibrary342')
implementation files('libs/libandroid_tensorflow_inference_java.jar')
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
task nativeLibsToJar(type: Jar, description: 'create a jar archive of the native libs') {
destinationDir file("$buildDir/native-libs")
baseName 'native-libs'
from fileTree(dir: 'libs', include: '**/*.so')
into 'lib/'
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn(nativeLibsToJar)
}
Possible causes as i faced this in earlier
Better check that your native library matches with
"tensorflow_inference".
Because in your build.gradle it showsing native_lib something like that.
verify tensorflow_inference is added in Cmakelists.txt.
if your using openCV make sure you're imported native libraries fine

gradle dsl method not found: ' armv7a'

my build.grandle code is this one:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.example.assus.appweather"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
ndk {
moduleName = "odroid_weather"
abiFilter "x86"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
jni.srcDirs = []
jniLibs.srcDirs 'main/src/libs'
}
}
productFlavors{
x86 {
ndk {
abiFilter "x86"
}
armv7a{
ndk {
abiFilter "armeabi-v7a"
}
}
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
}
and when I build my project, always this error is shown :
gradle dsl method not found: ' armv7a'
Gradle sync failed: Gradle DSL method not found: 'armv7a()'
Consult IDE log for more details (Help | Show Log)
some one can help me please !
Perhaps you meant to have a productFlavors that looks like this instead (it looks like you missing a closing brace):
productFlavors{
x86 {
ndk {
abiFilter "x86"
}
}
armv7a {
ndk {
abiFilter "armeabi-v7a"
}
}
}

Gradle DSL method not found: 'applicationId()'

I am getting this error on building the application in Android Studio.
Gradle DSL method not found: 'applicationId()'
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
applicationId "com.ms.knowursensor.android"
minSdkVersion 13
defaultConfig {
targetSdkVersion 23
versionCode 1
versionName "1.0"
ndk {
moduleName "sensorgraph"
stl "c++_static"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
ndk {
debuggable = true
}
}
debug {
debuggable true
jniDebuggable true
}
}
sourceSets {
main {
jniLibs.srcDir 'src/main/jniLibs'
// use the jni .so compiled from the manual ndk-build command
jni.srcDirs = [] //disable automatic ndk-build
}
}
}
repositories {
jcenter()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
}
This issue came when i recently update the SDK. How to resolve this issue?
Move applicationId and minSdkVersion into your defaultConfig closure.

Categories

Resources