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

feat(ios): add install failed error message #13350

Merged
merged 2 commits into from
Jul 1, 2022

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented Mar 31, 2022

Fixes #13349

Adds a new error message Failed to transfer app to device. Check if your devices is registered in your provisioning profile. for 0xe800001a when the build process can't install the iOS app the end. In our case it was not registered in the prov. profile.

Side note:
Still have to figure out why the error (or default) error message is not showing but

[ERROR] Error
    at Object.<anonymous> (/Users/miga/Library/Application Support/Titanium/mobilesdk/osx/10.2.0.v20220325163249/node_modules/node-appc/lib/exception.js:34:27)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:93:18)
    at Object.get (/Users/miga/Library/Application Support/Titanium/mobilesdk/osx/10.2.0.v20220325163249/node_modules/node-appc/lib/appc.js:62:11)
    at Handle.<anonymous> (/Users/miga/Library/Application Support/Titanium/mobilesdk/osx/10.2.0.v20220325163249/iphone/cli/hooks/install.js:207:22)
    at Handle.emit (events.js:412:35)

Happens with the current GA and 10.2.0. The default For some reason the app failed to install on the device. message is not showing up!

@hansemannn
Copy link
Collaborator

hansemannn commented Mar 31, 2022

Try to replace

next(new appc.exception(err, details));

with

next(new appc.exception(details));

Thats at least how the other appc.exception calls are structured. If it doesn't help, @cb1kenobi might need to check it, he wrote the code originally (looking at the git-blame).

@m1ga
Copy link
Contributor Author

m1ga commented Mar 31, 2022

Same error. Easier way to test: detach the device before it installs.
Even the code in node-appc is untouched for a while. Very strange

@cb1kenobi
Copy link
Contributor

I'm fine with this change, though the error message is curious. Maybe the message is empty?

@hansemannn
Copy link
Collaborator

Since the error message will not be printed out so far (maybe due to a Node.js breaking change that broke appc.exception?). Therefore, I would put the work in progress label onto here for now.

@m1ga
Copy link
Contributor Author

m1ga commented Apr 2, 2022

https://github.com/tidev/node-appc/blob/master/lib/exception.js#L34
if I change

AppcException.prototype = new Error();

to

AppcException.prototype = Object.create(Error.prototype);
// or AppcException.prototype = Error.prototype; but that is "bad form" according to the SO article below

I'll see the error messages again. Got the hint from https://stackoverflow.com/a/871646/5193915 and it even was like this a loooong time ago: https://github.com/tidev/node-appc/blob/ba568e1bf744f76ac522214ad09c970c392b0d73/lib/exception.js#L32

Perhaps there was a change in nodejs how to handle new Error()? Can't believe that is is broken for such a long time

@hansemannn
Copy link
Collaborator

Makes sense for me. @cb1kenobi Thoughts? The reason it may have worked for years without a code change was likely a behavioral change in a certain Node.js version.

@caspahouzer
Copy link
Contributor

I deregistered my device in the provisioning file and tried to install. see the new error message 👍🏻

@m1ga
Copy link
Contributor Author

m1ga commented Apr 11, 2022

Removed the work in progress tag. tidev/node-appc#461 got merged so the errors will appear again. This PR will now add another error message for 0xe800001a

@hansemannn
Copy link
Collaborator

@m1ga The new version of node-appc should be released and included here as well, then we can merge!

@hansemannn hansemannn added this to the 11.1.0 milestone Jun 5, 2022
@m1ga
Copy link
Contributor Author

m1ga commented Jul 1, 2022

node-appc is released with the fix, so this can be merged for the next SDK (just adding another error message to the output) 👍

@hansemannn hansemannn merged commit e5c8391 into tidev:master Jul 1, 2022
@m1ga m1ga deleted the iosInstallError branch July 1, 2022 17:45
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

Successfully merging this pull request may close these issues.

iOS: optimize error message if installation fails
4 participants