Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with XCode10 #26

Open
parnanzio opened this issue Sep 20, 2018 · 7 comments
Open

Problem with XCode10 #26

parnanzio opened this issue Sep 20, 2018 · 7 comments

Comments

@parnanzio
Copy link

Hi, I just updated to XCode 10 and I cannot build the app with the ti.nfc module.

I receive this error:

[ERROR] 2018-09-20 15:08:40.269 xcodebuild[6363:66947]  DTDeviceKit: deviceType from 7a1e1e83be69fa2a2fa48da4eed8df462fdebaff was NULL
[ERROR] 2018-09-20 15:08:40.269 xcodebuild[6363:66947]  DTDeviceKit: deviceType from 7a1e1e83be69fa2a2fa48da4eed8df462fdebaff was NULL
[ERROR] 2018-09-20 15:08:40.269 xcodebuild[6363:66947]  iPhoneSupport: 📱<DVTiOSDevice (0x7f91772c4700), iParnPhone, iPhone, 12.0 (16A366), 8d6f60665bb12bf99aaddf8c084449d71db4ad1a> unable to mount DeveloperDiskImage (Error Domain=com.apple.dtdevicekit Code=601 "Could not find platform" UserInfo={NSLocalizedDescription=Could not find platform})
[ERROR] 2018-09-20 15:08:40.371 xcodebuild[6363:66924] [MT] DTDeviceKit: deviceType from 7a1e1e83be69fa2a2fa48da4eed8df462fdebaff was NULL
[ERROR] 2018-09-20 15:08:40.379 xcodebuild[6363:66924] [MT] DTDeviceKit: deviceType from 7a1e1e83be69fa2a2fa48da4eed8df462fdebaff was NULL
[ERROR] 2018-09-20 15:08:40.541 xcodebuild[6363:66924] [MT] DTDeviceKit: deviceType from 7a1e1e83be69fa2a2fa48da4eed8df462fdebaff was NULL
[ERROR] 2018-09-20 15:08:40.553 xcodebuild[6363:66924] [MT] DTDeviceKit: deviceType from 7a1e1e83be69fa2a2fa48da4eed8df462fdebaff was NULL
[ERROR] ** BUILD FAILED **
[ERROR] The following build commands failed:
[ERROR]         Ld /Users/parnanzio/Sviluppo/workspace_appcelerator/myapp/build/iphone/build/Intermediates/MyApp.build/Debug-iphoneos/MyApp.build/Objects-normal/armv7/MyApp normal armv7
[ERROR] (1 failure)

If I remove the <module platform="iphone">ti.nfc</module> from tiapp.xml it compiles as always.

@eddyinet
Copy link

Same issue here

@eddyinet
Copy link

eddyinet commented Sep 21, 2018

Not sure if this is the correct way to fix this but I managed to get this to work by rebuilding the module and changing the OTHER_LDFLAGS in module.xcconfig to target iOS12 as such:

OTHER_LDFLAGS[sdk=iphoneos12*]=$(inherited) -framework CoreNFC

@parnanzio
Copy link
Author

It works to me too with this update, but it read an empty object {"messages":[{}]}..
I'll try again.. @eddyinet is it working fine for you?

@eddyinet
Copy link

Messages are coming in OK for me though I'm just doing plain text. Tested on iOS 11 & 12 successfully.

@parnanzio
Copy link
Author

Sorry, messages is not empty, but all the NdefRecords are.
I receive 3 TiNfcNdefRecord objects, but cannot read their properties (recordType, payload, ..).

@parnanzio
Copy link
Author

I cannot read all the data stored in the tag. There are 3 fields, a string, a website (preceded with https:// and a phone number.

function handleDiscovery(e) {
	Alloy.Globals.___(e, "handleDiscovery");
	Ti.API.warn(e);
	if (e.messages) {
		var message = e.messages[0];
		if (message.records) {
                         var el;
			for (var i = 0; i < message.records.length; i++) {
                                 el = message.records[i];
                 Ti.API.info("id: " + el.id);
		Ti.API.info("type: " + el.type);
		Ti.API.info("recordType: " + el.recordType);
		Ti.API.info("payload: " + el.payload);
		Ti.API.info("tnf: " + el.tnf);
		_.each(_.keys(el), function (key) {
			Ti.API.info("> " + key + ": " + el[key]);
		});
            }
        }
    }
}

The output is (I had to fix the payload value because the substring was removing the first character):

[INFO]  id:
[INFO]  type:
[INFO]  recordType: undefined
[INFO]  payload: enil mio testo
[INFO]  tnf: 1
[INFO]  id:
[INFO]  type:
[INFO]  recordType: undefined
[INFO]  payload: skianet.it
[INFO]  tnf: 1
[INFO]  id:
[INFO]  type:
[INFO]  recordType: undefined
[INFO]  payload: 3471234567
[INFO]  tnf: 1

@janvennemann
Copy link

Please see https://jira.appcelerator.org/browse/MOD-2496 for the official ticket for this issue. As @eddyinet already pointed out this is due to a wrong linker flag. For compatibility with previous iOS version it is recommended to use the following config:

OTHER_LDFLAGS=$(inherited) -weak_framework CoreNFC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants