A/libc: Fatal signal 11 (SIGSEGV), code 2, fault addr in tid (FinalizerDaemon) - android-studio

getting this error on switching between two activities containing images and api calls to server and have used glide to load the images. Can any one give suggestions to solve the issue. Has anybody faced such issues ?
Thanks in advance.
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
signingConfigs {
config {
keyAlias 'example'
keyPassword 'android'
storeFile file('/home/key/android.jks')
storePassword 'android'
}
}
compileSdkVersion 24
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.example.android"
minSdkVersion 15
targetSdkVersion 24
versionCode 26
versionName "2.16"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
shrinkResources false
debuggable false
buildConfigField "boolean", "USE_CRASHLYTICS", "true"
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
buildConfigField "boolean", "USE_CRASHLYTICS", "true"
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
staging {
minifyEnabled false
buildConfigField "boolean", "USE_CRASHLYTICS", "true"
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven {
url 'https://maven.google.com'
}
maven { url 'https://maven.fabric.io/public' }
mavenCentral()
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':library')
// rest api
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.3.1'
compile 'io.reactivex:rxandroid:1.2.1'
compile 'io.reactivex:rxjava:1.1.6'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.google.android.gms:play-services-maps:10.0.1'
testCompile 'junit:junit:4.12'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.google.android.gms:play-services-location:10.0.1'
compile 'pub.devrel:easypermissions:0.2.1'
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile('com.crashlytics.sdk.android:crashlytics:2.6.5#aar') {
transitive = true;
}
compile 'com.j256.ormlite:ormlite-android:4.48'
compile 'com.j256.ormlite:ormlite-core:4.48'
compile 'com.google.android.gms:play-services-places:10.0.1'
compile 'com.stripe:stripe-android:2.0.0'
compile 'com.google.android.gms:play-services-gcm:10.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support.constraint:constraint-layout-solver:1.0.2'
}
apply plugin: 'com.google.gms.google-services'

Related

How to solve undefined refrence error on android libtorch?

i got some issue on android libtorch
when i build my project, it always says to "C/C++: C:/Users/Administrator/AndroidStudioProjects/CardFinder/app/src/main/cpp/native-lib.cpp:26: error: undefined reference to 'torch::cuda::is_available()'"
i've never seen that before on visual studio
here's my android studio setting
'Cmake'
cmake_minimum_required(VERSION 3.18)
project(cardfinder)
set(CMAKE_CXX_STANDARD 14)
set(pathInclude ${CMAKE_SOURCE_DIR}/include)
add_library(native-lib SHARED ${CMAKE_SOURCE_DIR}/native-lib.cpp)
file(GLOB OPENCV_INCLUDE_DIRS "${pathInclude}/opencv")
file(GLOB PYTORCH_INCLUDE_DIRS "${pathInclude}/libtorch")
file(GLOB PYTORCH_API_DIRS "${pathInclude}/libtorch/torch/csrc/api/include")
file(GLOB SOURCE_INCLUDE_DIRS "${pathInclude}/source")
file(GLOB LINK_DIRS "${CMAKE_SOURCE_DIR}/../jniLibs/${ANDROID_ABI}")
include_directories(
${OPENCV_INCLUDE_DIRS}
${PYTORCH_INCLUDE_DIRS}
${PYTORCH_API_DIRS}
${SOURCE_INCLUDE_DIRS})
find_library(
OPENCV_LIBRARY opencv_java4
PATHS ${LINK_DIRS}
NO_CMAKE_FIND_ROOT_PATH)
find_library(
PYTORCH_LIBRARY pytorch_jni
PATHS ${LINK_DIRS}
NO_CMAKE_FIND_ROOT_PATH)
find_library(
FBJNI_LIBRARY fbjni
PATHS ${LINK_DIRS}
NO_CMAKE_FIND_ROOT_PATH)
find_library(log-lib log)
target_link_libraries(
native-lib
${OPENCV_LIBRARY}
${FBJNI_LIBRARY}
${PYTORCH_LIBRARY}
${log-lib}
)
'build.gradle'
plugins {
id 'com.android.application'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.main.cardfinder"
minSdk 21
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags '-std=c++14'
}
}
ndkVersion "21.1.6352462"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
externalNativeBuild {
cmake {
path file('src/main/cpp/CMakeLists.txt')
version '3.18.1'
}
}
buildFeatures {
viewBinding true
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
def cameraxVersion = "1.1.0-alpha05"
implementation "androidx.camera:camera-core:${cameraxVersion}"
implementation "androidx.camera:camera-camera2:${cameraxVersion}"
implementation "androidx.camera:camera-lifecycle:${cameraxVersion}"
// CameraX View class
implementation 'androidx.camera:camera-view:1.0.0-alpha25'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
'my current project'

Cannot resolve R in Android Studio

I tried to clean,rebuild,sync gradle files...
This is my gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.user.myapplication"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
} }
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:26.0.0-alpha1' }
This also gives error
add above your dependencies
configurations.all {
resolutionStrategy.force 'com.android.support:support-annotations:23.1.0'
}
and also you need to add these dependencies.
androidTestCompile 'com.android.support:support-annotations:23.1.0'
androidTestCompile 'com.android.support.test:runner:0.4.1'
androidTestCompile 'com.android.support.test:rules:0.4.1'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2.1'
androidTestCompile 'com.android.support.test.espresso:espresso-web:2.2.1'
and you are done.

