Titanium JIRA Archive
Appcelerator Community (AC)

[AC-5385] iOS: Appcrash when taking pictures and change orientation mode

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionCannot Reproduce
Resolution Date2017-11-20T16:27:46.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
Reporterdbenhenni
AssigneeShak Hossain
Created2017-11-17T18:37:33.000+0000
Updated2017-11-20T16:27:47.000+0000

Description

Steps to Reproduce

This happens arbitrarily. Not every time. But it is always attached to an orientation change of the camera.

Actual Result

[ERROR] : The application has crashed with an uncaught exception 'NSInvalidArgumentException'. [ERROR] : Reason: [ERROR] : -[TiUILabel _containedInNavigationPalette]: unrecognized selector sent to instance 0x141e88ca0 [ERROR] : Stack trace: [ERROR] : 0 CoreFoundation 0x0000000191dc2fe0 + 124 [ERROR] : 1 libobjc.A.dylib 0x0000000190824538 objc_exception_throw + 56 [ERROR] : 2 CoreFoundation 0x0000000191dc9ef4 + 0 [ERROR] : 3 CoreFoundation 0x0000000191dc6f54 + 916 [ERROR] : 4 CoreFoundation 0x0000000191cc2d4c _CF_forwarding_prep_0 + 92 [ERROR] : 5 UIKit 0x00000001989a69cc + 76 [ERROR] : 6 UIKit 0x00000001989a2d5c + 392 [ERROR] : 7 Foundation 0x00000001927b553c + 308 [ERROR] : 8 CoreFoundation 0x0000000191d5d5f4 + 20 [ERROR] : 9 CoreFoundation 0x0000000191d5cd08 + 400 [ERROR] : 10 CoreFoundation 0x0000000191d5ca84 + 60 [ERROR] : 11 CoreFoundation 0x0000000191dcb7a8 + 1412 [ERROR] : 12 CoreFoundation 0x0000000191ca095c _CFXNotificationPost + 376 [ERROR] : 13 Foundation 0x00000001927b2930 + 68 [ERROR] : 14 UIKit 0x00000001985b7f04 + 324 [ERROR] : 15 UIKit 0x0000000197f223dc + 644 [ERROR] : 16 UIKit 0x0000000197f38ad4 + 108 [ERROR] : 17 UIKit 0x00000001985b7d08 + 480 [ERROR] : 18 UIKit 0x00000001981bf2d0 + 616 [ERROR] : 19 UIKit 0x00000001981c0a70 + 1232 [ERROR] : 20 UIKit 0x0000000197f6b7f8 + 548 [ERROR] : 21 UIKit 0x0000000197f6b478 + 148 [ERROR] : 22 UIKit 0x0000000197f62010 + 124 [ERROR] : 23 UIKit 0x0000000197eee064 + 472 [ERROR] : 24 UIKit 0x00000001983b7730 + 344 [ERROR] : 25 UIKit 0x00000001983b663c + 108 [ERROR] : 26 UIKit 0x00000001981733b8 + 656 [ERROR] : 27 UIKit 0x00000001981c0ed4 + 292 [ERROR] : 28 UIKit 0x00000001985b8040 + 168 [ERROR] : 29 UIKit 0x00000001981e97f0 + 220 [ERROR] : 30 UIKit 0x00000001985b7e48 + 136 [ERROR] : 31 UIKit 0x0000000197f223dc + 644 [ERROR] : 32 UIKit 0x0000000197f38ad4 + 108 [ERROR] : 33 UIKit 0x00000001985b7d08 + 480 [ERROR] : 34 UIKit 0x00000001981bf2d0 + 616 [ERROR] : 35 UIKit 0x00000001981c0a70 + 1232 [ERROR] : 36 UIKit 0x0000000197f6b7f8 + 548 [ERROR] : 37 UIKit 0x0000000197f6b478 + 148 [ERROR] : 38 UIKit 0x0000000197f62010 + 124 [ERROR] : 39 UIKit 0x0000000197eee064 + 472 [ERROR] : 40 CoreFoundation 0x0000000191d5d5f4 + 20 [ERROR] : 41 CoreFoundation 0x0000000191d5cd08 + 400 [ERROR] : 42 CoreFoundation 0x0000000191d5ca84 + 60 [ERROR] : 43 CoreFoundation 0x0000000191dcb7a8 + 1412 [ERROR] : 44 CoreFoundation 0x0000000191ca095c _CFXNotificationPost + 376 [ERROR] : 45 Foundation 0x00000001927b2930 + 68 [ERROR] : 46 UIKit 0x0000000197eedbb0 + 324 [ERROR] : 47 UIKit 0x0000000198185288 + 88 [ERROR] : 48 UIKit 0x00000001981851f8 + 140 [ERROR] : 49 UIKit 0x0000000197eed954 + 1440 [ERROR] : 50 UIKit 0x0000000197eed24c + 100 [ERROR] : 51 UIKit 0x0000000197f57fd0 + 404 [ERROR] : 52 GraphicsServices 0x00000001937098a0 + 744 [ERROR] : 53 GraphicsServices 0x0000000193709390 + 32 [ERROR] : 54 CoreFoundation 0x0000000191d71ae4 + 56 [ERROR] : 55 CoreFoundation 0x0000000191d71284 + 436 [ERROR] : 56 CoreFoundation 0x0000000191d6ed98 + 1752 [ERROR] : 57 CoreFoundation 0x0000000191c9eda4 CFRunLoopRunSpecific + 424 [ERROR] : 58 GraphicsServices 0x0000000193708074 GSEventRunModal + 100 [ERROR] : 59 UIKit 0x0000000197f52058 UIApplicationMain + 208 [ERROR] : 60 Service Entwicklung 3 0x0000000100058f00 Service Entwicklung 3 + 20224 [ERROR] : 61 libdyld.dylib 0x0000000190cad59c + 4 -- End application log -------------------------------------------------------

