android CMake can not determine linker language for target - android

I have created a very simple project about android and c++ in android studio.
the struct of project(module) is like:
enter image description here
And build.gradle is:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.shuyi.study.myapplication"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"a
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
cmake {
path 'CMakeLists.txt'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
when I start Gradle sync, it logged the informations:
enter image description here
I can not find the reason of this error.
Pleas give me some ides.Thanks!!!

Related

What's the right material design library to use in my gradle, i've tried different solutions, it's not building successfully

I'm trying to test the FAB concept in my app but it's not working following the guidelines i got maybe because i didn't understand it well, see my gradle file below:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "study.timmy.micah.materialdesignpractices"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:design:28.0.0-alpha1'
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'
}

Updating to couchbase lite 2.0.0 causing cannot resolve symbol errors

I am trying to update from couchbase.lite 1.4.0 to 2.0.0, but when I update and sync my build.gradle file I seem keep getting 'cannot resolve symbol' errors for my imports (AndroidContext, Document, and Database). After looking at the dcoumentation, it appears that all I have change change is:
implementation 'com.couchbase.lite:couchbase-lite-android:1.4.0'
to
implementation 'com.couchbase.lite:couchbase-lite-android:2.0.0'
unless I missed something else...
Here is my complete build.grade file.
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.my.app"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.couchbase.lite:couchbase-lite-android:2.0.0'
implementation 'com.couchbase.lite:couchbase-lite-android-forestdb:1.4.1'
}

Error=> Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'

I have a problem when I execute my android app in Android Studio it shows error as mention below. How can I fix this problem?
Error:Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. Could not create service of type AnnotationProcessorDetector using JavaGradleScopeServices.createAnnotationProcessorDetector().
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.toshiba.bluetooth_deneme"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'com.android.support:support-annotations:27.0.2'
}
I was running into a similar issue and it just turned out my project needed to be re-synced. Clicking the button below fixed it for me. (I can't say why that happens though.)

Building gradle with cmake

I'm getting the error "Unable to get the CMake version located at C:\Users\Mujtaba Faizi\Downloads\cmake-3.10.1\bin" but I gave the version 3.10.1 in build.gradle and the path in local.properties. I've been at it for so long. Thanks in advance.
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.mujtaba.basicai"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main { jni.srcDirs = ['src/main/jni', 'src/main/jniLibs/', 'src/main/jniLibs/armeabi-v7a'] }
}
externalNativeBuild {
cmake {
version "3.10.1"
path 'CMakeLists.txt'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile files('libs/libandroid_tensorflow_inference_java.jar')
compile 'com.flurgle:camerakit:0.9.13' //for camera access purposes
}
local.properties:
cmake.dir=C\:\\Users\\Mujtaba Faizi\\Downloads\\cmake-3.10.1
ndk.dir=C\:\\Users\\Mujtaba Faizi\\AppData\\Local\\Android\\Sdk\\ndk-bundle
sdk.dir=C\:\\Users\\Mujtaba Faizi\\AppData\\Local\\Android\\Sdk
This thread is kind of old. But in my case I did not added cmake version to gradle file instead I just had to add path to local.properties
cmake.dir=/home/rafal/Pobrane/cmake-3.11.0

Failed to resolve: redstone.xmlrpc:xnlrpc:1.1.1

I am attempting to build an android app that uses the wordpress-java Lib to obtain the data from my site.
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.techedelicminds.techedelicminds"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'net.bican:jwordpress:0.7.0'
}
As you can see I have the correct compile code in my build.gradle yet the Error "Failed to resolve: redstone.xmlrpc:xmlrpc:1.1.1" continues to show up, and despite my best efforts I can not find anyone else on the internet that has run into this issue, any help would be appreciated.

Categories

Resources