I have added flutter vlc player to my app. when i go back from vlc player page, the app suddenly crashes.
i have tried direct example from pub.dev to try it out, but it also results into same.
This is my Error
D/apitrace(22547): apitrace: warning: caught signal 6
D/apitrace(22547): call flush from exceptionCallback
F/libc (22547): Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 23200
(AWindowHandler), pid 22547 (.webyte.vidflix)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'OPPO/CPH2015/OP4C7D:9/PPR1.180610.011/1640680627:user/release-keys'
Revision: '0'
ABI: 'arm64'
pid: 22547, tid: 23200, name: AWindowHandler >>> com.webyte.vidflix <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: 'java_vm_ext.cc:542] JNI DETECTED ERROR IN APPLICATION: JNI GetJavaVM called with pending exception java.lang.RuntimeException: Error during detachFromGLContext (see logcat for details)'
here ismy code
#override
void initState() {
super.initState();
_videoPlayerController = VlcPlayerController.network(
'https://media.w3.org/2010/05/sintel/trailer.mp4',
hwAcc: HwAcc.full,
autoPlay: true,
options: VlcPlayerOptions(),
)..initialize();
}
#override
void dispose() async {
super.dispose();
await _videoPlayerController!.stopRendererScanning();
await _videoPlayerController!.dispose();
}
Related
**I use Flutter Downloader Package After complete download some file , my app closes automatically and disconnecte to the android studio. Any one help me to find soltutions.
final status = await Permission.storage.request();
if (status.isGranted) {
await downloadPDF();
}
downloadPDF() async {
final externalDir = await getExternalStorageDirectory();
taskId = await FlutterDownloader.enqueue(
url: pdfURL,
savedDir: externalDir.path,
fileName: "Flamingo Order Details",
showNotification: true,
openFileFromNotification: true,
);
}
Here is my console error:
I/flutter (15913): Fatal: could not find callback
F/libc (15913): Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 15956 (1.raster), pid 15913 (le.order_system)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'motorola/chef/chef_sprout:10/QPTS30.61-18-16-8/03acd:user/release-keys'
Revision: 'pvt'
ABI: 'arm64'
Timestamp: 2021-04-23 16:39:38+0530
pid: 15913, tid: 15956, name: 1.raster >>> com.example.order_system <<<
uid: 10870
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
Cause: null pointer dereference
x0 000000741e5a6478 x1 00000074841cfa00 x2 0000000000000001 x3 0000000000000000
x4 0000000000000000 x5 00000000ffffffff x6 00000000ffffffff x7 0000000b96c6a75c
x8 0000000080000081 x9 658adf78f7e836ee x10 0000000000000000 x11 0000000000000000
x12 0000000000000001 x13 000000747b19fe80 x14 0000007489a0a280 x15 0000000000000000
x16 000000747b19b050 x17 0000007515c9787c x18 000000741d05e000 x19 000000741e5a6478
x20 00000074841cfa00 x21 0000000000000001 x22 0000000000000000 x23 00000074843db380
x24 000000741e5a7020 x25 000000741e5a7020 x26 0000000000000000 x27 0000000000000001
x28 0000000000000043 x29 000000741e5a6450
sp 000000741e5a6420 lr 000000747b013f84 pc 000000747b01c378
backtrace:
#00 pc 00000000001d8378 /vendor/lib64/egl/libGLESv2_adreno.so (BuildId: 22cc95e0051ae85072c405eeeeeb312d)
#01 pc 00000000001cff80 /vendor/lib64/egl/libGLESv2_adreno.so (BuildId: 22cc95e0051ae85072c405eeeeeb312d)
#02 pc 00000000000207b0 /system/lib64/libEGL.so (android::eglSwapBuffersWithDamageKHRImpl(void*, void*, int*, int)+316) (BuildId: 248ba7f2d80e7bb9952a20e1c3493c86)
#03 pc 000000000001d0a8 /system/lib64/libEGL.so (eglSwapBuffers+80) (BuildId: 248ba7f2d80e7bb9952a20e1c3493c86)
#04 pc 00000000012ec528 /data/app/com.example.order_system-8XYsushVsEZPOltQ3k8npA==/lib/arm64/libflutter.so (BuildId: e14966237eb013b063fed6484195268f7398b594)
Lost connection to device.
Maybe it is late but it may help others. Recently I faced this error and I solved it. Your UI is rendering in Main isolate and your download events come from background isolate. Because codes in callback are run in the background isolate, so you have to handle the communication between two isolates. Usually, communication needs to take place to show download progress in the main UI. Implement the below code to handle communication:
import 'dart:isolate';
import 'dart:ui'; // You need to import these 2 libraries besides another libraries to work with this code
final ReceivePort _port = ReceivePort();
#override
void initState() {
super.initState();
IsolateNameServer.registerPortWithName(_port.sendPort, 'downloader_send_port');
_port.listen((dynamic data) {
String id = data[0];
DownloadTaskStatus status = data[1];
int progress = data[2];
setState((){ });
});
FlutterDownloader.registerCallback(downloadCallback);
}
#override
void dispose() {
IsolateNameServer.removePortNameMapping('downloader_send_port');
super.dispose();
}
static void downloadCallback(String id, DownloadTaskStatus status, int progress) {
final SendPort send = IsolateNameServer.lookupPortByName('downloader_send_port')!;
send.send([id, status, progress]);
}
void _download(String url) async {
final status = await Permission.storage.request();
if(status.isGranted) {
final externalDir = await getExternalStorageDirectory();
final id = await FlutterDownloader.enqueue(
url: url,
savedDir: externalDir!.path,
showNotification: true,
openFileFromNotification: true,
);
} else {
print('Permission Denied');
}
}
Call _download(url) function in your button and you are ready to go.
N.B: I am using sound null safety in my app and for this reason I am using null aware operator in this line of code:
final SendPort send = IsolateNameServer.lookupPortByName('downloader_send_port')!;
I'm programming in swift and run into an error that my WKWebView turns black after "open link" or "add to photos" in safari.
So I got my WebView and everything works fine. But when I long press on (e.g. an image) the apple-dropdown-menu opens with "open link", "add to reading list", ..., "add to photos". Now when I just close the dropdown menu again and go to home screen and open the app again, the webview turns black. The console says it's loading and didFinish, but I can't see anything. Anyone knows possible issues?
When I pressed "open link" on the dropdown-menu safari opens with that link. But when I move back to my app, the screen turns black. Here is the code of the console after opening my app again.
--------------------- SCENEDELEGATE sceneWillEnterForeground ---------------------
2020-08-13 13:48:38.560642+0200 GMP[1817:418564] [ProcessSuspension] 0x282f2aa00 - WKProcessAssertionBackgroundTaskManager: Ignored request to start a new background task because the application is already in the background
2020-08-13 13:48:38.561286+0200 GMP[1817:418564] [ProcessSuspension] 0x282f2aa00 - WKProcessAssertionBackgroundTaskManager: Ignored request to start a new background task because the application is already in the background
--------------------- SCENEDELEGATE sceneDidBecomeActive ---------------------
currentUrl: https://myWebPage.com/
loadUrl(link: https://myWebPage.com/)
didStartProvisionalNavigation webView(_:didStartProvisionalNavigation:)
didCommit webView(_:didCommit:)
2020-08-13 13:48:39.341814+0200 GMP[1817:418614] [assertion] Error acquiring assertion: <NSError: 0x282ff4db0; domain: RBSAssertionErrorDomain; code: 2; reason: "Client is missing required entitlement"> {
userInfo = {
RBSAssertionAttribute = <RBSLegacyAttribute: 0x102c8f640; requestedReason: FinishTaskUnbounded; reason: FinishTaskUnbounded; flags: PreventTaskSuspend>;
}
}
2020-08-13 13:48:39.341902+0200 GMP[1817:418614] [ProcessSuspension] 0x1094e0438 - ProcessAssertion() PID 1817 Unable to acquire assertion for process with PID 1819
2020-08-13 13:48:39.342137+0200 GMP[1817:418564] [ProcessSuspension] 0x1094e0438 - ProcessAssertion::processAssertionWasInvalidated()
2020-08-13 13:48:39.342917+0200 GMP[1817:418614] [assertion] Error acquiring assertion: <NSError: 0x282ff4de0; domain: RBSAssertionErrorDomain; code: 2; reason: "Client is missing required entitlement"> {
userInfo = {
RBSAssertionAttribute = <RBSLegacyAttribute: 0x1040ae040; requestedReason: FinishTaskUnbounded; reason: FinishTaskUnbounded; flags: PreventTaskSuspend>;
}
}
2020-08-13 13:48:39.342998+0200 GMP[1817:418614] [ProcessSuspension] 0x1094e0460 - ProcessAssertion() PID 1817 Unable to acquire assertion for process with PID 1817
2020-08-13 13:48:39.343085+0200 GMP[1817:418564] [ProcessSuspension] 0x1094e0460 - ProcessAssertion::processAssertionWasInvalidated()
2020-08-13 13:48:39.343851+0200 GMP[1817:418614] [assertion] Error acquiring assertion: <NSError: 0x282ffcea0; domain: RBSAssertionErrorDomain; code: 2; reason: "Client is missing required entitlement"> {
userInfo = {
RBSAssertionAttribute = <RBSLegacyAttribute: 0x10415ddb0; requestedReason: FinishTaskUnbounded; reason: FinishTaskUnbounded; flags: PreventTaskSuspend>;
}
}
2020-08-13 13:48:39.343954+0200 GMP[1817:418614] [ProcessSuspension] 0x1094e0488 - ProcessAssertion() PID 1817 Unable to acquire assertion for process with PID 1818
2020-08-13 13:48:39.344028+0200 GMP[1817:418564] [ProcessSuspension] 0x1094e0488 - ProcessAssertion::processAssertionWasInvalidated()
2020-08-13 13:48:39.905526+0200 GMP[1817:418815] [assertion] Error acquiring assertion: <NSError: 0x282f3b690; domain: RBSAssertionErrorDomain; code: 2; reason: "Client is missing required entitlement"> {
userInfo = {
RBSAssertionAttribute = <RBSLegacyAttribute: 0x10414ea00; requestedReason: FinishTaskUnbounded; reason: FinishTaskUnbounded; flags: PreventTaskSuspend>;
}
}
2020-08-13 13:48:39.905574+0200 GMP[1817:418815] [ProcessSuspension] 0x1094e20a8 - ProcessAssertion() PID 1817 Unable to acquire assertion for process with PID 1819
2020-08-13 13:48:39.905602+0200 GMP[1817:418564] [ProcessSuspension] 0x1094e20a8 - ProcessAssertion::processAssertionWasInvalidated()
2020-08-13 13:48:39.906163+0200 GMP[1817:418815] [assertion] Error acquiring assertion: <NSError: 0x282f39590; domain: RBSAssertionErrorDomain; code: 2; reason: "Client is missing required entitlement"> {
userInfo = {
RBSAssertionAttribute = <RBSLegacyAttribute: 0x102d4d0c0; requestedReason: FinishTaskUnbounded; reason: FinishTaskUnbounded; flags: PreventTaskSuspend>;
}
}
2020-08-13 13:48:39.906196+0200 GMP[1817:418815] [ProcessSuspension] 0x1094e20d0 - ProcessAssertion() PID 1817 Unable to acquire assertion for process with PID 1817
2020-08-13 13:48:39.906218+0200 GMP[1817:418564] [ProcessSuspension] 0x1094e20d0 - ProcessAssertion::processAssertionWasInvalidated()
2020-08-13 13:48:39.906769+0200 GMP[1817:418815] [assertion] Error acquiring assertion: <NSError: 0x282f391d0; domain: RBSAssertionErrorDomain; code: 2; reason: "Client is missing required entitlement"> {
userInfo = {
RBSAssertionAttribute = <RBSLegacyAttribute: 0x102c66420; requestedReason: FinishTaskUnbounded; reason: FinishTaskUnbounded; flags: PreventTaskSuspend>;
}
}
2020-08-13 13:48:39.906803+0200 GMP[1817:418815] [ProcessSuspension] 0x1094e20f8 - ProcessAssertion() PID 1817 Unable to acquire assertion for process with PID 1818
2020-08-13 13:48:39.906828+0200 GMP[1817:418564] [ProcessSuspension] 0x1094e20f8 - ProcessAssertion::processAssertionWasInvalidated()
didFinish webView(_:didFinish:)
didSet currentUrl = https://myWebPage.com/
I am developing a Flutter application where I need to utilise the native Firebase Messaging plugin for each platform. I have followed Flutter's guide on platform channels to be able to implement native code. My problem is, that when I install the application on any iOS device for the first time the platform channels is not receiving anything from Swift. The methodCall leaves me hanging. However, when the application is re-installed the token is returned. I am fairly new to Swift and apparently have a hard time fully grasping how to properly implement closures and the #escaping parameter.
I have narrowed the problem down to the line GeneratedPluginRegistrant.register(with: self) (which is pretty important for a Flutter application). When the line is left out I retrieve the token every time, but the splash screen is never presented (the app is stalling at a blank screen, which is not viable solution).
At first I thought the application was affected by the fact it request permissions to show notifications on the initial run, but even when I do not answer the pop-up before re-installing the application I get the token. I tried running the application without requesting permissions to show notifications, but this did not affect the outcome.
Client / Flutter
The following code is called from initState():
Future<void> getTokenNatively() async {
print("inside getTokenNatively()");
try {
userToken = await getFirebaseTokenChannel.invokeMethod("getTokenNatively");
print("-- FLUTTER -- userToken: $userToken");
} catch (error) {
print("getTokenNatively() resulted in an error: $error");
} finally {
print("Finally has run.");
}
}
Host / iOS
The following method is called inside didFinishLaunchingWithOptions
let controller : FlutterViewController = window?.rootViewController as! FlutterViewController
let tokenChannel = FlutterMethodChannel(name: "com.example.obscured/getTokenNatively",
binaryMessenger: controller)
tokenChannel.setMethodCallHandler({
[weak self] (call: FlutterMethodCall, result: #escaping FlutterResult) -> Void in
print("just inside our FlutterMethodCall closure")
guard call.method == "getTokenNatively" else {
result(FlutterMethodNotImplemented)
return
}
print("I will be printed every time")
InstanceID.instanceID().instanceID(handler: { (res, error) in
print("First line after 'in' inside InstanceID.instanceID().instanceID")
if let error = error {
print("Error fetching remote instance ID: \(error)")
result(error.localizedDescription)
} else if let res = res {
print("Remote instance ID token: \(res.token)")
result(res.token)
} else {
print("neither a error or result. What are you?")
result("none of the above")
}
print("Outside if/else if/else")
})
print("That seems to be the case for me as well")
})
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
Log for a fresh install (the app is not already loaded onto the device):
2019-03-29 10:47:39.215103+0100 Runner[2334:1001337] 5.7.0 - [Firebase/Analytics][I-ACS023007] Analytics v.50101000 started
2019-03-29 10:47:39.215323+0100 Runner[2334:1001337] 5.7.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see "some fancy google link")
2019-03-29 10:47:39.219380+0100 Runner[2334:1001347] flutter: Observatory listening on http://127.0.0.1:60398/
APNs token retrieved: 32 bytes
2019-03-29 10:47:39.953629+0100 Runner[2334:1001340] flutter: didChangeDependencies() root_page
2019-03-29 10:47:39.959653+0100 Runner[2334:1001340] flutter: getDevice() result: IOS
2019-03-29 10:47:39.960416+0100 Runner[2334:1001340] flutter: inside getTokenNatively()
just inside our FlutterMethodCall closure
I will be printed every time
That seems to be the case for me as well
2019-03-29 10:47:40.177060+0100 Runner[2334:1001340] flutter: _authStatus: AuthStatus.signedIn
2019-03-29 10:47:40.177195+0100 Runner[2334:1001340] flutter: _homeStatus: null
2019-03-29 10:47:41.174878+0100 Runner[2334:1001340] flutter: Has [USER] accepted an invitation? Answer: true
2019-03-29 10:47:41.175041+0100 Runner[2334:1001340] flutter: crudMethods.hasHome(): true
2019-03-29 10:47:43.853516+0100 Runner[2334:1001355] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C4.1:2][0x1133cd2b0] get output frames failed, state 8196
2019-03-29 10:47:43.853858+0100 Runner[2334:1001355] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C4.1:2][0x1133cd2b0] get output frames failed, state 8196
2019-03-29 10:47:43.854425+0100 Runner[2334:1001355] TIC Read Status [4:0x0]: 1:57
2019-03-29 10:47:43.854485+0100 Runner[2334:1001355] TIC Read Status [4:0x0]: 1:57
Log for a clean install when leaving the following line out GeneratedPluginRegistrant.register(with: self):
2019-03-29 10:45:37.212943+0100 Runner[2327:1000780] flutter: Observatory listening on http://127.0.0.1:60265/
2019-03-29 10:45:37.214168+0100 Runner[2327:1000766] 5.7.0 - [Firebase/Analytics][I-ACS023007] Analytics v.50101000 started
2019-03-29 10:45:37.214855+0100 Runner[2327:1000766] 5.7.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see "some shortened Google url")
APNs token retrieved: 32 bytes
2019-03-29 10:45:37.636480+0100 Runner[2327:1000772] [VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: MissingPluginException(No implementation found for method Firestore#settings on channel plugins.flutter.io/cloud_firestore)
#0 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:300:7)
<asynchronous suspension>
#1 Firestore.settings (file:///Users/[USER]/Library/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.9.5+2/lib/src/firestore.dart:145:19)
<asynchronous suspension>
#2 main (package:cue_app/main.dart:31:18)
<asynchronous suspension>
#3 _runMainZoned.<anonymous closure>.<anonymous closure> (dart:ui/hooks.dart:189:25)
#4 _rootRun (dart:async/zone.dart:1124:13)
#5 _CustomZone.run (dart:async/zone.dart:1021:19)
#6 _runZoned (dart:async/zone.dart:1516:10)
#7 runZoned (dart:async/zone.dart:1500:12)
#8 _runMainZoned.<anonymous closure> (dart:ui/hooks.dart:180:5)
#9 _startIsolate.<anonymous closure> (dart:isolate/runtime/lib/isolate_patch.dart:300:19)
#10 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/lib/isolate_patch.dart:171:12)
Firebase registration token: [OMITTED]
I am then getting the token, but the app never presents the splash screen (hence, it is not a solution).
Log for a re-install (An earlier version of the application is on the device):
2019-03-29 11:30:28.125256+0100 Runner[2345:1004655] 5.7.0 - [Firebase/Analytics][I-ACS023007] Analytics v.50101000 started
2019-03-29 11:30:28.127196+0100 Runner[2345:1004655] 5.7.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see "some google link")
2019-03-29 11:30:28.133468+0100 Runner[2345:1004666] flutter: Observatory listening on http://127.0.0.1:61630/
APNs token retrieved: 32 bytes
2019-03-29 11:30:28.590713+0100 Runner[2345:1004661] flutter: didChangeDependencies() root_page
2019-03-29 11:30:28.595299+0100 Runner[2345:1004661] flutter: getDevice() result: IOS
2019-03-29 11:30:28.596043+0100 Runner[2345:1004661] flutter: inside getTokenNatively()
just inside our FlutterMethodCall closure
I will be printed every time
That seems to be the case for me as well
First line after 'in' inside InstanceID.instanceID().instanceID
Remote instance ID token: [OMITTED]
Outside if/else if/else
2019-03-29 11:30:28.794378+0100 Runner[2345:1004661] flutter: _authStatus: AuthStatus.signedIn
2019-03-29 11:30:28.794446+0100 Runner[2345:1004661] flutter: _homeStatus: null
2019-03-29 11:30:28.796259+0100 Runner[2345:1004661] flutter: -- FLUTTER -- userToken: [OMITTED]
2019-03-29 11:30:28.796293+0100 Runner[2345:1004661] flutter: Finally has run.
2019-03-29 11:30:29.974120+0100 Runner[2345:1004661] flutter: Has [USER] accepted an invitation? Answer: true
2019-03-29 11:30:29.974453+0100 Runner[2345:1004661] flutter: crudMethods.hasHome(): true
UPDATE
I have simplified the example. The Swift code is from Firebase's repo. When I run their example as a stand alone it works as a charm. However, when I try to integrate it in my Flutter project it breaks it the various scenarios outlined above.
For some reason the code is not allowed to return the code within the methodChannel on the first run. I think it has something to do with #escaping in Swift, but I do not know how to progress from here. Has anybody got an idea?
Debug shows me this
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
and the output shows
2013-05-16 04:58:07.496 Scroll Blog[5296:c07] get_recent_post&cat=
2013-05-16 04:58:12.251 Scroll Blog[5296:c07] -JSONValue failed. Error is: No digits in exponent
2013-05-16 04:58:12.252 Scroll Blog[5296:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
*** First throw call stack:
(0x28eb012 0x2207e7e 0x289eb6a 0x289ea20 0xb43c 0x12796 0xe3726 0x221b6b0 0x1c47765 0x286ef3f 0x286e96f 0x2891734 0x2890f44 0x2890e1b 0x28457e3 0x2845668 0x114bffc 0x2f3d 0x2e65 0x1)
libc++abi.dylib: terminate called throwing an exception
(lldb)
Try Adding an Exception Breakpoint. Now you should get a more useful stack trace.
I have spent my two days on implementing this, but no success. I am using SMTPSender project code present at http://code.google.com/p/skpsmtpmessage/source/checkout ... the demo project works perfect!
but when i copy class files to my project (as in instructions) , it builds and run fine. But when i try to send email ... it gives the following error.
C: Attempting to connect to server at: smtp.gmail.com:25
2011-04-21 17:42:29.183 LocaliphoneAppRequest[5517:207] C: Attempting to connect to server at: smtp.gmail.com:465
2011-04-21 17:42:37.183 LocaliphoneAppRequest[5517:207] C: Attempting to connect to server at: smtp.gmail.com:587
2011-04-21 17:42:37.546 LocaliphoneAppRequest[5517:207] *** stopping watchdog ***
2011-04-21 17:42:37.549 LocaliphoneAppRequest[5517:207] S: 220 mx.google.com ESMTP l5sm941912wej.32
2011-04-21 17:42:37.553 LocaliphoneAppRequest[5517:207] C: EHLO localhost
2011-04-21 17:42:37.557 LocaliphoneAppRequest[5517:207] *** starting short watchdog ***
2011-04-21 17:42:37.741 LocaliphoneAppRequest[5517:207] *** stopping watchdog ***
2011-04-21 17:42:37.742 LocaliphoneAppRequest[5517:207] S: 250-mx.google.com at your service, [119.153.117.81]
2011-04-21 17:42:37.743 LocaliphoneAppRequest[5517:207] *** stopping watchdog ***
2011-04-21 17:42:37.744 LocaliphoneAppRequest[5517:207] S: 250-SIZE 35882577
2011-04-21 17:42:37.745 LocaliphoneAppRequest[5517:207] *** stopping watchdog ***
2011-04-21 17:42:37.747 LocaliphoneAppRequest[5517:207] S: 250-8BITMIME
2011-04-21 17:42:37.748 LocaliphoneAppRequest[5517:207] *** stopping watchdog ***
2011-04-21 17:42:37.749 LocaliphoneAppRequest[5517:207] S: 250-STARTTLS
2011-04-21 17:42:37.754 LocaliphoneAppRequest[5517:207] C: STARTTLS
2011-04-21 17:42:37.755 LocaliphoneAppRequest[5517:207] *** starting short watchdog ***
2011-04-21 17:42:37.756 LocaliphoneAppRequest[5517:207] *** stopping watchdog ***
2011-04-21 17:42:37.759 LocaliphoneAppRequest[5517:207] S: 250 ENHANCEDSTATUSCODES
2011-04-21 17:42:37.937 LocaliphoneAppRequest[5517:207] *** stopping watchdog ***
2011-04-21 17:42:37.939 LocaliphoneAppRequest[5517:207] S: 220 2.0.0 Ready to start TLS
2011-04-21 17:42:37.942 LocaliphoneAppRequest[5517:207] Beginning TLSv1...
2011-04-21 17:42:37.944 LocaliphoneAppRequest[5517:207] C: EHLO localhost
2011-04-21 17:42:38.675 LocaliphoneAppRequest[5517:207] *** starting short watchdog ***
2011-04-21 17:42:38.861 LocaliphoneAppRequest[5517:207] *** stopping watchdog ***
2011-04-21 17:42:38.861 LocaliphoneAppRequest[5517:207] S: 250-mx.google.com at your service, [119.153.117.81]
2011-04-21 17:42:38.863 LocaliphoneAppRequest[5517:207] *** stopping watchdog ***
2011-04-21 17:42:38.864 LocaliphoneAppRequest[5517:207] S: 250-SIZE 35882577
2011-04-21 17:42:38.867 LocaliphoneAppRequest[5517:207] *** stopping watchdog ***
2011-04-21 17:42:38.869 LocaliphoneAppRequest[5517:207] S: 250-8BITMIME
2011-04-21 17:42:38.872 LocaliphoneAppRequest[5517:207] *** stopping watchdog ***
2011-04-21 17:42:38.874 LocaliphoneAppRequest[5517:207] S: 250-AUTH LOGIN PLAIN XOAUTH
2011-04-21 17:42:38.875 LocaliphoneAppRequest[5517:207] *** stopping watchdog ***
2011-04-21 17:42:38.879 LocaliphoneAppRequest[5517:207] S: 250 ENHANCEDSTATUSCODES
2011-04-21 17:42:38.880 LocaliphoneAppRequest[5517:207] -[NSConcreteMutableData encodeBase64ForData]: unrecognized selector sent to instance 0x6a67190
2011-04-21 17:42:38.914 LocaliphoneAppRequest[5517:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSConcreteMutableData encodeBase64ForData]: unrecognized selector sent to instance 0x6a67190'
My code is
SKPSMTPMessage *testMsg = [[SKPSMTPMessage alloc] init];
testMsg.fromEmail = #"mygmail#gmail.com";
testMsg.toEmail = #"myanothergmail#gmail.com";
testMsg.relayHost = #"smtp.gmail.com";
testMsg.requiresAuth = YES;
testMsg.login = #"mygmail#gmail.com";
testMsg.pass = #"mypass";
testMsg.subject = #"test message";
// testMsg.bccEmail = #"testbcc#test.com";
testMsg.wantsSecure = YES; // smtp.gmail.com doesn't work without TLS!
// Only do this for self-signed certs!
// testMsg.validateSSLChain = NO;
testMsg.delegate = self;
NSDictionary *plainPart = [NSDictionary dictionaryWithObjectsAndKeys:#"text/plain",kSKPSMTPPartContentTypeKey,
#"This is a test message.",kSKPSMTPPartMessageKey,#"8bit",kSKPSMTPPartContentTransferEncodingKey,nil];
testMsg.parts = [NSArray arrayWithObjects:plainPart,nil];
[testMsg send];
Please help me out ..... :(
I had this problem when I first started playing with SKPSMTPMessage. I forget the details or where I got the original answer, but I wrapped NSStream+SKPSMTPExtensions.* into SKPSMTPMessage.* and it went away.
Just put the interface and implementation after the imports and before the rest of the code for NSStream (SKPSMTPExtensions).