Closed pedroabreu closed 1 month ago
@pedroabreu i just set up my project to use this great library. I would suggest to check the following:
ImgCache
import to your app module['ionic','ngcordova', 'ImgCache']
ImgCache
in any controller/service where you are using teh libManaged to figure out the issue. I was testing it on a native app (Ionic) and the problem was that I didn't had the file plugins installed. Thanks for your help. Works ok in the web version.
I'm getting the same problem on iOS and I have the required plugins installed (I think):
<feature name="Device">
<param name="id" value="org.apache.cordova.device" />
<param name="version" value="0.3.0"/>
</feature>
<feature name="File">
<param name="id" value="org.apache.cordova.file" />
<param name="version" value="1.3.3"/>
</feature>
<feature name="File Transfer">
<param name="id" value="org.apache.cordova.file-transfer" />
<param name="version" value="0.4.5"/>
</feature>
Also calling ImgCache.$init() inside $ionicPlatform.ready I get the same error:
TypeError: undefined is not a function (evaluating 'window.requestFileSystem(t.getCordovaStorageType(ImgCache.options.usePersistentCache),0,o,a)')
I'm sure I'm missing something obvious, I just don't know what it is.
Fixed this. Was definitely an issue of not fulling reading the documentation. In case anyone else runs in into the same issue, the solution was to add this to your angular config: ImgCacheProvider.manualInit = true;
otherwise it will init on it's own before $ionicPlatform.ready
I am also seeing a similar error using ionic:
TypeError: undefined is not a function (evaluating 'window.requestFileSystem(Helpers.getCordovaStorageType(ImgCache.options.usePersistentCache), 0, _gotFS, _fail)')
I have followed the all the steps in the docs but still getting the error.
I tracked the error to this line (called from the init function):
if (Helpers.isCordova()) { // PHONEGAP window.requestFileSystem(Helpers.getCordovaStorageType(ImgCache.options.usePersistentCache), 0, _gotFS, _fail);
in imgCache.js line 545. Anyone else had this problem?
Had the same problem, turned out that I was setting manual init in a wrong way (with the setOption function)
ImgCacheProvider.setOptions({ manualInit: true });
fixed it by changing it to
ImgCacheProvider.manualInit = true;
Make sure you don't make the same mistake.
I think I also met this problem, the console outputs
"window.requestFileSystem(Helpers.getCordovaStorageType(ImgCache.options.usePersistentCache), 0, _gotFS, _fail);"
My config part is
.config(function ($stateProvider, $urlRouterProvider, ImgCacheProvider) {
// more options at once
ImgCacheProvider.setOptions({
debug: false,
usePersistentCache: true
});
// ImgCache library is initialized automatically,
// but set this option if you are using platform like Ionic -
// in this case we need init imgcache.js manually after device is ready
ImgCacheProvider.manualInit = true;
});
and init
.run(function ($ionicPlatform, updateService, $ionicPopup, $timeout, ImgCache) {
$ionicPlatform.ready(function () {
ImgCache.$init();
});
})
Hi guys,
Just trying out this directive but I've run into this issue. I'm getting this error in the console:
Error: undefined is not a function (evaluating 'window.requestFileSystem(t.getCordovaStorageType(ImgCache.options.usePersistentCache),0,o,a)')
I'm using ionic and I followed everything stated on the docs. All imgcache js files on the index.html, ImgCacheProvider on the .config and $init on the .run