Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

Phonegap IOS Version 4.01 compile errorerror: no visible @interface for 'UIView' declares the selector 'loadRequest:' #109

Closed
qz2rg4 opened this issue Feb 25, 2016 · 16 comments

Comments

@qz2rg4
Copy link

qz2rg4 commented Feb 25, 2016

CompileC build/ArcApp.build/Release-iphoneos/ArcApp.build/Objects-normal/armv7/HCPPlugin.o ArcApp/Plugins/cordova-hot-code-push-plugin/HCPPlugin.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    cd /project
    export LANG=en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch armv7 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=c99 -fobjc-arc -fmodules -gmodules -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/var/folders/m1/wl3zc68x40z6cn12m764qkf80000gn/C/org.llvm.clang/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wno-trigraphs -fpascal-strings -Os -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-implicit-atomic-properties -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -miphoneos-version-min=8.0 -g -fvisibility=hidden -Wno-sign-conversion -iquote /project/build/ArcApp.build/Release-iphoneos/ArcApp.build/ArcApp-generated-files.hmap -I/project/build/ArcApp.build/Release-iphoneos/ArcApp.build/ArcApp-own-target-headers.hmap -I/project/build/ArcApp.build/Release-iphoneos/ArcApp.build/ArcApp-all-target-headers.hmap -iquote /project/build/ArcApp.build/Release-iphoneos/ArcApp.build/ArcApp-project-headers.hmap -I/project/build/include -I/project/build/usr/local/lib/include -I/project/build/UninstalledProducts/include -I/project/build/UninstalledProducts/iphoneos/include -I/project/build -I/project/build/ArcApp.build/Release-iphoneos/ArcApp.build/DerivedSources/armv7 -I/project/build/ArcApp.build/Release-iphoneos/ArcApp.build/DerivedSources -F/project/build -include /var/folders/m1/wl3zc68x40z6cn12m764qkf80000gn/C/com.apple.DeveloperTools/7.1-7B91b/Xcode/SharedPrecompiledHeaders/ArcApp-Prefix-cluaitwfxxbhlsalelkgkkvnkghy/ArcApp-Prefix.pch -MMD -MT dependencies -MF /project/build/ArcApp.build/Release-iphoneos/ArcApp.build/Objects-normal/armv7/HCPPlugin.d --serialize-diagnostics /project/build/ArcApp.build/Release-iphoneos/ArcApp.build/Objects-normal/armv7/HCPPlugin.dia -c /project/ArcApp/Plugins/cordova-hot-code-push-plugin/HCPPlugin.m -o /project/build/ArcApp.build/Release-iphoneos/ArcApp.build/Objects-normal/armv7/HCPPlugin.o
/project/ArcApp/Plugins/cordova-hot-code-push-plugin/HCPPlugin.m:244:23: error: no visible @interface for 'UIView' declares the selector 'loadRequest:'
        [self.webView loadRequest:request];
         ~~~~~~~~~~~~ ^~~~~~~~~~~
1 error generated.

Thanks in advance. This was working in version 5.. but is not working on phonegap/cordova 6.0.0 .

@nikDemyankov
Copy link
Member

Strange... will check it, thanks.

@nikDemyankov nikDemyankov added bug and removed bug labels Feb 25, 2016
@nikDemyankov
Copy link
Member

Did you run cordova build ios after updating to new cordova version? In iOS version of the plugin there are lines like these:

#if HCP_CORDOVA_VERSION >= 4
      [self.webViewEngine loadRequest:request];
#else
        [self.webView loadRequest:request];
#endif

Which means, that if we are running on cordova iOS v4 - use new API to load page. Otherwise - use old API. HCP_CORDOVA_VERSION constant is defined in HCPPlugin.h, and it's putted there by plugin's JS hook.

So if HCP_CORDOVA_VERSION is set to 3, then you should either run cordova build ios from console before doing so from Xcode, or just manually change it to 4.

