Questions tagged [assets]

1. Non-code files packed with an application (example, data or media files). 2. From a security point of view - any data or resource that should be (or can be) protected.

3549 questions
27
votes
2 answers

Android WebView JavaScript from assets

How can I make JavaScript and images on my remote HTML page be loaded from assets folder (or just any local resource)?
tomurka
  • 851
  • 1
  • 7
  • 16
27
votes
1 answer

Which image format i should for ios development native ? SVG or PNG?

I am into iOS development from past 1+ months and what I have experienced is that I have to put images for 1x 2x 3x for iphone and then 2x retina for ipad. One of the experienced designers has sugguested to me to go for svg format as it scales…
narahari_arjun
  • 623
  • 1
  • 13
  • 30
26
votes
5 answers

SASS global variables not being passed to partials

Basically I have a structure that used to work perfectly in 3.0.x and now it breaks with undefined variable errors. partials _base.css.sass _header.css.sass main.css.sass application.css.sass the application.css.sass: //=require 'main' the…
Draiken
  • 3,805
  • 2
  • 30
  • 48
25
votes
1 answer

Rails rake assets:precompile for production

I'm trying to precompile the assets for my app to deploy to Heroku but have to following error. When running: RAILS_ENV=production bundle exec rake assets:precompile Error: /bin/rake assets:precompile:all RAILS_ENV=production…
Kieran Klaassen
  • 2,192
  • 4
  • 21
  • 25
25
votes
2 answers

Error: Not a constant expression in Flutter

I using the demo from this library and it works perfectly. But when I implement in my project, I get error on this line Error: Not a constant expression. const AssetImage(snapshot.data[index]), My Container is wrapping in InkWell. InkWell( …
Tony
  • 2,515
  • 14
  • 38
  • 71
25
votes
13 answers

Angular 6 Failing To Load Images From Assets

For some reason I can't get my images to show in my app. This is the error, tests and class: The error: GET http://localhost:4200/assets/image.png 404 (Not Found)
Frank
  • 2,109
  • 7
  • 25
  • 48
25
votes
6 answers

Android path to asset txt file

I'm doing: FileReader fin = new FileReader("file:///android_asset/myFile.txt"); in an Android project and many variations. At runtime I get a file not found exception. The file is present and correct in the assets folder, so my path must be…
Ken
  • 30,811
  • 34
  • 116
  • 155
25
votes
4 answers

Controlling image load order in HTML

Is there a way to control the load order of images on a web page? I was thinking of trying to simulate a preloader by first loading a light-weight 'LOADING' graphic. Any ideas? Thanks
Yarin
  • 173,523
  • 149
  • 402
  • 512
25
votes
1 answer

Asset Catalog: Access images with same name in different folders

There is an images.xcassets in my project, it contains an icons folder and two subfolders (firstFolder, secondFolder) with images. Both of my subfolders have the same number of icons and the same icons names (for different themes of my app). So…
Alexey Pelekh
  • 1,143
  • 13
  • 20
24
votes
1 answer

Laravel asset vs mix

I don't get to understand the difference between using asset or mix Laravel helper when you have to include some js or css file. vs Both generates a…
Alberto
  • 1,348
  • 2
  • 14
  • 28
24
votes
7 answers

couldn't find file 'jquery' with type 'application/javascript'

This might seem a repeated question but none of the solutions seem to work for me. I have gem jquery-rails in my Gemfile. Also, the lines //= require jquery //= require jquery_ujs //= require turbolinks //= require_tree . And this is my…
Souvik Das
  • 335
  • 1
  • 4
  • 14
24
votes
7 answers

Gradle: Exclude file from Android assets folder

Please, do you know a way how to exclude some file from Android project assets folder before multiple assets folders are merged or during the merge? For example: android { sourceSets { main { assets.srcDirs = [fileTree(dir: 'assets1',…
Blackhex
  • 1,694
  • 3
  • 21
  • 45
24
votes
3 answers

Android: how do I create File object from asset file?

I have a text file in the assets folder that I need to turn into a File object (not into InputStream). When I tried this, I got "no such file" exception: String path = "file:///android_asset/datafile.txt"; URL url = new URL(path); File file = new…
I Z
  • 5,719
  • 19
  • 53
  • 100
23
votes
2 answers

android assetManager

I need to get Absolute path to Folder in Assets. Some like this for sd-card: final String sdDir = Environment.getExternalStorageDirectory() + "Files"; What i do incorrect? First I try to get path (in green ractangle) this way but I alwase get…
Val
  • 4,225
  • 8
  • 36
  • 55
23
votes
1 answer

How to pass image asset in imageprovider type?

I currently depend on splashscreen 1.2.0 package for the a flutter app. But the backgroundimage variable type is imageprovider, whereas I want to use the image from assets folder. Does anyone know how to pass the image asset file to be able to use…
leemuljadi
  • 410
  • 1
  • 3
  • 14