我正面临java.lang.NoSuchMethodError: android.nfc.NdefRecord.createUri
这段代码的异常:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
mNfcAdapter = NfcAdapter.getDefaultAdapter(this.getApplicationContext());
try {
if (mNfcAdapter == null) {
} else {
NdefRecord uriRecord = NdefRecord.createUri(someUri);
NdefMessage msg = new NdefMessage(new NdefRecord[] {uriRecord});
mNfcAdapter.setNdefPushMessage(msg, this);
}
} catch (Exception e) {
Log.e(getClass().getSimpleName(), "initNfcNdefMessage()", e);
}
}
但是,initNfcNdefMessage
不会打印在堆栈跟踪中。这怎么可能?