Expected Result

taking a picture and close the controller.

Attachments

FileDateSize
.log2017-11-17T18:37:53.000+00008900082
diagnostic4287452246757257167.log2017-11-17T18:38:08.000+0000352382

Comments

  1. Sharif AbuDarda 2017-11-17

    Hello, Please share the full reproducible sample code. Also, SDK CLI and testing platform info. Thanks.
  2. dbenhenni 2017-11-18

    Axway Appcelerator Studio, build: 4.10.0.201709271713 Testing Platform: iPad 2 Mini A1490 iOS 10.3.2 SDK: Tested with 6.2.1, 6.2.2 and latest 6.3.0
  3. dbenhenni 2017-11-18

       function take_photo(useGallery) {
       	try {
       		myPicture = {};
       		filename = uuid.getNumber();
       		var f = function(e) {
       			log.log("new_picture > take_photo: took picture e=" + e.mediaType);
       			if (e.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) {
       				photofile = photofilename();
       				var f = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, photofile);
       				var blob = e.media;
       				var h = blob.height;
       				var w = blob.width;
       				if (h > w) {
       					blob = blob.imageAsResized(768, 1024);
       				} else {
       					blob = blob.imageAsResized(1024, 768);
       				}
       				converter.saveJpg(blob, f.nativePath, 0.3);
       				
       				log.log("new_picture > take photo: Photo: "+JSON.stringify(myPicture));
       				
       				myPicture = Ti.Filesystem.applicationDataDirectory + photofile;
       				$.getView("image").image = myPicture;
       			}
       		};
       
       		if (Ti.Platform.model != "Simulator" || useGallery) {
       			if (useGallery) {
       				Ti.Media.openPhotoGallery({
       					allowEditing : true,
       					mediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO],
       					success : f
       				});
       			} else {
       				Ti.Media.showCamera({
       					success : f,
       					mediaType : Ti.Media.MEDIA_TYPE_PHOTO
       				});
       			}
       		} else {
       			photofile = photofilename();
       			var file = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, "app_foto" + ".jpg");
       			var copy = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, photofile);
       			var blob = file.read();
       
       			var h = blob.height;
       			var w = blob.width;
       			// Ratio bei Android und iOS 4:3
       			if (h > w) {
       				blob = blob.imageAsResized(768, 1024);
       			} else {
       				blob = blob.imageAsResized(1024, 768);
       			}
       			//copy.write(blob);
       			converter.saveJpg(blob, copy.nativePath, 0.3);
       			myPicture = Ti.Filesystem.applicationDataDirectory + photofile;
       
       			$.getView("image").image = myPicture;
       		}
       	}  catch (e) {
       		log.exception("new_picture > event_photo", e);
       	}
       }
       
  4. Sharif AbuDarda 2017-11-18

    Hello, This is not the full sample code. Please provide a sample app of full reproducible code that we can directly use. Thanks.
  5. Hans Knöchel 2017-11-19

    Hey there! Can you provide a few more infos regarding the crash? Does it crash when changing the orientation while showing the camera or after taking it and returning to the callback? I agree with [~sdarda], the demo-code looks very specific from your project - things like the UUID shouldn't be relevant. We would like to schedule it asap, but only with a full test-case to reproduce, I hope that makes sense. Thank you! A bit of background of the crash: It tried to call containedInNavigationPalette from a UILabel instance, but the selector is only valid for a UISearchBar.
  6. dbenhenni 2017-11-20

    The cameramode appears > I change the orientation mode to take a landscape picture > and without clicking take Picture or something else the app crashes inside of my cameraMode. This doesn't happen everytime. Just sometimes. That makes it hard for me to figure out where to search for the issue. So I do have to do that several times. Open camera mode > change orientation > close .... and suddenly the app crashes. {color:#14892c}A bit of background of the crash: It tried to call containedInNavigationPalette from a UILabel instance, but the selector is only valid for a UISearchBar.{color} Yes. I've seen that. But I don't have an idea why he wants to do that? A searchbar is only available inside of lists, isn't it? But I am neither inside of a list- nor a tableview...
  7. Hans Knöchel 2017-11-20

    Do you use any custom overlay? At this point we really need a full example to continue (best if classic Titanium in a single file) so it's easier for us to debug. Thank you!
  8. dbenhenni 2017-11-20

    I'm not able to reproduce the crashes. Neither inside of the app nor in the Classic Titanium App I created for you a couple of minutes ago. So please close this call. Thanks!
  9. Hans Knöchel 2017-11-20

    Ok, thank you! Please feel free to reopen the issue if you are able to get a reproducible test.

JSON Source