card-io / card.io-Android-SDK

card.io provides fast, easy credit card scanning in mobile apps
Other
1.99k stars 533 forks source link

couldn't find libcardioDecider.so #108

Closed elvisjhonataoliveira closed 8 years ago

elvisjhonataoliveira commented 8 years ago

I've developed an Android app a couple of months ago using Card.IO. It was working normally but now Card.IO don't work and I can't find where's the problem.

Here's my configuration:

build.gradle (from my app module)

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'
}

In my first Activity:

    @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());

    }

And here is the output of 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

I have installed the Card.IO SampleApp on my device and it worked perfectly, so my device has support for Card.IO.

I searched the internet about this and everyone said that I need to put *.so on my libs folder, but when I export the App I can see all the directories that Card.IO use (arm64-v8a, armeabi, armeabi-v7a, etc.) and inside of then have libcardioDecider.so file.

Can anyone help me?

braebot commented 8 years ago

I see you have multidex enabled. Are you looking at the right apk?

elvisjhonataoliveira commented 8 years ago

I'm have unzip de .zip file and inside of then has the lib folder with all the files of Card.IO

There's another way to check that?

elvisjhonataoliveira commented 8 years ago

I have found the source of the problem: gradle version. I was using 1.2.3. When I updated to 1.5.0 everythings work fine! I just discovered that posting the same question on stackoverflow.. link: http://stackoverflow.com/questions/34745715/card-io-android-couldnt-find-libcardiodecider-so/34782711#34782711

braebot commented 8 years ago

Wow, good to hear! I wonder what changed between versions.