Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android does not initialize with sample code #55

Open
Whip opened this issue Aug 3, 2018 · 10 comments
Open

Android does not initialize with sample code #55

Whip opened this issue Aug 3, 2018 · 10 comments

Comments

@Whip
Copy link

Whip commented Aug 3, 2018

The code in the Readme

application.onLaunch = function (intent) {
       imageCache.initialize();
};

does not work and produces an error SimpleDraweeView was not nitialized!

This is what I used to fix the problem

application.on(application.launchEvent, function(args) {
    imageCache.initialize();
});
@progressify
Copy link

I have the same problem

Error: java.lang.NullPointerException: SimpleDraweeView was not initialized!

But I am on angular. Have you any solution? Or you have abandoned them library?

@Whip
Copy link
Author

Whip commented Jan 15, 2019

I'm not using this library anymore and don't remember much of it but seems like I have posted the code that worked for me at the end. Did you try that?

@progressify
Copy link

yes, but without success
I have changed library

@max-pro
Copy link

max-pro commented Feb 11, 2019

I'm working on nativescript-vue getting same error
Error: java.lang.NullPointerException: SimpleDraweeView was not initialized!

@apsaros
Copy link

apsaros commented Feb 14, 2019

I'm also getting the same error in ns-vue. Running the latest npm version of the package (5.0.0).

@apsaros
Copy link

apsaros commented Feb 14, 2019

Ok, I solved it by initializing the imageCache (fresco) with a slight modification to the previous code by VeeK727. However, the former should work, don't know why it doesn't for me.
And don't forget to import/require the needed packs :)

import * as application from "tns-core-modules/application";
var imageCache = require("nativescript-web-image-cache");

if(application.android){
  application.on("launch", function () {
    imageCache.initialize();
  });
 }

@blaur
Copy link

blaur commented May 9, 2019

I can validate that this does not work on Android devides (when using nativescript & angular) without using the above suggestion from asparos.

@tahir-jamil
Copy link

tahir-jamil commented Jul 17, 2019

where i have to add this code @blaur @apsaros i am working on nativescript angular project

@VitorHFLopes
Copy link

this fix the problem indeed, but the image is not being rendered :(

@apsaros
Copy link

apsaros commented Jul 25, 2019

@tahir-jamil if I remember correctly, I added the code in the init main.js (using nativescript-vue). However, I've since dropped this package for the nativescript-image-cache-it plugin:
https://github.com/triniwiz/nativescript-image-cache-it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants