Card.io - Android无法找到libcardioDecider.so

时间:2016-01-12 14:00:32

标签: android gradle card.io cardio

我几个月前使用Card.IO开发了一个Android应用程序。它工作正常,但现在Card.IO不工作,我找不到问题所在。

这是我的配置:

build.gradle(来自我的app模块)

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'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 22
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "appID"
        minSdkVersion 14
        targetSdkVersion 22
        versionCode 6
        versionName "1.4.1"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dexOptions {
        javaMaxHeapSize "4g"
    }
}

repositories {
    mavenCentral()
    maven { url 'https://maven.fabric.io/public' }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile(project(':volley')) {
        exclude module: 'support-v4'
    }
    compile files('libs/commons-codec-1.9.jar')
    compile('com.navercorp.volleyextensions:volley-views:2.0.+') {
        exclude module: 'library'
    }
    compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
        transitive = true;
    }
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.android.support:cardview-v7:22.2.1'
    compile 'com.android.support:recyclerview-v7:22.2.1'
    compile 'com.google.code.gson:gson:2.3.1'
    compile 'io.card:android-sdk:5.3.0'
    compile 'com.github.ksoichiro:androidpagecontrol:0.1.1'
    compile 'me.relex:circleindicator:1.1.5@aar'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.daimajia.easing:library:1.0.1@aar'
    compile 'com.daimajia.androidanimations:library:1.1.3@aar'
    compile 'com.facebook.android:facebook-android-sdk:4.5.0'
    compile 'br.com.jansenfelipe:androidmask:1.0.1'
    compile 'com.google.android.gms:play-services-analytics:8.3.0'
    compile 'com.google.android.gms:play-services:8.3.0'
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.android.support:design:22.2.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
}

在我的第一个活动中:

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        MultiDex.install(getBaseContext());
        Fabric.with(this, new Crashlytics());
        FacebookSdk.sdkInitialize(StartActivity.this);
        setContentView(R.layout.start_activity);
        System.out.println("CARDIOVERIFIER:::::" + CardIOActivity.canReadCardWithCamera());

    }

这是logcat的输出:

01-12 11:23:57.385 30672-30672/? I/card.io: Checking hardware support...
01-12 11:23:57.386 30672-30672/? I/card.io: card.io 5.1.1 10/14/2015 15:59:57 -0500
01-12 11:23:57.386 30672-30672/? E/card.io: Failed to load native library: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/app-package-2/base.apk"],nativeLibraryDirectories=[/data/app/app-package-2/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libcardioDecider.so"
01-12 11:23:57.386 30672-30672/? W/card.io: - Processor type is not supported
01-12 11:23:57.386 30672-30672/? I/System.out: CARDIOVERIFIER:::::false

我已经在我的设备上安装了Card.IO SampleApp,它运行良好,因此我的设备支持Card.IO。

我在互联网上搜索了这个,每个人都说我需要把* .so放在我的libs文件夹上,但是当我导出App时,我可以看到Card.IO使用的所有目录(arm64-v8a,armeabi,armeabi) -v7a等)然后在里面有libcardioDecider.so文件。

任何人都可以帮助我吗?

2 个答案:

答案 0 :(得分:3)

确保您的Gradle模块是最新的。

在build.grade(不是app gradle)中,它应该如下所示:

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.5.0'
}
}

答案 1 :(得分:0)

也许您不应该将io.card so文件添加到项目中,如果是这样,请删除libs目录中的文件,只需在io.card:android-sdk:5.3.0中添加编译build.gradle