How to get Android app running

Hi,
I will get my App running for the first time in ionic with capacitor. It looks to my like a basic task but Im not familiar with the error is the build process. My projekt is running fine in the browser and I managed to get the iOS app running.

To get the Android App running i tried:

ionic build --prod
ionic cap add android
ionic cap open android

Now, Android Studio starts and comes up with these messages:

Screenshot 2022-11-23 170730

I don’t really knwo what gradle does, so I don’t know if I should update it or not.

Next thing is to click on the green play button to run the app in the simulator. It starts up but all I see is a plain dark blue screen (this is the corrct background color of my app). At the same time I take a look at the “Run”-Tab in Android Studio. It puts out many lines and some of them are red (errors). Those are:

E/iemerkhilfe.app: Invalid ID 0x00000000.
E/Capacitor: Unable to read file at path public/plugins
E/Capacitor/Console: File: http://localhost/main.js - Line 1 - Msg: ERROR [object Object]

I googled all that and couldn’t figure out what to do.

I’d be very thankful for you help
Greetings :slight_smile:


Update
I changed the appId in capacitor.config.json and all my errors in Android Studio temporarily disappeard.

My Problem is now at the next level. The run prompt in Android Studio temporarily shows with no further errors (*):

11/23 17:28:52: Launching 'app' on 4.65  720p (Galaxy Nexus) API 33.
Install successfully finished in 485 ms.
$ adb shell am start -n "lr.diemerkhilfe.app/lr.diemerkhilfe.app.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 8181 on device '4.65_720p_Galaxy_Nexus_API_33 [emulator-5554]'.
Connected to process 8261 on device '4.65_720p_Galaxy_Nexus_API_33 [emulator-5554]'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
W/ocessService0:0: Unexpected CPU variant for x86: x86_64.
    Known variants: atom, sandybridge, silvermont, kabylake, default
D/CompatibilityChangeReporter: Compat change id reported: 171979766; UID 99006; state: ENABLED
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
I/cr_WebViewApkApp: Launched version=103.0.5060.71 minSdkVersion=29 isBundle=false processName=com.google.android.webview:sandboxed_process0:org.chromium.content.app.SandboxedProcessService0:0
I/cr_ChildProcessService: Creating new ChildProcessService pid=8261
I/cr_LibraryLoader: Successfully loaded native library
I/cr_CachingUmaRecorder: Flushed 3 samples from 3 histograms.
W/SystemServiceRegistry: No service published for: uimode

I still got just the dark blue screen (my background color) but it mus be some runtime problem now. I can open my chrome browser at

chrome://inspect/#devices

and find my simulation device there to be inspected:

As you can see there is an error while trying to get some resources:

ERR_CLEARTEXT_NOT_PERMITTED

(*)
in any later tries the error came back looks like this:

11/23 18:19:20: Launching 'app' on 4.65  720p (Galaxy Nexus) API 33.
Install successfully finished in 1 s 301 ms.
$ adb shell am start -n "lr.diemerkhilfe.app/lr.diemerkhilfe.app.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 13761 on device '4.65_720p_Galaxy_Nexus_API_33 [emulator-5554]'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/iemerkhilfe.app: Late-enabling -Xcheck:jni
W/iemerkhilfe.app: Unexpected CPU variant for x86: x86_64.
    Known variants: atom, sandybridge, silvermont, kabylake, default
