是否有人成功地创建了一个他们愿意共享的card.io包装器,可以在Mono应用程序中使用,或者有人能说明我做错了什么?
所有东西都会编译,我可以访问card.io类:
using IO.Card.Payment;
private void WireupScanCardButton()
{
Log.Debug(this.GetType().Name, "WireupScanCardButton");
this.ScanCardButton.Click += delegate
{
Log.Debug(this.GetType().Name, "ScanCard.Click");
var intent = new Intent(this, typeof(CardIOActivity));
// Required for authentication with card.io
intent.PutExtra(CardIOActivity.ExtraAppToken, "<MY PRIVATE TOKEN HERE>");
// Customize these values to suit your needs.
intent.PutExtra(CardIOActivity.ExtraNoCamera, false);
intent.PutExtra(CardIOActivity.ExtraSuppressManualEntry, true);
intent.PutExtra(CardIOActivity.ExtraRequireExpiry, false);
intent.PutExtra(CardIOActivity.ExtraRequireCvv, false);
intent.PutExtra(CardIOActivity.ExtraRequireZip, false);
// Run the Activity
this.StartActivityForResult(intent, 0);
};
}然而,我总是遇到以下错误:
此设备不能使用照相机读取卡号
备注:
我对Android/Xamarin非常陌生,所以花更多的时间研究而不是编写代码。
.so文件似乎不在.apk文件中。
编辑:
.so文件似乎是由编译器获取的。编译后,如果我检查obj/Release/文件夹,就会有一个子文件夹native_library_imports,它根据支持的Abi类型在适当的子文件夹中包含.so文件。
但是,.so文件仍未出现在最终的.apk文件中。
logcat输出:
04-18 08:12:20.462 D/ActivityAddPaymentSource( 5824): ScanCard.Click
04-18 08:12:20.472 E/ActivityManager( 191): exception bw.write()java.io.IOException: Transport endpoint is not connected
04-18 08:12:20.472 I/ActivityManager( 191): Starting: Intent { cmp=com.onetab.android/io.card.payment.CardIOActivity (has extras) } from pid 5824
04-18 08:12:20.472 D/PowerManagerService( 191): acquireWakeLock flags=0x1 tag=ActivityManager-Launch
04-18 08:12:20.492 D/ActivityAddPaymentSource( 5824): OnPause
04-18 08:12:20.492 E/Sensors ( 191): GsSensor: line +83 ~~~handle===0~~en==1~~!n
04-18 08:12:20.502 E/Sensors ( 191): GsSensor::setDelay: line +113 ~~~handle===0~~ns==1553152~~!n
04-18 08:12:20.502 E/Sensors ( 191): GsSensor::setDelay: line +113 ~~~handle===0~~ns==-2135896001~~!n
04-18 08:12:20.542 W/card.io ( 5824): cardioScanErrorNoDeviceSupport: This device cannot use the camera to read card numbers.
04-18 08:12:20.572 E/ActivityManager( 191): exception bw.write()java.io.IOException: Transport endpoint is not connected
04-18 08:12:20.572 D/PowerManagerService( 191): acquireWakeLock flags=0x1 tag=ActivityManager-Launch
04-18 08:12:20.582 E/Sensors ( 191): GsSensor: line +83 ~~~handle===0~~en==0~~!n
04-18 08:12:20.622 D/ActivityAddPaymentSource( 5824): OnResume谢谢
发布于 2013-04-21 00:12:52
经过一些实验我终于解决了这个问题。
<the sdk files and abi subfolders>** SDK解压缩到库项目的根目录,这样您的文件夹结构为: card.io@tomwhipple谢谢你的贡献。我试图推翻你的回答,但显然我没有足够的声誉。
发布于 2013-04-17 15:22:56
Android logcat应该显示更具体的错误消息,但是这个问题是由于缺少本地库造成的。(对于普通的Android项目,这些项目位于/libs目录中,具有特定于体系结构的子目录。)
这些是您提到的.so文件中缺少的.apk文件。它们包含了所有的图像处理逻辑,因此card.io不能扫描如果它们不在那里。
https://stackoverflow.com/questions/16027260
复制相似问题