nativescript-community / ui-image

Advanced and efficient image display plugin which uses Fresco (Android) and SDWebImage (iOS) to implement caching, placeholders, image effects, and much more.
Apache License 2.0
36 stars 9 forks source link

Images don't load after creating and publishing Android App Bundle #9

Closed Whip closed 4 years ago

Whip commented 5 years ago

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

Is there any code involved?

<img:Img row="0" width="{{ width }}" height="{{ width }}" decodeWidth="{{ width }}" decodeHeight="{{ width }}" progressiveRenderingEnabled="true" src="{{ image }}" placeholderImageUri="~/images/loading.jpg" failureImageUri="~/images/loading.jpg" />

Works fine on local testing.

farfromrefug commented 5 years ago

You need to test your app in release. You can run your app on your device using tns run ios --release .... You can then see what's happening

Whip commented 5 years ago

I've tried that and it works. It just stops working when I generate the aab file and upload it to Play Store. Will it help if I add you to the internal test team of my app?

farfromrefug commented 5 years ago

No it won't really help. Look at your generated aab file and make sure the file is there, that it is in the right location ... Can't really help more for now. I am 99,999% this has nothing to do with the plugin.

Whip commented 5 years ago

Of course I know where the aab file is, I uploaded it to the play store. Have you tried creating a bundle file and publishing it? Does it work fine?

farfromrefug commented 5 years ago

I am not asking you if you know where the aab file is. I am telling to make sure the image is inside the aab when you publish it. {N} running within aab is no different from apk. I have created aab and have never seen any issues with image. However i am not sure if those apps were using local image like you do

Whip commented 5 years ago

I'm sorry if I didn't make it clear but I'm not using local images. They are being loaded from the server.

On Mon, May 6, 2019 at 6:41 PM Martin Guillon notifications@github.com wrote:

I am not asking you if you know where the aab file is. I am telling to make sure the image is inside the aab when you publish it. {N} running within aab is no different from apk. I have created aab and have never seen any issues with image. However i am not sure if those apps were using local image like you do

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Akylas/nativescript-image/issues/9#issuecomment-489614742, or mute the thread https://github.com/notifications/unsubscribe-auth/ACYO5RFRVXWWAWIGAN6SBK3PUAU75ANCNFSM4HKTBKYQ .

farfromrefug commented 5 years ago

@VeeK727 your example shows local image loading so i thought... Without any log i can't really help more. Sorry

Whip commented 5 years ago

The src attribute is dynamic and is loaded via the api. The placeholder image is local and it does load. Can you share your email or other contact so I can share my project with you privately?

farfromrefug commented 5 years ago

@VeeK727 see my profile

mikloshumli commented 5 years ago

this is my problem too. I tested with run and debug mode works fine but if make aab and upload to release then crash the app. Please help me what I doing this error. I have facebook pipeline error.

farfromrefug commented 5 years ago

@mikloshumli what is the facebook pipeline error?

farfromrefug commented 5 years ago

@mikloshumli @VeeK727 should be fixed in 2.1.4. Let me know

ghost commented 5 years ago

