dpa99c / phonegap-launch-navigator

Phonegap/Cordova plugin which launches native route navigation apps for Android, iOS and Windows
369 stars 131 forks source link

[Android] OkHttp conflict when using Crosswalk Webview #117

Closed chancezeus closed 7 years ago

chancezeus commented 7 years ago

I came across a "multiple dex files define" error when compiling an app integrating both the latest version of this plugin and the cordova-plugin-crosswalk-webview, related to the OkHttp library. Please investigate and fix/update, since the crosswalk webview is required/used by a lot of cordova app's...

dpa99c commented 7 years ago

I'm unable to reproduce this issue: adding the latest version of cordova-plugin-crosswalk-webview to on of the projects in the example repo builds fine (see build output below). Please try doing the same and building one of the example projects with cordova-plugin-crosswalk-webview to confirm this.

From the Gradle output, I can see that crosswalk no longer explicitly includes a specific version of okhttp so I wonder if this is really the cause of your error? Check that you don't have any other additional plugins in your own project which reference specific versions of the okhttp library. There are some plugins which pin specific versions of the library and these will collide with this plugin which only pins the major version to 3 (which is still the most recent major version). If another plugin is the cause, you will need to manually fix the version clash in the build.gradle file.

build output ``` $cd phonegap-launch-navigator-example/SimpleExample $ cordova plugin add cordova-plugin-crosswalk-webview Fetching plugin "cordova-plugin-crosswalk-webview@2.3.0" via npm $ cordova plugin ls cordova-plugin-actionsheet 2.3.3 "ActionSheet" cordova-plugin-crosswalk-webview 2.3.0 "Crosswalk WebView Engine" cordova-plugin-dialogs 1.3.2 "Notification" uk.co.workingedge.phonegap.plugin.launchnavigator 3.2.1 "Launch Navigator" $ cordova platform add android Adding android project... Creating Cordova project for the Android platform: Path: platforms\android Package: workingedge.example.launchnavigator.simple Name: Launch_Navigator_Simple_Example Activity: MainActivity Android target: android-25 Subproject Path: CordovaLib Android project created with cordova-android@6.1.2 Installing "cordova-plugin-crosswalk-webview" for android Subproject Path: CordovaLib After much discussion and analysis of the market, we have decided to discontinue support for Android 4.0 (ICS) in Crosswalk starting with version 20. So the minSdkVersion of Cordova project is configured to 16 by default. Installing "uk.co.workingedge.phonegap.plugin.launchnavigator" for android Fetching plugin "cordova-plugin-actionsheet" via npm Installing "cordova-plugin-actionsheet" for android Subproject Path: CordovaLib Discovered plugin "cordova-plugin-dialogs" in config.xml. Adding it to the project Fetching plugin "cordova-plugin-dialogs@1" via npm Installing "cordova-plugin-dialogs" for android $ cordova build android ANDROID_HOME=C:\Users\Admin\AppData\Local\Android\sdk JAVA_HOME=C:\Program Files\Java\jdk1.8.0_101 Subproject Path: CordovaLib Starting a Gradle Daemon, 2 stopped Daemons could not be reused, use --status for details Parallel execution with configuration on demand is an incubating feature. null The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead. at build_zhsaog00pswqeu7kpiii0f0g.run(D:\Git\phonegap-launch-navigator-example\SimpleExample\platforms\android\build.gradle:138) org.xwalk:xwalk_core_library:23+ Observed package id 'build-tools;25.0.2' in inconsistent location 'C:\Users\Admin\AppData\Local\Android\sdk\build-tools\current' (Expected 'C:\Users\Admin\AppData\Local\Android\sdk\build-tools\25.0.2') Already observed package id 'build-tools;25.0.2' in 'C:\Users\Admin\AppData\Local\Android\sdk\build-tools\25.0.2'. Skipping duplicate at 'C:\Users\Admin\AppData\Local\Android\sdk\build-tools\current' Observed package id 'tools' in inconsistent location 'C:\Users\Admin\AppData\Local\Android\sdk\tools@old' (Expected 'C:\Users\Admin\AppData\Local\Android\sdk\tools') Already observed package id 'tools' in 'C:\Users\Admin\AppData\Local\Android\sdk\tools'. Skipping duplicate at 'C:\Users\Admin\AppData\Local\Android\sdk\tools@old' Observed package id 'build-tools;25.0.2' in inconsistent location 'C:\Users\Admin\AppData\Local\Android\sdk\build-tools\current' (Expected 'C:\Users\Admin\AppData\Local\Android\sdk\build-tools\25.0.2') Already observed package id 'build-tools;25.0.2' in 'C:\Users\Admin\AppData\Local\Android\sdk\build-tools\25.0.2'. Skipping duplicate at 'C:\Users\Admin\AppData\Local\Android\sdk\build-tools\current' Observed package id 'tools' in inconsistent location 'C:\Users\Admin\AppData\Local\Android\sdk\tools@old' (Expected 'C:\Users\Admin\AppData\Local\Android\sdk\tools') Already observed package id 'tools' in 'C:\Users\Admin\AppData\Local\Android\sdk\tools'. Skipping duplicate at 'C:\Users\Admin\AppData\Local\Android\sdk\tools@old' The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0. The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead. The ProjectDependency.getProjectConfiguration() method has been deprecated and is scheduled to be removed in Gradle 4.0. ModuleDependency.getConfiguration() has been deprecated and is scheduled to be removed in Gradle 4.0. Use ModuleDependency.getTargetConfiguration() instead. Download https://download.01.org/crosswalk/releases/crosswalk/android/maven2/org/xwalk/xwalk_core_library/23.53.589.4/xwalk_core_library-23.53.589.4.pom Download https://download.01.org/crosswalk/releases/crosswalk/android/maven2/org/xwalk/xwalk_core_library/23.53.589.4/xwalk_core_library-23.53.589.4.aar :preBuild :CordovaLib:preBuild UP-TO-DATE :preBuild UP-TO-DATE :CordovaLib:preDebugBuild UP-TO-DATE :preArmv7DebugBuild UP-TO-DATE :CordovaLib:checkDebugManifest :checkArmv7DebugManifest :preX86DebugBuild UP-TO-DATE :preArmv7ReleaseBuild UP-TO-DATE :preX86ReleaseBuild UP-TO-DATE :generateArmv7DebugBuildConfig :CordovaLib:prepareDebugDependencies :CordovaLib:compileDebugAidl :mergeArmv7DebugShaders :CordovaLib:compileDebugNdk NO-SOURCE :CordovaLib:compileLint :CordovaLib:copyDebugLint NO-SOURCE :CordovaLib:mergeDebugShaders :compileArmv7DebugShaders :CordovaLib:compileDebugShaders :CordovaLib:generateDebugAssets :generateArmv7DebugAssets :CordovaLib:mergeDebugAssets :generateArmv7DebugResValues :incrementalArmv7DebugJavaCompilationSafeguard :CordovaLib:mergeDebugProguardFiles :CordovaLib:packageDebugRenderscript NO-SOURCE :CordovaLib:compileDebugRenderscript :compileArmv7DebugNdk NO-SOURCE :processArmv7DebugJavaRes NO-SOURCE :validateSigningArmv7Debug :checkX86DebugManifest :generateX86DebugBuildConfig :CordovaLib:generateDebugResValues :mergeX86DebugShaders :CordovaLib:generateDebugResources :CordovaLib:packageDebugResources :compileX86DebugShaders :generateX86DebugAssets :generateX86DebugResValues :incrementalX86DebugJavaCompilationSafeguard :compileX86DebugNdk NO-SOURCE :processX86DebugJavaRes NO-SOURCE :validateSigningX86Debug :CordovaLib:processDebugManifest :CordovaLib:generateDebugBuildConfig :CordovaLib:processDebugResources :CordovaLib:generateDebugSources :CordovaLib:incrementalDebugJavaCompilationSafeguard :CordovaLib:compileDebugJavaWithJavac :CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.). Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. :CordovaLib:processDebugJavaRes NO-SOURCE :CordovaLib:transformResourcesWithMergeJavaResForDebug :CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug :CordovaLib:mergeDebugJniLibFolders :CordovaLib:transformNative_libsWithMergeJniLibsForDebug :CordovaLib:transformNative_libsWithSyncJniLibsForDebug :CordovaLib:bundleDebug :prepareAndroidCordovaLibUnspecifiedDebugLibrary :CordovaLib:preReleaseBuild UP-TO-DATE :CordovaLib:checkReleaseManifest :CordovaLib:prepareReleaseDependencies :CordovaLib:compileReleaseAidl :CordovaLib:compileReleaseNdk NO-SOURCE :CordovaLib:copyReleaseLint NO-SOURCE :CordovaLib:mergeReleaseShaders :CordovaLib:compileReleaseShaders :CordovaLib:generateReleaseAssets :CordovaLib:mergeReleaseAssets :CordovaLib:mergeReleaseProguardFiles :CordovaLib:packageReleaseRenderscript NO-SOURCE :CordovaLib:compileReleaseRenderscript :CordovaLib:generateReleaseResValues :CordovaLib:generateReleaseResources :CordovaLib:packageReleaseResources :CordovaLib:processReleaseManifest :CordovaLib:generateReleaseBuildConfig :CordovaLib:processReleaseResources :CordovaLib:generateReleaseSources :CordovaLib:incrementalReleaseJavaCompilationSafeguard :CordovaLib:compileReleaseJavaWithJavac :CordovaLib:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.). Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. :CordovaLib:processReleaseJavaRes NO-SOURCE :CordovaLib:transformResourcesWithMergeJavaResForRelease :CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease :CordovaLib:mergeReleaseJniLibFolders :CordovaLib:transformNative_libsWithMergeJniLibsForRelease :CordovaLib:transformNative_libsWithSyncJniLibsForRelease :CordovaLib:bundleRelease :prepareComAndroidSupportSupportCompat2520Library :prepareComAndroidSupportSupportCoreUi2520Library :prepareComAndroidSupportSupportCoreUtils2520Library :prepareComAndroidSupportSupportFragment2520Library :prepareComAndroidSupportSupportMediaCompat2520Library :prepareComAndroidSupportSupportV42520Library :prepareOrgXwalkXwalk_core_library23535894Library :prepareArmv7DebugDependencies :compileArmv7DebugAidl :compileArmv7DebugRenderscript :mergeArmv7DebugAssets :createXwalkCommandLineFileArmv7Debug :generateArmv7DebugResources :mergeArmv7DebugResources :processArmv7DebugManifest :processArmv7DebugResources :generateArmv7DebugSources :compileArmv7DebugJavaWithJavac :compileArmv7DebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.). Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. :compileArmv7DebugSources :transformClassesWithDexForArmv7Debug :mergeArmv7DebugJniLibFolders :transformNative_libsWithMergeJniLibsForArmv7Debug :transformResourcesWithMergeJavaResForArmv7Debug :packageArmv7Debug :assembleArmv7Debug :prepareX86DebugDependencies :compileX86DebugAidl :compileX86DebugRenderscript :mergeX86DebugAssets :createXwalkCommandLineFileX86Debug :generateX86DebugResources :mergeX86DebugResources :processX86DebugManifest :processX86DebugResources :generateX86DebugSources :compileX86DebugJavaWithJavac :compileX86DebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.). Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. :compileX86DebugSources :transformClassesWithDexForX86Debug :mergeX86DebugJniLibFolders :transformNative_libsWithMergeJniLibsForX86Debug :transformResourcesWithMergeJavaResForX86Debug :packageX86Debug :assembleX86Debug :assembleDebug :cdvBuildDebug BUILD SUCCESSFUL Total time: 1 mins 23.314 secs Built the following apk(s): D:/Git/phonegap-launch-navigator-example/SimpleExample/platforms/android/build/outputs/apk/android-armv7-debug.apk D:/Git/phonegap-launch-navigator-example/SimpleExample/platforms/android/build/outputs/apk/android-x86-debug.apk Crosswalk info: After much discussion and analysis of the market, we have decided to discontinue support for Android 4.0 (ICS) in Crosswalk starting with version 20, so the minSdkVersion of Cordova project is configured to 16 by default. $ ```