Android Studio debugger doesn't work when using C++ support - android

I can't debug my Java classes or Kotlin files, all breakpoints has "x" signature , but it works for cpp class files
I'm using
Android Studio version 2.2.2
OS version macOS siera 10.12
Gradle version 2.2.2
this is my Module Build.gradle file
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "awesomethings.ge.takeapic"
minSdkVersion 18
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags "-std=c++11 -fexceptions"
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.1'
testCompile 'junit:junit:4.12'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile 'com.github.bumptech.glide:glide:3.7.0'
}
repositories {
mavenCentral()
}

Related

Build Command Failed for CMake

I updated android studio and now I am getting the following error while trying to run the app.
Build command failed.
Error while executing process
C:\Users\bhaskar\AppData\Local\Android\sdk\cmake\3.10.2.4988404\bin\cmake.exe with arguments {--build C:\Users\bhaskar\Desktop\New Projects\otv
2\app\.externalNativeBuild\cmake\debug\armeabi-v7a --target baseUrl}
Unknown argument Projects\otv
Unknown argument 2\app\.externalNativeBuild\cmake\debug\armeabi-v7a
Usage: cmake --build <dir> [options] [-- [native-options]]
I have tried the link but didn't work for me.
Android Studio CMake Error: Build Command failed
My build.gradle file is:
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'realm-android'
repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://maven.google.com' }
}
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.osolutions.otv"
minSdkVersion 16
targetSdkVersion 28
versionCode 9
versionName "1.1.1"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
ndk {
abiFilters "armeabi-v7a", "x86"
}
externalNativeBuild {
cmake {
version "3.10.2"
}
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation files('libs/YouTubeAndroidPlayerApi.jar')
// retrofit, gson
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:2.0.0-beta1'
}
I have tried clean and rebuild the project, Invalidate cache and restart, tried steps in the link that I have shared none of it seems to be working for me. Any help would be appreciated.
I solved it by using older version of cmake. I had two versions folder inside path
C:\Users\bhaskar\AppData\Local\Android\sdk\cmake
3.6.41111459 and 3.10.2.4988404. I deleted the 3.10.... folder and run the project and it worked fine.

Error:Failed to resolve: Crosswalk

I'm trying to make a SDK using Crosswalk. So first I started to make a sample app using
compile 'org.xwalk:xwalk_core_library:23.53.589.4'. And it works. Then I tried to make a SDK using this. But it didn't work as I expected.
gradle file
apply plugin: 'com.android.library'
repositories {
maven {
url 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2'
}
}
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
minSdkVersion 16
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 {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'org.xwalk:xwalk_core_library:23.53.589.4'
testCompile 'junit:junit:4.12'
}
Here is the screenshot of error message

Using of prebuilt .so file without other files

Actually i have a pre-built .so file. but i have no header files and and c files. can i use it in android studio for execution and what will be the changes have to be made in the build gradle of app? please help me..
my build gradle is as follows:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.acsiatech.microfuzzy.samplejniinterface"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags ""
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}

Android Gradle error occurs

Error:(1, 0) Plugin is too old, please update to a more recent version,
or set ANDROID_DAILY_OVERRIDE environment variable to
"f4a0bcdad02706f1af97b485d6a6a0c5e7d9a560". Fix plugin version and sync project
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.app.xxxxxx"
minSdkVersion 15
targetSdkVersion 21
versionCode 2
versionName "2.0"
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
signingConfig signingConfigs.config
debuggable true
jniDebuggable false
minifyEnabled false
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.android.support:recyclerview-v7:21.0.+'
}
Update your Gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.app.xxxxxx"
minSdkVersion 15
targetSdkVersion 23
versionCode 2
versionName "2.0"
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
signingConfig signingConfigs.config
debuggable true
jniDebuggable false
minifyEnabled false
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
}
Also Your Gradle version
//You Used Above Version Also
classpath 'com.android.tools.build:gradle:2.1.0'
its because your gradle plugin is too old, you need to update it to latest version.
Download the latest Gradle from here
You will need run sdk manager and check for updated revisions.
In Project level build.gradle:
Replace:
classpath 'com.android.tools.build:gradle:1.1.0'
with:
classpath 'com.android.tools.build:gradle:2.1.2'
and in the app level build.gradle which you have posted above:
Replace:
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.android.support:recyclerview-v7:21.0.+'
With:
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'

After import to android studio, gradle task “app:dexDebug” fails

I have the following gradle file in my android app:
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.test.forum"
minSdkVersion 16
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
//configurations {
// all*.exclude group: 'com.android.support', module: 'support-v4'
//}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19+'
compile 'org.java-websocket:Java-WebSocket:1.3.0'
}
and the bug output is Error code: 2; Output: UNEXPECTED TOP-LEVEL EXCEPTION.
When I uncomment the configurations part of the file I get Can't find package v4 (support) although I have it installed from the sdk. Any ideas on how I can solve this?

Categories

Resources