K
K
Kirill Gavrilov2020-01-09 13:38:13
Apache Cordova
Kirill Gavrilov, 2020-01-09 13:38:13

How to fix gap_init:3 error when building on ios?

Hello!
When building a project on android, there are no problems, but when you build the same project on ios, 3 prompts fly out with messages:
1) gap_init:3
2) gap:[null,"CoreAndroid","messageChannel","CoreAndroid569204053" ]
3) gap:[null,"CoreAndroid","show","CoreAndroid569204054"]
As for my project and config.xml:
I specify where to get static for the application and instead of taking it from the www folder, it is taken from me with S3 AWS
<content src="https://mydomen.com/" />
and
<allow-navigation href="https://mydomen.com/*" />
I won’t bore you why it’s done this way, I’ll just say that in order for the statics to be loaded without a server, you need to rewrite the entire project, and it’s also written in angular.js with a terrible routing implementation.
I looked at the cordova.js file, which is included in index.html, and found out where these prompt messages come from.
This is the first message, line: 1002

androidExec.init = function() {
    bridgeSecret = +prompt('', 'gap_init:' + nativeToJsBridgeMode);
    channel.onNativeReady.fire();
};

And this is the second and third message, line: 357
module.exports = {
    exec: function(bridgeSecret, service, action, callbackId, argsJson) {
        return prompt(argsJson, 'gap:'+JSON.stringify([bridgeSecret, service, action, callbackId]));
    },
    setNativeToJsBridgeMode: function(bridgeSecret, value) {
        prompt(value, 'gap_bridge_mode:' + bridgeSecret);
    },
    retrieveJsMessages: function(bridgeSecret, fromOnlineEvent) {
        return prompt(+fromOnlineEvent, 'gap_poll:' + bridgeSecret);
    }
};

Commenting out is not an option, and the only thing I could do was fix the prompt on console.log, which seemed to help on the one hand, but did not fix what all this is required for, the plugins do not work!
Who faced such problem?
It's generally wrong that you need to make such crutches? Obviously there must be a way out of this situation in cordovan ways?
Why do these android functions twitch at all, given that the assembly is carried out on ios?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Gavrilov, 2020-01-09
@vseriousv

The solution turned out to be simple, the cordova.js file that I kept on AWS S3 was configured for android, I had to make a separate bucket with one more static but with cordova.js for iOS.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question