android-smsmms
android-smsmms copied to clipboard
com.google.android.mms.MmsException: unable to update content://mms/1510284597478/part/0
getting error on Uri messageUri = persister.persist(sendReq, Uri.parse("content://mms/outbox"), true, settings.getGroup(), null); at Transaction.java
android 7.0 on galaxy s6, any ideas, please?
11-10 11:30:11.291 30247-30294/com.klinker.android.send_message.sample E/Transaction: error using system sending method com.google.android.mms.MmsException: unable to update content://mms/1510284597478/part/0 at com.google.android.mms.pdu_alt.PduPersister.persistData(PduPersister.java:838) at com.google.android.mms.pdu_alt.PduPersister.persistPart(PduPersister.java:761) at com.google.android.mms.pdu_alt.PduPersister.persist(PduPersister.java:1438) at com.klinker.android.send_message.Transaction.sendMmsThroughSystem(Transaction.java:619) at com.klinker.android.send_message.Transaction.sendMmsMessage(Transaction.java:469) at com.klinker.android.send_message.Transaction.sendNewMessage(Transaction.java:136) at com.klinker.android.messaging_sample.MainActivity$7.run(MainActivity.java:201) at java.lang.Thread.run(Thread.java:762)
How to reproduce the massage?
just clone or download and open in android studio and run it, which can reproduce this
the error is that you are not set your project as a default SMS app. (How to set default SMS app: https://www.cnet.com/how-to/manage-default-sms-app-on-android-4-4-kitkat/)
and if you don't want to set your project as a default app. download library and edit yourself. find Transaction.java and just delete code where using persist method. it will send message. I tested.
@klinker41 Is there any option in Settings object that we can ignore persist message?
@Jayze24 Could you tell me exactly what you removed from Transaction.java?
@klinker41 Could you tell me how to resolve the following error?
E/Transaction: error using system sending method com.google.android.mms.MmsException: unable to update content://mms/1544434932238/part/0 at com.google.android.mms.pdu_alt.PduPersister.persistData(PduPersister.java:838) at com.google.android.mms.pdu_alt.PduPersister.persistPart(PduPersister.java:761) at com.google.android.mms.pdu_alt.PduPersister.persist(PduPersister.java:1438) at com.klinker.android.send_message.Transaction.sendMmsThroughSystem(Transaction.java:640) at com.klinker.android.send_message.Transaction.sendMmsMessage(Transaction.java:490) at com.klinker.android.send_message.Transaction.sendNewMessage(Transaction.java:142) at com.klinker.android.send_message.Transaction.sendNewMessage(Transaction.java:158) at com.simplemms.simple_mms.MainActivity$7.run(MainActivity.java:184) at java.lang.Thread.run(Thread.java:762)
@myathinzar Did you resolve your issue with MMS sending crash?
@proIT324
android version over M? N? (i forgot the exact version) only a default SMS app can access "content://mms/outbox". but if you follow these steps. you can send mms.
1.open the Transaction.java file (library->src->main->java->com->klinker->android->send_message folder in this library)
-
remove these lines and code associated with these lines at the file
PduPersister persister = PduPersister.getPduPersister(context); Uri messageUri = persister.persist(sendReq, Uri.parse("content://mms/outbox"), true, settings.getGroup(), null); Intent intent; if (explicitSentMmsReceiver == null) { intent = new Intent(MmsSentReceiver.MMS_SENT); BroadcastUtils.addClassName(context, intent, MmsSentReceiver.MMS_SENT); } else { intent = explicitSentMmsReceiver; } intent.putExtra(MmsSentReceiver.EXTRA_CONTENT_URI, messageUri.toString()); intent.putExtra(MmsSentReceiver.EXTRA_FILE_PATH, mSendFile.getPath()); final PendingIntent pendingIntent = PendingIntent.getBroadcast( context, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);
@Jayze24 After removing it, pendingIntent is not resolved. Could you tell me more specifically what to remove?
@proIT324 remove lines associated pendingIntent.
Bundle configOverrides = new Bundle();
configOverrides.putBoolean(SmsManager.MMS_CONFIG_GROUP_MMS_ENABLED, settings.getGroup());
String httpParams = MmsConfig.getHttpParams();
if (!TextUtils.isEmpty(httpParams)) {
configOverrides.putString(SmsManager.MMS_CONFIG_HTTP_PARAMS, httpParams);
}
configOverrides.putInt(SmsManager.MMS_CONFIG_MAX_MESSAGE_SIZE, MmsConfig.getMaxMessageSize());
...
SmsManagerFactory.createSmsManager(settings).sendMultimediaMessage(context,
contentUri, null, configOverrides, pendingIntent);
...
try {
pendingIntent.send(SmsManager.MMS_ERROR_IO_ERROR);
} catch (PendingIntent.CanceledException ex) {
Log.e(TAG, "Mms pending intent cancelled?", ex);
}
Hi @proIT324, have you been able to move forward...? ;-)
Hi @Jayze24 code does nothing after removing those lines
Hi @mihirmodiofficial any help if your code worked, I'm facing the same issue