ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
https://capacitorjs.com
MIT License
11.47k stars 977 forks source link

bug: Android app won't load for NuxtJS (VueJS) apps [Solution found] #3111

Closed retedys closed 4 years ago

retedys commented 4 years ago

Bug Report

Capacitor Version

💊   Capacitor Doctor  💊 

Latest Dependencies:
  @capacitor/cli: 2.2.0
  @capacitor/core: 2.2.0
  @capacitor/android: 2.2.0
  @capacitor/electron: 2.2.0
  @capacitor/ios: 2.2.0

Installed Dependencies:
  @capacitor/electron not installed
  @capacitor/cli 2.2.0
  @capacitor/android 2.2.0
  @capacitor/ios 2.2.0
  @capacitor/core 2.2.0

[success] Android looking great! 👌
  Found 3 Capacitor plugins for ios:
    capacitor-firebase-analytics (0.3.2)
    cordova-plugin-cleartext (1.0.0)
    cordova-plugin-vibration (3.1.1)
[success] iOS looking great! 👌

Platform

Android

Current Behavior

But if I run it without any server options, the app won't run at all. Following is the debug log and I've been stuck here since hours. Please help.

Expected Behavior

Code Reproduction

Other Technical Details

npm --version output: 6.11.2

node --version output: v10.15.3

Additional Context

06/16 04:31:12: Launching 'app' on Pixel 2 API R.
$ adb shell am start -n "com.fambola.fambola/com.fambola.fambola.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Waiting for application to come online: com.fambola.fambola | com.fambola.fambola.test
Waiting for application to come online: com.fambola.fambola | com.fambola.fambola.test
Connected to process 28469 on device 'emulator-5554'.
Connecting to com.fambola.fambola
Connected to the target VM, address: 'localhost:8602', transport: 'socket'
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/fambola.fambol: Not late-enabling -Xcheck:jni (already on)
I/fambola.fambol: Unquickening 12 vdex files!
W/fambola.fambol: Unexpected CPU variant for X86 using defaults: x86
W/ActivityThread: Application com.fambola.fambola is waiting for the debugger on port 8100...
I/System.out: Sending WAIT chunk
W/fambola.fambol: Suspending all threads took: 22.528ms
I/System.out: Debugger has connected
I/System.out: waiting for debugger to settle...
I/chatty: uid=10150(com.fambola.fambola) identical 1 line
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/chatty: uid=10150(com.fambola.fambola) identical 7 lines
I/System.out: waiting for debugger to settle...
I/System.out: debugger has settled (1423)
I/fambola.fambol: The ClassLoaderContext is a special shared library.
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
W/FirebaseApp: Default FirebaseApp failed to initialize because no default options were found. This usually means that com.google.gms:google-services was not applied to your gradle project.
I/FirebaseInitProvider: FirebaseApp initialization unsuccessful
D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
E/fambola.fambol: Invalid ID 0x00000000.
W/fambola.fambol: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
W/fambola.fambol: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
I/WebViewFactory: Loading com.google.android.webview version 83.0.4099.5 (code 409900581)
I/fambola.fambol: The ClassLoaderContext is a special shared library.
I/fambola.fambol: The ClassLoaderContext is a special shared library.
E/fambola.fambol: Invalid ID 0x00000000.
E/fambola.fambol: Invalid ID 0x00000000.
I/cr_LibraryLoader: Loaded native library version number "83.0.4099.5"
I/cr_CachingUmaRecorder: Flushed 3 samples from 3 histograms.
W/fambola.fambol: Accessing hidden method Llibcore/io/Memory;->peekLong(JZ)J (greylist, reflection, allowed)
    Accessing hidden method Llibcore/io/Memory;->pokeLong(JJZ)V (greylist, reflection, allowed)
W/fambola.fambol: Accessing hidden method Llibcore/io/Memory;->pokeInt(JIZ)V (greylist, reflection, allowed)
    Accessing hidden method Llibcore/io/Memory;->peekInt(JZ)I (greylist, reflection, allowed)
    Accessing hidden method Llibcore/io/Memory;->pokeByte(JB)V (greylist, reflection, allowed)
    Accessing hidden method Llibcore/io/Memory;->peekByte(J)B (greylist, reflection, allowed)
    Accessing hidden method Llibcore/io/Memory;->pokeByteArray(J[BII)V (greylist, reflection, allowed)
    Accessing hidden method Llibcore/io/Memory;->peekByteArray(J[BII)V (greylist, reflection, allowed)
W/fambola.fambol: Accessing hidden method Lsun/misc/Unsafe;->objectFieldOffset(Ljava/lang/reflect/Field;)J (greylist,core-platform-api, reflection, allowed)
W/fambola.fambol: Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, reflection, allowed)
    Accessing hidden field Ljava/nio/Buffer;->address:J (greylist, reflection, allowed)
W/fambola.fambol: Accessing hidden method Lsun/misc/Unsafe;->arrayBaseOffset(Ljava/lang/Class;)I (greylist,core-platform-api, reflection, allowed)
    Accessing hidden method Lsun/misc/Unsafe;->arrayIndexScale(Ljava/lang/Class;)I (greylist,core-platform-api, reflection, allowed)
    Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist,core-platform-api, reflection, allowed)
    Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist,core-platform-api, reflection, allowed)
    Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, reflection, allowed)
    Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist,core-platform-api, reflection, allowed)
    Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist,core-platform-api, reflection, allowed)
    Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist,core-platform-api, reflection, allowed)
I/TetheringManager: registerTetheringEventCallback:com.fambola.fambola
D/Capacitor: Starting BridgeActivity
D/Capacitor: Registering plugin: App
D/Capacitor: Registering plugin: Accessibility
D/Capacitor: Registering plugin: BackgroundTask
D/Capacitor: Registering plugin: Browser
D/Capacitor: Registering plugin: Camera
D/Capacitor: Registering plugin: Clipboard
D/Capacitor: Registering plugin: Device
D/Capacitor: Registering plugin: LocalNotifications
D/Capacitor: Registering plugin: Filesystem
D/Capacitor: Registering plugin: Geolocation
D/Capacitor: Registering plugin: Haptics
D/Capacitor: Registering plugin: Keyboard
D/Capacitor: Registering plugin: Modals
D/Capacitor: Registering plugin: Network
D/Capacitor: Registering plugin: Permissions
D/Capacitor: Registering plugin: Photos
D/Capacitor: Registering plugin: PushNotifications
D/Capacitor: Registering plugin: Share
D/Capacitor: Registering plugin: SplashScreen
D/Capacitor: Registering plugin: StatusBar
D/Capacitor: Registering plugin: Storage
D/Capacitor: Registering plugin: Toast
D/Capacitor: Registering plugin: WebView
D/Capacitor: Loading app at http://localhost
W/fambola.fambol: Accessing hidden method Landroid/media/AudioManager;->getOutputLatency(I)I (greylist, reflection, allowed)
D/HostConnection: HostConnection::get() New Host Connection established 0xeea34f90, tid 28553
W/cr_media: Requires BLUETOOTH permission
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_0 
D/EGL_emulation: eglCreateContext: 0xee823080: maj 3 min 0 rcv 3
D/EGL_emulation: eglMakeCurrent: 0xee823080: ver 3 0 (tinfo 0xc03ef250)
D/Capacitor/LN: LocalNotification received: null
D/Capacitor/LN: Activity started without notification attached
D/Capacitor: App started
D/Capacitor/App: Firing change: true
V/Capacitor/App: Notifying listeners for event appStateChange
D/Capacitor/App: No listeners found for event appStateChange
D/Capacitor: App resumed
I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
D/Capacitor: Handling local request: http://localhost/
W/cr_MediaCodecUtil: HW encoder for video/avc is not available on this device.
D/EGL_emulation: eglCreateContext: 0xee8075c0: maj 3 min 0 rcv 3
    eglMakeCurrent: 0xee8075c0: ver 3 0 (tinfo 0xc03ef250)
E/eglCodecCommon: glUtilsParamSize: unknow param 0x000088ef
I/chatty: uid=10150(com.fambola.fambola) Chrome_InProcGp identical 10 lines
E/eglCodecCommon: glUtilsParamSize: unknow param 0x000088ef
D/Capacitor: Handling local request: http://localhost/_nuxt/2891cf4e45768b33369a.js
D/Capacitor: Handling local request: http://localhost/_nuxt/4ab03b77e8c4222b551a.js
D/Capacitor: Handling local request: http://localhost/_nuxt/a858dd294eb2565fc979.js
D/Capacitor: Handling local request: http://localhost/_nuxt/b5cece7548d758f9dc6c.js
D/HostConnection: HostConnection::get() New Host Connection established 0xbbfc2470, tid 28505
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_0 
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/EGL_emulation: eglCreateContext: 0xee822050: maj 3 min 0 rcv 3
    eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
I/Gralloc4: mapper 4.x is not supported
D/HostConnection: createUnique: call
D/HostConnection: HostConnection::get() New Host Connection established 0xbbfc1570, tid 28505
D/eglCodecCommon: allocate: Ask for block of size 0x100
    allocate: ioctl allocate returned offset 0x3fdec9000 size 0x2000
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_0 
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
E/eglCodecCommon: glUtilsParamSize: unknow param 0x000088ef
    glUtilsParamSize: unknow param 0x000088ef
