Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24325] iOS: Build fails when using only Ti.Media.openMusicLibrary

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2017-01-25T11:49:36.000+0000
Affected Version/sRelease 6.1.0, Release 6.0.1
Fix Version/sRelease 6.0.2
ComponentsiOS
Labelsios, media, musiclibrary
ReporterHans Knöchel
AssigneeHans Knöchel
Created2017-01-18T18:28:07.000+0000
Updated2017-01-25T11:49:42.000+0000

Description

When using Ti.Media.openMusicLibrary() without any other Ti.Media API, the build fails on 6.0.1.GA and 6.1.0. Test-Case:
var win = Ti.UI.createWindow({
    backgroundColor: '#fff'
});

var btn = Ti.UI.createButton({
    title: 'Trigger'
});

btn.addEventListener('click', function() {
    Titanium.Media.openMusicLibrary({
    	allowMultipleSelections : false,
    	mediaTypes : Titanium.Media.MUSIC_MEDIA_TYPE_MUSIC|Titanium.Media.MUSIC_MEDIA_TYPE_ANY_AUDIO,
    	success : function(event) {
    		// called when media returned from the MusicLibrary
    		console.log("Results: " + JSON.stringify(event));
    	},
    	cancel : function() {
    		alert("Aborting ");
    	},
    	error : function(error) {
    		// called when there's an error
    		var a = Titanium.UI.createAlertDialog({
    			title : 'Music Library'
    		});
    		if (error.code == Titanium.Media.NO_MUSIC_PLAYER) {
    			a.setMessage('Please run this test on device.');
    		} else {
    			a.setMessage('Unexpected error: ' + error.code);
    		}
    		a.show();
    	}
    });

});

win.add(btn);
win.open();

Attachments

FileDateSize
T24281-Full-Log.rtf2017-01-18T18:42:40.000+00001062322

Comments

  1. Hans Knöchel 2017-01-18

    PR: https://github.com/appcelerator/titanium_mobile/pull/8763
  2. Abir Mukherjee 2017-01-18

    [~hansknoechel] Thanks for creating the ticket. I have attached the full log. For reference, here is the environment I used: NPM Version: 2.15.9 Node Version: 4.5.0 Mac OS: 10.12.1 Appc CLI: 6.1.0 Appc CLI NPM: 4.2.8 Titanium SDK version: 6.1.0.v20170118081704 (failed for 6.0.1 as well) Appcelerator Studio, build: 4.8.1.201612050850 Xcode 8.2 iOS Device: 9 or 10 (tested on 9.2 and 10.2) This is the error seen:
       [ERROR] :  ** BUILD FAILED **
       [ERROR] :  The following build commands failed:
       [ERROR] :      CompileC build/Intermediates/test1.build/Debug-iphoneos/test1.build/Objects-normal/armv7/MediaModule.o Classes/MediaModule.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
       [ERROR] :  (1 failure)
       
  3. Abir Mukherjee 2017-01-20

    Completed FR Review and passed. This was the environment: NPM Version: 2.15.9 Node Version: 4.5.0 Mac OS: 10.12.1 Appc CLI: 6.1.0 Appc CLI NPM: 4.2.8 Titanium SDK version: 6.1.0.v20170120115404 Appcelerator Studio, build: 4.8.1.201612050850 Xcode 8.2 iOS Device: 10 I built to iOS device from Studio, and there were no build errors. The app installed, and I was able to use it.
  4. Abir Mukherjee 2017-01-20

    Fixed in SDK 6.1.0.v20170120115404
  5. Hans Knöchel 2017-01-22

    Reopening for backport to 6.0.2
  6. Hans Knöchel 2017-01-23

    PR (6_0_X): https://github.com/appcelerator/titanium_mobile/pull/8770
  7. Abir Mukherjee 2017-01-23

    NPM Version: 2.15.9 Node Version: 4.5.0 Mac OS: 10.12.1 Appc CLI: 6.1.0 Appc CLI NPM: 4.2.8 Titanium SDK version: 6.0.2.v20170123062940 Appcelerator Studio, build: 4.8.1.201612050850 Xcode 8.2 iOS Device: 10 I built to iOS device from Studio, and there were no build errors. The app installed, and I was able to use it. Note that this is for the 6.0.2 backport version.

JSON Source