D/CompatibilityChangeReporter: Compat change id reported: 171979766; UID 10160; state: DISABLED
W/ziparchive: Unable to open '/data/app/~~yB7u8bOffTLxJkHAVbpFGQ==/lr.diemerkhilfe.app-C2V3vKCM8Jhq6X6jbYyszQ==/base.dm': No such file or directory
W/ziparchive: Unable to open '/data/app/~~yB7u8bOffTLxJkHAVbpFGQ==/lr.diemerkhilfe.app-C2V3vKCM8Jhq6X6jbYyszQ==/base.dm': No such file or directory
D/nativeloader: Configuring classloader-namespace for other apk /data/app/~~yB7u8bOffTLxJkHAVbpFGQ==/lr.diemerkhilfe.app-C2V3vKCM8Jhq6X6jbYyszQ==/base.apk. target_sdk_version=30, uses_libraries=, library_path=/data/app/~~yB7u8bOffTLxJkHAVbpFGQ==/lr.diemerkhilfe.app-C2V3vKCM8Jhq6X6jbYyszQ==/lib/x86_64, permitted_path=/data:/mnt/expand:/data/user/0/lr.diemerkhilfe.app
V/GraphicsEnvironment: ANGLE Developer option for 'lr.diemerkhilfe.app' set to: 'default'
V/GraphicsEnvironment: ANGLE GameManagerService for lr.diemerkhilfe.app: false
V/GraphicsEnvironment: Neither updatable production driver nor prerelease driver is supported.
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/libEGL: loaded /vendor/lib64/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib64/egl/libGLESv1_CM_emulation.so
D/libEGL: loaded /vendor/lib64/egl/libGLESv2_emulation.so
E/iemerkhilfe.app: Invalid ID 0x00000000.
W/iemerkhilfe.app: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (unsupported, reflection, allowed)
W/iemerkhilfe.app: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (unsupported, reflection, allowed)
I/WebViewFactory: Loading com.google.android.webview version 103.0.5060.71 (code 506007137)
D/nativeloader: Configuring classloader-namespace for other apk /data/app/~~CQxAFV58CR2jyEiNughWQg==/com.google.android.trichromelibrary_506007137-3WUdogxefzbBjoKp3DTGQw==/TrichromeLibrary.apk. target_sdk_version=33, uses_libraries=ALL, library_path=/data/app/~~aWqWdnyXsS1hXbK-sulehQ==/com.google.android.webview-qUuFbE4XxaBCaGKmltrT_w==/lib/x86_64:/data/app/~~aWqWdnyXsS1hXbK-sulehQ==/com.google.android.webview-qUuFbE4XxaBCaGKmltrT_w==/WebViewGoogle.apk!/lib/x86_64:/data/app/~~CQxAFV58CR2jyEiNughWQg==/com.google.android.trichromelibrary_506007137-3WUdogxefzbBjoKp3DTGQw==/TrichromeLibrary.apk!/lib/x86_64, permitted_path=/data:/mnt/expand
D/nativeloader: Configuring classloader-namespace for other apk /data/app/~~aWqWdnyXsS1hXbK-sulehQ==/com.google.android.webview-qUuFbE4XxaBCaGKmltrT_w==/WebViewGoogle.apk. target_sdk_version=33, uses_libraries=, library_path=/data/app/~~aWqWdnyXsS1hXbK-sulehQ==/com.google.android.webview-qUuFbE4XxaBCaGKmltrT_w==/lib/x86_64:/data/app/~~aWqWdnyXsS1hXbK-sulehQ==/com.google.android.webview-qUuFbE4XxaBCaGKmltrT_w==/WebViewGoogle.apk!/lib/x86_64:/data/app/~~CQxAFV58CR2jyEiNughWQg==/com.google.android.trichromelibrary_506007137-3WUdogxefzbBjoKp3DTGQw==/TrichromeLibrary.apk!/lib/x86_64, permitted_path=/data:/mnt/expand
W/iemerkhilfe.app: Accessing hidden method Landroid/os/Trace;->isTagEnabled(J)Z (unsupported, reflection, allowed)
W/iemerkhilfe.app: Accessing hidden method Landroid/os/Trace;->traceBegin(JLjava/lang/String;)V (unsupported, reflection, allowed)
W/iemerkhilfe.app: Accessing hidden method Landroid/os/Trace;->traceEnd(J)V (unsupported, reflection, allowed)
W/iemerkhilfe.app: Accessing hidden method Landroid/os/Trace;->asyncTraceBegin(JLjava/lang/String;I)V (unsupported, reflection, allowed)
W/iemerkhilfe.app: Accessing hidden method Landroid/os/Trace;->asyncTraceEnd(JLjava/lang/String;I)V (unsupported, reflection, allowed)
I/cr_WVCFactoryProvider: Loaded version=103.0.5060.71 minSdkVersion=29 isBundle=false multiprocess=true packageId=2
I/cr_VariationsUtils: Failed reading seed file "/data/user/0/lr.diemerkhilfe.app/app_webview/variations_seed_new"
I/cr_VariationsUtils: Failed reading seed file "/data/user/0/lr.diemerkhilfe.app/app_webview/variations_seed"
I/cr_VariationsUtils: Requesting new seed from IVariationsSeedServer
E/iemerkhilfe.app: Invalid ID 0x00000000.
E/iemerkhilfe.app: Invalid ID 0x00000000.
I/cr_LibraryLoader: Successfully loaded native library
I/cr_CachingUmaRecorder: Flushed 9 samples from 9 histograms.
D/CompatibilityChangeReporter: Compat change id reported: 183155436; UID 10160; state: DISABLED
W/chromium: [WARNING:dns_config_service_android.cc(115)] Failed to read DnsConfig.
D/CompatibilityChangeReporter: Compat change id reported: 214741472; UID 10160; state: DISABLED
D/CompatibilityChangeReporter: Compat change id reported: 171228096; UID 10160; state: ENABLED
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
D/HostConnection: createUnique: call
D/HostConnection: HostConnection::get() New Host Connection established 0x7162a5322cd0, tid 13875
W/iemerkhilfe.app: Accessing hidden method Landroid/media/AudioManager;->getOutputLatency(I)I (unsupported, reflection, allowed)
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_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma ANDROID_EMU_hwc_multi_configs GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_1 
D/Capacitor: App started
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/EGL_emulation: eglCreateContext: 0x7162a5323450: maj 3 min 1 rcv 4
D/EGL_emulation: eglMakeCurrent: 0x7162a5323450: ver 3 1 (tinfo 0x7164c3e00080) (first time)
W/cr_media: Requires BLUETOOTH permission
D/Capacitor: Handling local request: http://localhost/
D/EGL_emulation: eglCreateContext: 0x7162a5323450: maj 3 min 0 rcv 3
D/CompatibilityChangeReporter: Compat change id reported: 193247900; UID 10160; state: DISABLED
D/HostConnection: createUnique: call
D/HostConnection: HostConnection::get() New Host Connection established 0x7162a5322250, tid 13800
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_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma ANDROID_EMU_hwc_multi_configs GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_1 
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
W/OpenGLRenderer: Failed to initialize 101010-2 format, error = EGL_SUCCESS
D/EGL_emulation: eglCreateContext: 0x7162a5322850: maj 3 min 1 rcv 4
D/EGL_emulation: eglMakeCurrent: 0x7162a5322850: ver 3 1 (tinfo 0x7164c3e00100) (first time)
I/Gralloc4: mapper 4.x is not supported
D/HostConnection: createUnique: call
D/HostConnection: HostConnection::get() New Host Connection established 0x7162a5321890, tid 13800
D/goldfish-address-space: allocate: Ask for block of size 0x100
D/goldfish-address-space: allocate: ioctl allocate returned offset 0x3f7ffe000 size 0x2000
W/Gralloc4: allocator 4.x is not supported
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_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma ANDROID_EMU_hwc_multi_configs GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_1 
W/Parcel: Expecting binder but got null!
D/EGL_emulation: eglCreateContext: 0x7162a5323150: maj 3 min 0 rcv 3
D/Capacitor: Handling local request: http://localhost/runtime.js
D/Capacitor: Handling local request: http://localhost/polyfills.js
D/Capacitor: Handling local request: http://localhost/main.js
D/Capacitor: Handling local request: http://localhost/styles.css
D/EGL_emulation: app_time_stats: avg=271.40ms min=22.99ms max=646.50ms count=5
I/Capacitor/Console: File: http://localhost/main.js - Line 1 - Msg: session provider with platform  [object Object]  on server with config  [object Object]
D/Capacitor: Handling local request: http://localhost/assets/file.worker.js
D/Capacitor: Handling local request: http://localhost/assets/logo/merkhilfe-logo.png
D/Capacitor: Handling local request: http://localhost/assets/logo/merkhilfe-logo.png
E/Capacitor/Console: File: http://localhost/main.js - Line 1 - Msg: ERROR [object Object]
E/Capacitor/Console: File: http://localhost/main.js - Line 1 - Msg: ERROR [object Object]
E/Capacitor/Console: File: http://localhost/main.js - Line 1 - Msg: ERROR [object Object]