Android studio not publishing artifact to Artifactory

I'm facing an odd problem with Android Studio and Artifactory. I want to publish a module from Android Studio. The problem being, the build info is published just fine but the artifacts are not published.
build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.5.4"
}
}
allprojects {
apply plugin: "com.jfrog.artifactory"
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
artifactory {
contextUrl = "${artifactory_contextUrl}"
publish {
repository {
repoKey = 'libs-release-local'
username = "${artifactory_user}"
password = "${artifactory_password}"
maven = true
}
}
resolve {
repository {
repoKey = 'libs-release'
username = "${artifactory_user}"
password = "${artifactory_password}"
maven = true
}
}
}
module/build.gradle
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
def packageName = 'x.x'
def libraryVersion = 'v1.0.0'
android {
compileSdkVersion 26
defaultConfig {
minSdkVersion 21
targetSdkVersion 26
versionCode 10000
versionName libraryVersion
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
publishing {
publications {
aar(MavenPublication) {
groupId packageName
version = libraryVersion
artifactId "y"
artifact("$buildDir/outputs/aar/$archivesBaseName-release.aar")
}
}
}
artifactory {
publish {
defaults {
publications('aar')
publishArtifacts = true
publishBuildInfo = false
publishPom = true
publishIvy = false
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.squareup.okhttp3:okhttp:3.8.1'
implementation 'com.squareup.okhttp3:logging-interceptor:3.8.1'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.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 run ./gradlew assembleRelease artifactoryPublish from the terminal, I always get the following output:
> Task :minecommon:artifactoryPublish
Deploying build descriptor to: https://artifactory-domain/artifactory/api/build
Build successfully deployed. Browse it in Artifactory under https://artifactory-domain/artifactory/webapp/builds/project-name/1509633107114
BUILD SUCCESSFUL in 2s
26 actionable tasks: 1 executed, 25 up-to-date
I can find the build in the "Build Browser" of my Artifactory.
Is there something wrong with my configuration? How can I make gradle publish my artifacts?
I've tries every article I could find on this issue to no resolve.

Error:Cannot read packageName from E:\Lins\ZXing_luolu\ZxingScan-master\zxing-zxing-3.3.0\src\main\AndroidManifest.xml

.png is my code short cut
I'm failed to Import third-party source libraries
//following are my build.gradle file
//app module
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.example.meng.zxingscan"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile project(':zxing-zxing-3.3.0')
// compile files('libs/core-3.3.0.jar')
}
//zxing module
apply plugin: 'com.android.library'
android {
compileSdkVersion 24
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.example.meng.zxingscan"
minSdkVersion 15
targetSdkVersion 23
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.android.support:support-v7:18.+'
}

Tensorflow in Android, gradle issues

I am trying to get tensorflow in working android, kinda out of default project folder. I modified my build.gradle, but obviously I miss something, as my app crashes on runtime complying about unavailabiltity of native libraries. I have spent good few hours tring to solve this, but to no avail. Could someone help, please?
Basically, i compared .so file in APK produced by working tf demo and my .so, and they are different. So I suppose must me somewhere in my script...
def bazel_location = '/usr/local/bin/bazel'
def tf_location = '/home/poborak/SW/tensorflow-master'
def cpuType = 'armeabi-v7a'
def nativeDir = 'src/main/jniLibs/' + cpuType
project.buildDir = 'gradleBuild'
getProject().setBuildDir('gradleBuild')
buildscript {
System.properties['com.android.build.gradle.overrideVersionCheck'] = 'true'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "bazinac.aplikacenahouby"
minSdkVersion 21
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['src/main/java', tf_location+'/tensorflow/contrib/android/java']
resources.srcDirs = ['src/main/java']
aidl.srcDirs = ['src/main/java']
renderscript.srcDirs = ['src/main/java']
res.srcDirs = ['src/main/res']
assets.srcDirs = ['src/main/assets']
jniLibs.srcDirs = ['src/main/jniLibs']
jni.srcDirs = []
}
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
}
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:23.4.0'
compile 'com.android.support:design:23.4.0'
testCompile 'junit:junit:4.12'
compile 'org.apache.commons:commons-io:1.3.2'
}
task buildNative(type:Exec) {
workingDir tf_location
commandLine bazel_location, 'build', '-c', 'opt', \
'tensorflow/examples/android:tensorflow_native_libs', \
'--crosstool_top=//external:android/crosstool', \
'--cpu=' + cpuType, \
'--host_crosstool_top=#bazel_tools//tools/cpp:toolchain'
}
task copyNativeLibs(type: Copy) {
from(tf_location+'bazel-bin/tensorflow/examples/android') { include '**/*.so' }
into nativeDir
duplicatesStrategy = 'include'
}
copyNativeLibs.dependsOn buildNative
assemble.dependsOn copyNativeLibs
Finally I have found workaround. It is to downgrade Gradle to 2.14.xx and Android Plugin Version 2.1.3. Then I have appended assembleDebug.dependsOn copyNativeLibs and it works now. Still I would be interested in better solution of course. (AssembleDebug property is not recognized in newer APV.

Resources