Closed lokisanhitleson closed 6 years ago
This error is not caused directly by this plugin, but because you now have enough native Android code in your project that it has exceeded the 64k methods in the single dex limit. This is probably indirectly caused by this plugin when it pulls in the OKHTTP library as a dependency - the straw that broke the camel's back.
You can confirm this by Googling the error message, for example this SO question.
The solution, as pointed out in this answer to the above question is to enable multidex mode in the Gradle config which removes the 64k limit.
The easiest way to enable multidex in a Cordova project is via a plugin such as cordova-multidex.
Closing as this plugin is not the direct cause of the issue.
Thanks for your quick response and solution. But, enabling multidex resolves only the error app:transformDexArchiveWithExternalLibsDexMergerForDebug. My app keep crashing at startup when i install this plugin.. I also tried adding below plugin for multidex but no improvements
cordova plugin add --save https://github.com/jwall149/cordova-multidex
My app working fine once I removed launch navigator plugin
If the app is encountering a native crash on startup, you'll need to look at the Android logcat output to determine the cause.
OKHTTP library crashing my app
- 08-21 16:10:46.515 31441 31549 W PluginManager: THREAD WARNING: exec() call to CordovaHttpPlugin.get blocked the main thread for 20ms. Plugin should use CordovaInterface.getThreadPool().
- 08-21 16:10:46.541 31441 31519 D EGL_emulation: eglMakeCurrent: 0xe1603c60: ver 3 0 (tinfo 0xe5594270)
- 08-21 16:10:46.564 31441 31551 E AndroidRuntime: FATAL EXCEPTION: pool-2-thread-3
- 08-21 16:10:46.564 31441 31551 E AndroidRuntime: Process: com.mazelon.xoomdeals, PID: 31441
- 08-21 16:10:46.564 31441 31551 E AndroidRuntime: java.lang.NoSuchMethodError: No virtual method getHttpUrlChecked(Ljava/lang/String;)Lokhttp3/HttpUrl; in class Lokhttp3/internal/Internal; or its super classes (declaration of 'okhttp3.internal.Internal' appears in /data/app/com.mazelon.xoomdeals-ZM12c3U7qD13ZQRi2OnfPA==/base.apk!classes2.dex)
- 08-21 16:10:46.564 31441 31551 E AndroidRuntime: at okhttp3.internal.huc.OkHttpURLConnection.buildCall(OkHttpURLConnection.java:373)
- 08-21 16:10:46.564 31441 31551 E AndroidRuntime: at okhttp3.internal.huc.OkHttpURLConnection.getResponse(OkHttpURLConnection.java:435)
- 08-21 16:10:46.564 31441 31551 E AndroidRuntime: at okhttp3.internal.huc.OkHttpURLConnection.getResponseCode(OkHttpURLConnection.java:491)
- 08-21 16:10:46.564 31441 31551 E AndroidRuntime: at com.github.kevinsawicki.http.HttpRequest.code(HttpRequest.java:1717)
- 08-21 16:10:46.564 31441 31551 E AndroidRuntime: at com.synconset.cordovahttp.CordovaHttp.returnResponseObject(CordovaHttp.java:284)
- 08-21 16:10:46.564 31441 31551 E AndroidRuntime: at com.synconset.cordovahttp.CordovaHttpGet.run(CordovaHttpGet.java:30)
- 08-21 16:10:46.564 31441 31551 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
- 08-21 16:10:46.564 31441 31551 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
- 08-21 16:10:46.564 31441 31551 E AndroidRuntime: at java.lang.Thread.run(Thread.java:764)
- 08-21 16:10:46.590 31441 31579 I Process : Sending signal. PID: 31441 SIG: 9
- 08-21 16:10:46.697 1803 1917 W InputDispatcher: channel 'df6520c com.mazelon.xoomdeals/com.mazelon.xoomdeals.MainActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9
- 08-21 16:10:46.697 1803 1917 E InputDispatcher: channel 'df6520c com.mazelon.xoomdeals/com.mazelon.xoomdeals.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
- 08-21 16:10:46.698 1803 1917 W InputDispatcher: channel 'a6a6874 com.mazelon.xoomdeals/com.mazelon.xoomdeals.MainActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9
- 08-21 16:10:46.698 1803 1917 E InputDispatcher: channel 'a6a6874 com.mazelon.xoomdeals/com.mazelon.xoomdeals.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
- 08-21 16:10:46.702 1803 22304 D ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ LISTEN id=35, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&FOREGROUND Unwanted: Uid: 10082] ], android.os.BinderProxy@7f4dd58)
- 08-21 16:10:46.703 1803 1815 D ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ LISTEN id=34, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&FOREGROUND Unwanted: Uid: 10082] ], android.os.BinderProxy@8c33eb1)
- 08-21 16:10:46.704 1803 8335 I ActivityManager: Process com.mazelon.xoomdeals (pid 31441) has died: fore TOP
- 08-21 16:10:46.705 1803 3512 I WindowManager: WIN DEATH: Window{df6520c u0 com.mazelon.xoomdeals/com.mazelon.xoomdeals.MainActivity}
- 08-21 16:10:46.705 1803 3512 W InputDispatcher: Attempted to unregister already unregistered input channel 'df6520c com.mazelon.xoomdeals/com.mazelon.xoomdeals.MainActivity (server)'
- 08-21 16:10:46.714 1803 1821 W libprocessgroup: kill(-31441, 9) failed: No such process
- 08-21 16:10:46.714 1803 22304 I WindowManager: WIN DEATH: Window{a6a6874 u0 com.mazelon.xoomdeals/com.mazelon.xoomdeals.MainActivity}
- 08-21 16:10:46.714 1803 22304 W InputDispatcher: Attempted to unregister already unregistered input channel 'a6a6874 com.mazelon.xoomdeals/com.mazelon.xoomdeals.MainActivity (server)'
- 08-21 16:10:46.715 1803 8335 W ActivityManager: Force removing ActivityRecord{1deb76 u0 com.mazelon.xoomdeals/.MainActivity t24}: app died, no saved state
- 08-21 16:10:46.720 1651 2259 W SurfaceFlinger: Attempting to destroy on removed layer: AppWindowToken{c72a5e4 token=Token{dbf6577 ActivityRecord{1deb76 u0 com.mazelon.xoomdeals/.MainActivity t24}}}#0
- 08-21 16:10:46.725 1652 1652 I Zygote : Process 31441 exited due to signal (9)
- 08-21 16:10:46.730 1803 8335 I ActivityManager: Killing 31483:com.android.chrome:sandboxed_process0/u0a82i7 (adj 0): isolated not needed
- 08-21 16:10:46.747 29613 31582 V Bugle : Reclaiming memory.
- 08-21 16:10:46.758 1803 1821 W libprocessgroup: kill(-31441, 9) failed: No such process
- 08-21 16:10:46.758 1803 1821 I libprocessgroup: Successfully killed process cgroup uid 10082 pid 31441 in 51ms
- 08-21 16:10:46.758 1803 1821 W libprocessgroup: Failed to open process cgroup uid 99007 pid 31483: No such file or directory
- 08-21 16:10:46.758 1803 1821 E libprocessgroup: Error encountered killing process cgroup uid 99007 pid 31483: No such file or directory
- 08-21 16:10:46.819 2029 2029 I Zygote : Process 31483 exited cleanly (0)
- 08-21 16:10:46.827 1533 1579 D gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 16592896
- 08-21 16:10:46.854 1803 1819 W Looper : Slow dispatch took 141ms android.ui h=com.android.server.am.ActivityManagerService$UiHandler c=null m=53
- 08-21 16:10:46.857 1803 1818 W system_server: Long monitor contention with owner Binder:1803_1A (8335) at void com.android.server.am.ActivityManagerService$AppDeathRecipient.binderDied()(ActivityManagerService.java:1876) waiters=3 in void com.android.server.am.TaskChangeNotificationController$MainHandler.handleMessage(android.os.Message) for 138ms
- 08-21 16:10:46.864 1533 1533 D gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 16592896
- 08-21 16:10:46.884 1803 1822 E KernelCpuSpeedReader: Failed to read cpu-freq: /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state (No such file or directory)
- 08-21 16:10:46.902 1803 1827 W ActivityManager: setHasOverlayUi called on unknown pid: 31441
- 08-21 16:10:46.917 29613 31583 V Bugle : Reclaiming memory.
- 08-21 16:10:46.929 1533 1579 D gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 16592896
- 08-21 16:10:46.963 1651 1651 D SurfaceFlinger: duplicate layer name: changing com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity to com.google.android.apps.nexuslauncher/
Looking at the list of plugins in your project, the most like cause is a conflict between this plugin and cordova-plugin-advanced-http
.
That plugin pins v3.10.0 of the OKHTTP library's urlconnection component while this plugin defaults to v3.+ of the entire library.
Consequently you have a version mismatch between the urlconnection component which is pinned at 3.10.0 and the rest of the library which is pinned at 3.x
A possible solution is to align the version requested by this plugin with that pinned by cordova-plugin-advanced-http
by using the plugin variable at installation:
cordova plugin rm uk.co.workingedge.phonegap.plugin.launchnavigator
cordova plugin add uk.co.workingedge.phonegap.plugin.launchnavigator --variable OKHTTP_VERSION=3.10.0
Thanks man, You made my day. It's now working
👍
I'm submitting a ... (check one with "x"):
[x] bug report
[ ] feature request
[ ] documentation issue
Bug report
Current behavior:
If this plugin added to my ionic project, build fails with app:transformDexArchiveWithExternalLibsDexMergerForDebug error. If plugin removed, then build success
Expected behavior:
Successful build
Steps to reproduce:
I am developing ionic android app with map navigation plugin.. before the navigation plugin, the app working normally. But after installed
the ionic cordova build android command throws below error
So, I ran cordova clean for above error. After that, build is successful. But, app crashing while startup. I didn't receiving any errors in colsole The ionic cordova run android --device -l -c outputs,
No errors in console. How do I need to debug this?
Environment information
Cordova CLI version
cordova -v
: 8.0.0Cordova platform version
cordova platform ls
:Plugins & versions installed in project (including this plugin)
cordova plugin ls
:Dev machine OS and version, e.g.
sw_vers
: ProductName: Mac OS X ProductVersion: 10.13.6 BuildVersion: 17G65Runtime issue
Android build issue:
Node JS version
node -v
: v8.9.4Gradle version
ls platforms/android/.gradle
: 4.1 4.7 buildOutputCleanupTarget Android SDK version
android:targetSdkVersion
inAndroidManifest.xml
:Android SDK details
sdkmanager --list | sed -e '/Available Packages/q'
iOS build issue: Note: Biuld for iOS is successful with this plugin and working properly
Ionic environment info
ionic info
:ionic (Ionic CLI) : 4.1.0 (/usr/local/lib/node_modules/ionic) Ionic Framework : ionic-angular 3.9.2 @ionic/app-scripts : 3.1.10
Cordova:
cordova (Cordova CLI) : 8.0.0 Cordova Platforms : android 7.1.1 Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 1.2.1, (and 13 other plugins)
System:
Android SDK Tools : 26.1.1 ios-deploy : 1.9.2 NodeJS : v8.9.4 (/usr/local/bin/node) npm : 6.1.0 OS : macOS High Sierra Xcode : Xcode 9.4.1 Build version 9F2000
Environment:
ANDROID_HOME : /Users/mazelon/Library/Android/sdk