@qz2rg4
Copy link
Author

qz2rg4 commented Feb 25, 2016

Hi Thanks.

This is a phonegap build. I don’t have access mac to do the compilation myself.

PhoneGap (iOS / Android / Windows)
cli-6.0.0 (4.0.1 / 5.1.0 / 4.3.0)

Here is the build log

https://build.phonegap.com/apps/1717219/logs/ios/build/

Thanks

From: Nikolay Demyankov [mailto:[email protected]]
Sent: Thursday, 25 February 2016 12:29 PM
To: nordnet/cordova-hot-code-push [email protected]
Cc: Anton Oosthuizen [email protected]
Subject: Re: [cordova-hot-code-push] Phonegap IOS Version 4.01 compile errorerror: no visible @interface for 'UIView' declares the selector 'loadRequest:' (#109)

Did you run cordova build ios after updating to new cordova version? In iOS version of the plugin there are lines like these:

#if HCP_CORDOVA_VERSION >= 4

  [self.webViewEngine loadRequest:request];

#else

    [self.webView loadRequest:request];

#endif

Which means, that if we are running on cordova iOS v4 - use new API to load page. Otherwise - use old API. HCP_CORDOVA_VERSION constant is defined in HCPPlugin.h, and it's putted there by plugin's JS hook.

So if HCP_CORDOVA_VERSION is set to 3, then you should either run cordova build ios from console before doing so from Xcode, or just manually change it to 4.


Reply to this email directly or view it on GitHubhttps://github.com//issues/109#issuecomment-188711508.

@nikDemyankov nikDemyankov added this to the v1.3.0 milestone Feb 25, 2016
@nikDemyankov
Copy link
Member

Ah, okey. Well, PGB doesn't support cordova hooks. That's why you are getting this error. Since cordova CLI v6.0 is out and it's using iOS v4 by default - I will change HCP_CORDOVA_VERSION default value to 4.

As a temporary workaround you can fork this repo and change this manually here. And then for PGB provide url to your forked repo on the github.

@qz2rg4
Copy link
Author

qz2rg4 commented Feb 25, 2016

Thanks. Quick question do I reference the forked repository URL provided by Github? Will PGB know what to do with this?

From: Nikolay Demyankov [mailto:[email protected]]
Sent: Thursday, 25 February 2016 12:52 PM
To: nordnet/cordova-hot-code-push [email protected]
Cc: Anton Oosthuizen [email protected]
Subject: Re: [cordova-hot-code-push] Phonegap IOS Version 4.01 compile errorerror: no visible @interface for 'UIView' declares the selector 'loadRequest:' (#109)

Ah, okey. Well, PGB doesn't support cordova hooks. That's why you are getting this error. Since cordova CLI v6.0 is out and it's using iOS v4 by default - I will change HCP_CORDOVA_VERSION default value to 4.

As a temporary workaround you can fork this repo and change this manually herehttps://github.com/nordnet/cordova-hot-code-push/blob/master/src/ios/HCPPlugin.h#L11. And then for PGB provide url to your forked repo on the github.


Reply to this email directly or view it on GitHubhttps://github.com//issues/109#issuecomment-188724442.

@nikDemyankov
Copy link
Member

I think it should accept github url. For example - https://github.com/nordnet/cordova-hot-code-push.git. You can try :)

@qz2rg4
Copy link
Author

qz2rg4 commented Feb 25, 2016

Sorry to bother again. But doing a git build gives me the following

Fetching plugin "https://github.com/Interon/cordova-hot-code-push.git" via git clone
Repository "https://github.com/Interon/cordova-hot-code-push.git" checked out to git ref "master".
Installing "[email protected]" for ios
"plugman install --platform ios --project /tmp/gimlet/1717219/project --plugin ": Cannot find plugin.xml for plugin 'plugins'. Please try adding it again.

From: Nikolay Demyankov [mailto:[email protected]]
Sent: Thursday, 25 February 2016 12:52 PM
To: nordnet/cordova-hot-code-push [email protected]
Cc: Anton Oosthuizen [email protected]
Subject: Re: [cordova-hot-code-push] Phonegap IOS Version 4.01 compile errorerror: no visible @interface for 'UIView' declares the selector 'loadRequest:' (#109)

Ah, okey. Well, PGB doesn't support cordova hooks. That's why you are getting this error. Since cordova CLI v6.0 is out and it's using iOS v4 by default - I will change HCP_CORDOVA_VERSION default value to 4.

As a temporary workaround you can fork this repo and change this manually herehttps://github.com/nordnet/cordova-hot-code-push/blob/master/src/ios/HCPPlugin.h#L11. And then for PGB provide url to your forked repo on the github.


Reply to this email directly or view it on GitHubhttps://github.com//issues/109#issuecomment-188724442.

@nikDemyankov
Copy link
Member

Try to look into PGB documentation on how to add plugins from git. My guess is that it should be something like this:

<plugin spec="https://github.com/Interon/cordova-hot-code-push.git" source="git" />

Or this is what you have?

@qz2rg4
Copy link
Author

qz2rg4 commented Feb 25, 2016

Yip that is exactly what I have and the docs are vague pertaining this . The funny thing is it compiles for android.

@nikDemyankov
Copy link
Member

It should compile fine for android, since it doesn't have a hook, like iOS does. And iOS has it, because cordova has changed their API.

What seems really strange is that line in your logs:

"plugman install --platform ios --project /tmp/gimlet/1717219/project --plugin ": Cannot find plugin.xml for plugin 'plugins'. Please try adding it again.

What plugin plugins? Either there is a typo in your config.xml, or some bug in PGB. Maybe write to their support and ask, what is wrong? Your git repo with plugin does have a plugin.xml.

Another way to go - you can search for how to define, which platform version of ios cordova to install. Right now PGB installs the latest one, but via CLI you can install any. For example, v3.9.2:

cordova platform add [email protected]

In that case you can use plugin without any changes.

Theoretically, I can publish tomorrow v1.2.6 with just changing default value of HCP_CORDOVA_VERSION from 3 to 4. This should be fine also for people, who are using older version of cordova and can execute JS hooks: plugin's hook will handle this properly. Those who can't most likely are using some external solution, that should migrate to the newer version of cordova.

@qz2rg4
Copy link
Author

qz2rg4 commented Feb 25, 2016

Genius!!
I duplicated the line in the config.xml with a typo that is why it compiled and then threw an error.

When ever you in South Africa, beer is on me.

Thanks again.

@nikDemyankov
Copy link
Member

Glad to help :) Will close the issue later.

@ashelley
Copy link

@nikDemyankov just curious do you have a time frame in which you expect to release 1.2.6 with this fix?

ashelley added a commit to ashelley/cordova-hot-code-push that referenced this issue Mar 15, 2016
@nikDemyankov
Copy link
Member

@ashelley I wanted to release this with v1.3.0 when it is done. Not sure, that this will be soon. But if needed - can release v1.2.6 with only that fix in it.

@ashelley
Copy link

I'm not sure if it matters. I just started this using this plugin and have been doing my dev on android. However to get ios working I had to use my own private fork with the patch to change the default HCP_CORDOVA_VERSION to 4. It may be of no consequence I was just looking for clarification so that I can explain to my colleagues as to why I was using my own fork vs the official plugin repo. Thanks for this plugin though it's working great otherwise!

[EDIT]

The reason I ran into this issue was I believe the default cordova version is 6.0.0 now. (Not using phonegap)

@nikDemyankov
Copy link
Member

Fixed in v1.2.6. By default HCP_CORDOVA_VERSION is set to 4.

@nikDemyankov nikDemyankov removed this from the v1.3.0 milestone Apr 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants