Hey all, I’ve been struggling to get my app to run correctly when building for Android and nothing I’ve found on the forums/the internet at large so far has solved my problem.
My app works fine in the browser, and even when running with npx cap run android
(of course in this case it’s streaming files from my dev machine), but when I create a build – whether debug or release – or run the project from android studio, it seems to produce a totally empty app. When attaching with the chrome remote inspector, localhost seems to just be capacitor shim code and none of my files appear to be included. The APK is also very tiny, under 2mb, which seems unrealistic.
Debug log
07/29 14:18:13: Launching 'app' on Google Pixel 3.
Install successfully finished in 1 s 976 ms.
$ adb shell am start -n "com.jacobalbano.moyase/com.jacobalbano.moyase.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Waiting for application to come online: com.jacobalbano.moyase | com.jacobalbano.moyase.test
Waiting for application to come online: com.jacobalbano.moyase | com.jacobalbano.moyase.test
Connected to process 18776 on device 'google-pixel_3-8BFX19SG4'.
Connecting to com.jacobalbano.moyase
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/obalbano.moyas: Late-enabling -Xcheck:jni
I/obalbano.moyas: Unquickening 12 vdex files!
W/ActivityThread: Application com.jacobalbano.moyase is waiting for the debugger on port 8100...
I/System.out: Sending WAIT chunk
I/System.out: Debugger has connected
waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
Connected to the target VM, address: 'localhost:55280', transport: 'socket'
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/chatty: uid=10333(com.jacobalbano.moyase) identical 1 line
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: debugger has settled (1329)
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
E/obalbano.moyas: Invalid ID 0x00000000.
W/obalbano.moyas: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
W/obalbano.moyas: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
I/WebViewFactory: Loading com.google.android.webview version 92.0.4515.115 (code 451511533)
W/obalbano.moyas: Accessing hidden method Landroid/os/Trace;->isTagEnabled(J)Z (greylist, reflection, allowed)
Accessing hidden method Landroid/os/Trace;->traceBegin(JLjava/lang/String;)V (greylist, reflection, allowed)
Accessing hidden method Landroid/os/Trace;->traceEnd(J)V (greylist, reflection, allowed)
Accessing hidden method Landroid/os/Trace;->asyncTraceBegin(JLjava/lang/String;I)V (greylist, reflection, allowed)
Accessing hidden method Landroid/os/Trace;->asyncTraceEnd(JLjava/lang/String;I)V (greylist, reflection, allowed)
I/cr_WVCFactoryProvider: Loaded version=92.0.4515.115 minSdkVersion=29 isBundle=true multiprocess=true packageId=2
E/obalbano.moyas: Invalid ID 0x00000000.
E/obalbano.moyas: Invalid ID 0x00000000.
I/cr_LibraryLoader: Successfully loaded native library
I/cr_CachingUmaRecorder: Flushed 8 samples from 8 histograms.
I/TetheringManager: registerTetheringEventCallback:com.jacobalbano.moyase
W/chromium: [WARNING:dns_config_service_android.cc(153)] Failed to read DnsConfig.
D/Capacitor: Starting BridgeActivity
D/Capacitor: Registering plugin: WebView
D/Capacitor: Registering plugin: App
D/Capacitor: Registering plugin: Haptics
D/Capacitor: Registering plugin: Keyboard
D/Capacitor: Registering plugin: StatusBar
E/Capacitor: Unable to read file at path public/plugins
D/Capacitor: Loading app at http://localhost
W/obalbano.moyas: Accessing hidden method Landroid/media/AudioManager;->getOutputLatency(I)I (greylist, reflection, allowed)
I/AdrenoGLES-0: QUALCOMM build : 781e7d0, I46ff5fc46f
Build Date : 12/01/20
OpenGL ES Shader Compiler Version: EV031.31.04.01
Local Branch : QPR1
Remote Branch :
Remote Branch :
Reconstruct Branch :
Build Config : C P 11.0.1 AArch64
Driver Path : /vendor/lib64/egl/libGLESv2_adreno.so
W/cr_media: Requires BLUETOOTH permission
I/AdrenoGLES-0: PFP: 0x016ee189, ME: 0x00000000
D/Capacitor: App started
W/AdrenoUtils: <ReadGpuID_from_sysfs:197>: Failed to open /sys/class/kgsl/kgsl-3d0/gpu_model
<ReadGpuID:221>: Failed to read chip ID from gpu_model. Fallback to use the GSL path
D/Capacitor/AppPlugin: Firing change: true
V/Capacitor/AppPlugin: Notifying listeners for event appStateChange
D/Capacitor/AppPlugin: No listeners found for event appStateChange
D/Capacitor: App resumed
D/Capacitor: Handling local request: http://localhost/
I/Gralloc4: mapper 4.x is not supported
W/Gralloc3: mapper 3.x is not supported
E/libc: Access denied finding property "vendor.gralloc.disable_ahardware_buffer"
D/Capacitor: Handling local request: http://localhost/assets/icon/favicon.png
One error that seems relevant to me is “E/Capacitor: Unable to read file at path public/plugins”, but I don’t know how to address this (and also it says immediately before that the plugins are being registered so in theory it should be working already).
The github repo is here if anyone wants to take a look. The /android/ folder isn’t checked in but my steps to initialize that are literally just
npx cap add android
npx cap open android
so if there’s extra configuration I need to do there, I’m all ears (though I bet I’ve already tried it at some point).
System details (output of "ionic info")
Ionic:
Ionic CLI : 6.16.3 (C:\Users\Jake\AppData\Roaming\npm\node_modules@ionic\cli)
Ionic Framework : @ionic/vue 5.6.11
Capacitor:
Capacitor CLI : 3.0.2
@capacitor/android : 3.1.2
@capacitor/core : 3.1.1
@capacitor/ios : not installed
Utility:
cordova-res : not installed globally
native-run : 1.4.0
System:
NodeJS : v14.17.3 (C:\Program Files\nodejs\node.exe)
npm : 6.14.13
OS : Windows 10
I’d be grateful for any help you can give!