question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to load assets image with Version > 10

See original GitHub issue

Bug Report

Problem

I’m currently migrating my project to cordova-android@10. In my Project i’m using Googlemaps and Markers that icons are in my assets Folder. These are not working anymore and displays the default Google Map Marker.

Information

I see the following Error when i run my App via debugger:

E/AsyncLoadImage: can not connect to https://localhost/assets/imgs/map/mapPinGreen/mapPinGreen.png
    java.net.ConnectException: Failed to connect to localhost/127.0.0.1:443
        at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:147)
        at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:116)
        at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:186)
        at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:128)
        at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:97)
        at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:289)
        at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:232)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:465)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:411)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:542)
        at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:106)
        at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:30)
        at plugin.google.maps.AsyncLoadImage.doInBackground(AsyncLoadImage.java:299)
        at plugin.google.maps.AsyncLoadImage.doInBackground(AsyncLoadImage.java:27)
        at android.os.AsyncTask$3.call(AsyncTask.java:394)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:923)

Maybe the migration from the whitelist Plugin is not correctly working?

Environment, Platform, Device

Google Pixel 4, Android 10

Version information

Ionic:

   Ionic CLI                     : 6.16.3 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.6.12
   @angular-devkit/build-angular : 12.1.4
   @angular-devkit/schematics    : 12.1.4
   @angular/cli                  : 12.1.4
   @ionic/angular-toolkit        : 4.0.0

Cordova:

   Cordova CLI       : 10.0.0
   Cordova Platforms : android 10.0.1
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 50 other plugins)

Utility:

   cordova-res (update available: 0.15.3) : 0.15.1
   native-run (update available: 1.4.0)   : 1.0.0

System:

   Android SDK Tools : 25.2.3 (/Users/hanskrywalsky/Library/Android/sdk)
   ios-deploy        : 1.10.0
   ios-sim           : 8.0.2
   NodeJS            : v14.15.4 (/usr/local/bin/node)
   npm               : 7.17.0
   OS                : macOS Big Sur
   Xcode             : Xcode 12.5.1 Build version 12E507

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
ebhsgitcommented, Oct 23, 2021

@EinfachHans I’ve made a fix for myself. I’ve created PR https://github.com/mapsplugin/cordova-plugin-googlemaps/pull/2887 if you want to use it.

1reaction
EinfachHanscommented, Sep 6, 2021

iOS works fine with latest cordova-ios version

Read more comments on GitHub >

github_iconTop Results From Across the Web

2 Easy Steps to Fix Unable to Load Asset in Flutter (2022)
In Flutter, any such resource is called assets. But when you add the assets (e.g. Images, Videos, PDF files) you may make some...
Read more >
Flutter: Unable to load asset - android studio - Stack Overflow
First make sure the assets folder is located at the root of your project, outside the lib folder. Check there's no slash in...
Read more >
Flutter - Asset Image - GeeksforGeeks
Here we will learn how to add images in the flutter app. A flutter app when built has both assets (resources) and code....
Read more >
Error: Unable to load asset | 3 Way to Fix This | Image Widget
Hello, Friends if you Like this video then Subscribe our channel and also hit the bell icon for more awesome content.
Read more >
Images not loading from assets folder in Angular
You're using the wrong path to the images. In the Angular project, you don't have to add the relative path from your file...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found