Reply To: Mifare SDK Android studio 3.1

Forum MIFARE SDK Mifare SDK Android studio 3.1 Reply To: Mifare SDK Android studio 3.1

Re: Mifare SDK Android studio 3.1

28. March 2018 at 21:52
Hello,

do you have update your gradle to 4.4 ?
this is my gradle file


repositories {
flatDir {
dirs 'libs'
}
/** Following lines are for accessing the TapLinx jars from Repo directly */
maven {
credentials {
username "sdkuser"
password "taplinx"
}
url "http://maven.taplinx.nxp.com/nexus/content/repositories/taplinx/"
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'taplinx-android:nxpnfcandroidlib:1.4'
implementation 'com.android.support:support-v4:27.1.0'
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:recyclerview-v7:27.1.0'
implementation 'com.android.support:cardview-v7:27.1.0'
implementation 'com.android.support:design:27.1.0'
implementation 'android.arch.lifecycle:extensions:1.1.1'
implementation 'android.arch.lifecycle:runtime:1.1.1'
implementation 'android.arch.persistence.room:runtime:1.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.airbnb.android:lottie:2.5.0'
implementation 'com.github.douglasjunior.AndroidBluetoothLibrary:BluetoothClassicLibrary:0.3.5'
implementation 'com.github.bumptech.glide:glide:4.6.1'
implementation 'com.android.support:multidex:1.0.3'
annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
annotationProcessor "android.arch.persistence.room:compiler:1.0.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'
}


with


compileSdkVersion 27
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}





private void initLibrary() {
instance = NxpNfcLib.getInstance();
instance.registerActivity(this, BuildConfig.TAPLINX_KEY);
}

private void cardLogic(Intent intent) {
try {
CardType card = instance.getCardType(intent); // CRASH HERE
Log.d(TAG, "cardLogic: "+card.getTagName());
if (card.equals(CardType.DESFireEV1)) {
ev1 = DESFireFactory.getInstance().getDESFire(instance.getCustomModules());
ev1.getReader().connect();
ev1.getReader().setTimeout(TIMEOUT);
desfireEV1CardLogic();
}
} catch (Throwable t) {
Log.e(TAG, "cardLogic: ", t);
showError(NfcApplicationIDHelper.getError(this, t.getMessage()));
}
}



there is the stack


java.lang.VerifyError: com/nxp/nfclib/desfire/ˊ
at com.nxp.nfclib.desfire.DESFireFactory.getDESFire(:86)
at com.nxp.nfclib.ˎ.ॱ(:32)
at com.nxp.nfclib.ˊ.ॱ(:63)
at com.nxp.nfclib.NxpNfcLib.getCardType(:352)
at com.nxp.nfclib.NxpNfcLib.getCardType(:290)
at com.ecash.nfc.activities.LoginActivity.cardLogic(LoginActivity.java:149)
at com.ecash.nfc.activities.LoginActivity.onNewIntent(LoginActivity.java:144)
at android.app.Instrumentation.callActivityOnNewIntent(Instrumentation.java:1163)
at android.app.ActivityThread.deliverNewIntents(ActivityThread.java:2498)
at android.app.ActivityThread.performNewIntents(ActivityThread.java:2511)
at android.app.ActivityThread.handleNewIntent(ActivityThread.java:2520)
at android.app.ActivityThread.access$1600(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1413)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5333)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
at dalvik.system.NativeStart.main(Native Method)


and this happened when i updated my AS to Android Studio 3.1 (March 26, 2018) build with
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip



+ 0  |  - 0