Same problem. In 2.1.4. It works perfectly in testing but crashes with aab, and doesn't work with tns run android --release .... I'm developing my app with Angular. I've tested my app with tns android run and everything worked fine, the images loaded properly, I use both local and remote src for images and all loaded without problems, then I've built the aab with webpack, uglify and snapshot options enabled, that builds the project without problems (but throws some log output errors), but then I've created and published the Android version, download it from the app store and the app crashes. I have to say the app version I've downloaded from play store works fine at the beginning, with the initial pages, but when I navigate to a page that loads an image with NSImg then it crashes. I have test other features and pages of my app (release version) that doesn't load any images and all they work fine, so I'm almost certainly sure that when it crashes the error is related or caused by nativescript-image. Searching a few hours ago I saw the update, 2.1.4, I've installing it and I've tested the app again and with tns run android --bundle --env.uglify --env.snapshot --release ... but no errors logs are printed. Also when running this way the app doesn't crashes, it only doesn't show the images. These are the versions I'm using: { "nativescript": { "id": { "android": "my.app" }, "tns-ios": { "version": "5.4.1" }, "tns-android": { "version": "5.4.0" } }, "description": "NativeScript Application", "license": "SEE LICENSE IN ", "repository": "", "dependencies": { "@angular/animations": "~7.2.0", "@angular/common": "~7.2.0", "@angular/compiler": "~7.2.0", "@angular/core": "~7.2.0", "@angular/forms": "~7.2.0", "@angular/http": "~7.2.0", "@angular/platform-browser": "~7.2.0", "@angular/platform-browser-dynamic": "~7.2.0", "@angular/router": "~7.2.0", "email-validator": "^2.0.4", "nativescript-angular": "^7.2.4", "nativescript-camera": "^4.3.0", "nativescript-cfalert-dialog": "^1.0.14", "nativescript-checkbox": "^3.0.3", "nativescript-datetimepicker": "^1.1.0", "nativescript-fancyalert": "^3.0.6", "nativescript-feedback": "^1.3.9", "nativescript-filterable-listpicker": "^2.2.5", "nativescript-floatingactionbutton": "^5.0.0", "nativescript-geolocation": "^4.4.1", "nativescript-image": "^2.1.4", "nativescript-imagepicker": "^6.1.2", "nativescript-loading-indicator": "^2.5.2", "nativescript-local-notifications": "^3.1.2", "nativescript-secure-storage": "^2.3.0", "nativescript-theme-core": "~1.0.4", "nativescript-ui-listview": "^6.3.2", "nativescript-ui-sidedrawer": "^6.0.0", "reflect-metadata": "~0.1.10", "rxjs": "^6.3.3", "tns-core-modules": "^5.4.2", "typescript": "^3.4.4", "zone.js": "^0.8.4" }, "devDependencies": { "@angular/cli": "^7.2.3", "@angular/compiler-cli": "8.0.0", "@nativescript/schematics": "^0.5.0", "@ngtools/webpack": "8.0.0", "jscrambler-webpack-plugin": "^5.3.5", "nativescript-dev-typescript": "^0.7.9", "nativescript-dev-webpack": "^0.24.1" }, "readme": "NativeScript Application" }

The facebook pipeline log errors when building aab:

registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) (node:8185) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Skip com.facebook.animated.gif.GifFrame Error: java.lang.NullPointerException Skip com.facebook.animated.gif.GifImage Error: java.lang.NullPointerException Skip com.google.errorprone.annotations.IncompatibleModifiers Error: java.lang.NullPointerException Project successfully built.

Whip commented 5 years ago

@ceht Just wanted to mention, I also receive those deprecation warnings in my app and have been receiving them pretty much since I started using nativescript and before using nativescript-image.

registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
(node:8185) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

I don't think these lines are related to facebook or nativescript-image. BTW why do you call it facebook pipeline error? I don't have any facebook related modules in my app and I don't see you having one either in the version list above.

ghost commented 5 years ago

Yeah, as you mention I've also been receiving almost all of them before using nativescript-image, I just copied all the warnings, but these are new ones:

Note: Recompile with -Xlint:deprecation for details. Skip com.facebook.animated.gif.GifFrame Skip com.facebook.animated.gif.GifImage Skip com.google.errorprone.annotations.IncompatibleModifiers I install some other plugins and update tns at the same time I install nativescript-image, so I'm not sure if all they are related to this plugin. I just called it 'facebook errors' becasuse I saw @mikloshumli called it that way, (because this Skip com.facebook.animated.gif.GifImage) but I think they're related to fresco, but not sure. And yeah, I don't use any facebook related module in my app.

Whip commented 5 years ago

Okay. I'm not sure what exactly is a facebook pipeline error but these just seems like image/graphic assets that the app is not able to load/compile, hence skipping.

Anyways the core issue definitely exists and needs to be addressed.

farfromrefug commented 5 years ago

guys did you remove the platform folder after updating the package? it should work. i tried here with success.

ghost commented 5 years ago

Solved! 😁 I finally had been able to use it properly. In the previous test I also cleaned the platform, now I deleted also the node_modules, and hooks folders and do npm prune. I also updated webpack with this commands. The app now works fine with both, tns run android --bundle --env.uglify --env.snapshot --release ... and the released version from the app store that I built with tns build android --bundle --env.uglify --env.snapshot --release ... as a aab. Thank you @farfromrefug the plugin is awesome.