E/Capacitor: Unable to open asset URL: http://localhost/_nuxt/a858dd294eb2565fc979.js
E/Capacitor: Unable to open asset URL: http://localhost/_nuxt/4ab03b77e8c4222b551a.js
E/Capacitor: Unable to open asset URL: http://localhost/_nuxt/a858dd294eb2565fc979.js
E/Capacitor: Unable to open asset URL: http://localhost/_nuxt/4ab03b77e8c4222b551a.js
E/Capacitor: Unable to open asset URL: http://localhost/_nuxt/2891cf4e45768b33369a.js
E/Capacitor: Unable to open asset URL: http://localhost/_nuxt/a858dd294eb2565fc979.js
E/Capacitor: Unable to open asset URL: http://localhost/_nuxt/b5cece7548d758f9dc6c.js
E/Capacitor: Unable to open asset URL: http://localhost/_nuxt/4ab03b77e8c4222b551a.js
E/Capacitor: Unable to open asset URL: http://localhost/_nuxt/2891cf4e45768b33369a.js
E/Capacitor: Unable to open asset URL: http://localhost/_nuxt/2891cf4e45768b33369a.js
E/Capacitor: Unable to open asset URL: http://localhost/_nuxt/b5cece7548d758f9dc6c.js
E/Capacitor: Unable to open asset URL: http://localhost/_nuxt/b5cece7548d758f9dc6c.js
V/Capacitor/Network: Notifying listeners for event networkStatusChange
D/Capacitor/Network: No listeners found for event networkStatusChange
I/Capacitor/Console: File: capacitor-runtime.js - Line 2397 - Msg: onscript loading complete
D/Capacitor: Handling local request: http://localhost/_nuxt/a858dd294eb2565fc979.js
E/Capacitor: Unable to open asset URL: http://localhost/_nuxt/a858dd294eb2565fc979.js
E/Capacitor: Unable to open asset URL: http://localhost/_nuxt/a858dd294eb2565fc979.js
E/Capacitor: Unable to open asset URL: http://localhost/_nuxt/a858dd294eb2565fc979.js
D/Capacitor: Handling local request: http://localhost/_nuxt/2891cf4e45768b33369a.js
E/Capacitor: Unable to open asset URL: http://localhost/_nuxt/2891cf4e45768b33369a.js
E/Capacitor: Unable to open asset URL: http://localhost/_nuxt/2891cf4e45768b33369a.js
E/Capacitor: Unable to open asset URL: http://localhost/_nuxt/2891cf4e45768b33369a.js
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
I/chatty: uid=10150(com.fambola.fambola) RenderThread identical 1 line
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/Capacitor: Handling local request: http://localhost/_nuxt/b5cece7548d758f9dc6c.js
E/Capacitor: Unable to open asset URL: http://localhost/_nuxt/b5cece7548d758f9dc6c.js
E/Capacitor: Unable to open asset URL: http://localhost/_nuxt/b5cece7548d758f9dc6c.js
E/Capacitor: Unable to open asset URL: http://localhost/_nuxt/b5cece7548d758f9dc6c.js
D/Capacitor: Handling local request: http://localhost/favicon.ico
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
I/chatty: uid=10150(com.fambola.fambola) RenderThread identical 345 lines
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
I/chatty: uid=10150(com.fambola.fambola) RenderThread identical 2 lines
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
I/chatty: uid=10150(com.fambola.fambola) RenderThread identical 10 lines
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
I/chatty: uid=10150(com.fambola.fambola) RenderThread identical 2 lines
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
I/chatty: uid=10150(com.fambola.fambola) RenderThread identical 396 lines
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
I/chatty: uid=10150(com.fambola.fambola) RenderThread identical 64 lines
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
I/chatty: uid=10150(com.fambola.fambola) RenderThread identical 4 lines
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
I/chatty: uid=10150(com.fambola.fambola) RenderThread identical 72 lines
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
D/Capacitor: SplashScreen was automatically hidden after the launch timeout. You should call `SplashScreen.hide()` as soon as your web app is loaded (or increase the timeout).Read more at https://capacitor.ionicframework.com/docs/apis/splash-screen/#hiding-the-splash-screen
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
I/chatty: uid=10150(com.fambola.fambola) RenderThread identical 36 lines
D/EGL_emulation: eglMakeCurrent: 0xee822050: ver 3 0 (tinfo 0xc03fb330)
retedys commented 4 years ago

Apparently, Cordova (or maybe even Capacitor in this case), do not properly process /_nuxt/ files and nuxt builds into _nuxt.

FYI: https://github.com/nuxt/nuxt.js/issues/168 Solution is to modify the nuxt.config.js to reflect like this:

module.exports = {
//...
    build: {
    //...
        publicPath: '/nuxt/',
    //...
    }
//...
}
jcesarmobile commented 4 years ago

Android Studio by default doesn't copy folders that start by _

You can configure it to copy them, see https://github.com/ionic-team/capacitor/issues/1750#issuecomment-511785165

ionitron-bot[bot] commented 1 year ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.