Closed pedroentringer closed 6 years ago
cordova-plugin-advanced-http
specifies v3.10.0 of the urlconnection
module of the OKHTTP library as a Gradle dependency.
This plugin specifies the main okhttp3
module of the library as a Gradle dependency and by default the requested version is v3.+, so will pull in the latest 3.x version which is v3.11.0.
Hence you now have v3.10.0 of the urlconnection
module and v3.11.0 of the okhttp3
module which are probably not compatible, hence your problems.
Fortunately, this plugin enables you to specify the version of the OKHTTP library that will be requested via a plugin variable. By doing so, you should be able to match the version to that requested by the other plugin which should resolve the issue:
cordova plugin add uk.co.workingedge.phonegap.plugin.launchnavigator --variable OKHTTP_VERSION=3.10.0
Since cordova-plugin-advanced-http
has no equivalent way to override the version, if you were to include another plugin in your project which specified a different version of the library, you would have problems again.
Therefore, you should open an issue against cordova-plugin-advanced-http
to request the version of the library be made configurable as it is for this plugin.
@dpa99c perfect! It worked, and you're covered in reason. Thank you!
Love you guys! Thank you so much
cordova-plugin-advanced-http
specifies v3.10.0 of theurlconnection
module of the OKHTTP library as a Gradle dependency.This plugin specifies the main
okhttp3
module of the library as a Gradle dependency and by default the requested version is v3.+, so will pull in the latest 3.x version which is v3.11.0.Hence you now have v3.10.0 of the
urlconnection
module and v3.11.0 of theokhttp3
module which are probably not compatible, hence your problems.Fortunately, this plugin enables you to specify the version of the OKHTTP library that will be requested via a plugin variable. By doing so, you should be able to match the version to that requested by the other plugin which should resolve the issue:
cordova plugin add uk.co.workingedge.phonegap.plugin.launchnavigator --variable OKHTTP_VERSION=3.10.0
Since
cordova-plugin-advanced-http
has no equivalent way to override the version, if you were to include another plugin in your project which specified a different version of the library, you would have problems again. Therefore, you should open an issue againstcordova-plugin-advanced-http
to request the version of the library be made configurable as it is for this plugin.
I tried setting the version like you mentioned, but my app still crashes. I double checked that the expected version for the native HTTP plugin is still 3.10.0, and it is. Do you have any other suggestions?
@Tristan10 check what versions are listed in your build.gradle
for com.squareup.okhttp3
- i.e. check they are all 3.10.0
.
@dpa99c it was still 3.+ in the build.gradle file.
compile "com.squareup.okhttp3:okhttp:3.+"
compile "com.squareup.okhttp3:okhttp-urlconnection:3.10.0"
Shouldn't that automatically update based on what is inside the project's root config.xml? (It won't hurt anything to manually update it in the build.gradle?)
EDIT: Even after updating it in the build.gradle, it seems to get reset to 3.+ when the project is built again.
Even after updating it in the build.gradle, it seems to get reset to 3.+ when the project is built again.
build.gradle
is volatile in Cordova projects - each time you run a Cordova CLI command, any manual changes will get overwritten as Cordova rebuilds it dynamically.
it was still 3.+ in the build.gradle file.
This indicates to me that the plugin variable has not been applied.
If you installed this plugin with:
cordova plugin add uk.co.workingedge.phonegap.plugin.launchnavigator --variable OKHTTP_VERSION=3.10.0
Then in config.xml
I'd expect to see:
<plugin name="uk.co.workingedge.phonegap.plugin.launchnavigator" spec="^4.2.2">
<variable name="OKHTTP_VERSION" value="3.10.0" />
</plugin>
If this is not the case, I'd suggest removing+re-adding the plugin.
In build.gradle
I'd expect to see:
compile "com.squareup.okhttp3:okhttp:3.10.0"
If this is not the case, I'd suggest removing+re-adding the platform.
I'm submitting a ... (check one with "x"):
Bug report
Current behavior: After installing this plugin, no HTTP requests from my application worked. It closes by itself. I removed the plugin and the HTTP requests started working again. I installed it again, and the requisitions stop. How could he resolve this conflict? The plugin used for HTTP requests is cordova-plugin-advanced-http
Environment information
8.1.1 (cordova-lib@8.1.0)
Installed platforms: android 7.1.1
- Runtime issue
Android build issue:
v8.12.0
If using an [Ionic Native Typescript wrapper]() for this plugin: