NativeScript / nativescript-fresco

This repository holds the NativeScript plugin that exposes the functionality of the Fresco image library to NativeScript developers.
Apache License 2.0
53 stars 23 forks source link

JS: ERROR Error: com.facebook.imagepipeline.request.ImageRequestBuilder$BuilderException #59

Closed coden111 closed 6 years ago

coden111 commented 6 years ago

i started facing this issue lately the fresco loads the images just fine but i see this in my Terminal

JS: ERROR Error: com.facebook.imagepipeline.request.ImageRequestBuilder$BuilderException: Invalid request builder: Resource URI must not be empty JS: com.facebook.imagepipeline.request.ImageRequestBuilder.validate(ImageRequestBuilder.java:277) JS: com.facebook.imagepipeline.request.ImageRequestBuilder.build(ImageRequestBuilder.java:253) JS: com.tns.Runtime.callJSMethodNative(Native Method) JS: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088) JS: com.tns.Runtime.callJSMethodImpl(Runtime.java:970) JS: com.tns.Runtime.callJSMethod(Runtime.java:957) JS: com.tns.Runtime.callJSMethod(Runtime.java:941) JS: com.tns.Runtime.callJSMethod(Runtime.java:933) JS: com.tns.gen.com.telerik.widget.list.ListViewAdapter_frnal_ts_helpers_l58_c38__ListViewAdapter.onBindViewHolder(com.telerik.widget.list.ListViewAdapter.java)

i dont know how to get rid of it any suggestions?

zbranzov commented 6 years ago

@coden111 Can you provide steps to reproduce or a sample project? Using the demo app in the fresco's repository I was unable to reproduce your error.

coden111 commented 6 years ago

the issue occurs when i navigate to the template that content the images

coden111 commented 6 years ago

my main,ts

` import { Component, OnInit, ChangeDetectorRef } from "@angular/core"; import { ObservableArray } from "tns-core-modules/data/observable-array"; import { DataItem } from "../../dataitem/dataItem"; import { DataItemService } from "../../dataitem/dataItem.service"; import as Application from "application"; import as Timer from "timer";

@Component({ selector: "main", moduleId: module.id, providers: [DataItemService], templateUrl: "./main.html", styleUrls: ["./main-common.css", "./main.css"] }) export class MainComponent implements OnInit { private _dataItems: ObservableArray;

constructor(private _changeDetectionRef: ChangeDetectorRef, private _dataItemService: DataItemService) { }

ngOnInit() { this._dataItems = new ObservableArray(this._dataItemService.getListItemsFromJson()); this._changeDetectionRef.detectChanges(); }

public get dataItems(): ObservableArray { return this._dataItems; } } `

coden111 commented 6 years ago

package.json

`{ "description": "NativeScript Application", "license": "SEE LICENSE IN ", "readme": "NativeScript Application", "repository": "", "nativescript": { "id": "org.nativescript.Groceries", "tns-android": { "version": "3.4.1" } }, "dependencies": { "@angular/animations": "~5.2.0", "@angular/common": "~5.2.0", "@angular/compiler": "~5.2.0", "@angular/core": "~5.2.0", "@angular/forms": "~5.2.0", "@angular/http": "~5.2.0", "@angular/platform-browser": "~5.2.0", "@angular/platform-browser-dynamic": "~5.2.0", "@angular/router": "~5.2.0", "nativescript-angular": "~5.2.0", "nativescript-fresco": "^3.0.6", "nativescript-pro-ui": "^3.4.0", "nativescript-theme-core": "~1.0.4", "reflect-metadata": "~0.1.8", "rxjs": "~5.5.0", "tns-core-modules": "^3.4.0", "zone.js": "~0.8.4" }, "devDependencies": { "babel-traverse": "6.4.5", "babel-types": "6.4.5", "babylon": "6.4.5", "lazy": "1.0.11", "nativescript-dev-typescript": "~0.6.0", "typescript": "~2.6.2" } }

`

coden111 commented 6 years ago

app.module.ts

import { NgModule, NgModuleFactoryLoader, NO_ERRORS_SCHEMA } from "@angular/core"; import { Routes } from "@angular/router"; import { NativeScriptRouterModule, NSModuleFactoryLoader, } from "nativescript-angular/router" import { NativeScriptHttpModule } from "nativescript-angular/http"; import { NativeScriptModule } from "nativescript-angular/nativescript.module"; import { AppComponent } from "./app.component"; import { routes, navigatableComponents } from "./app.routing"; import { NativeScriptUIListViewModule } from "nativescript-pro-ui/listview/angular"; import { TNSFrescoModule } from "nativescript-fresco/angular"; import as frescoModule from "nativescript-fresco"; import as applicationModule from "application";

if (applicationModule.android) { applicationModule.on("launch", () => { frescoModule.initialize(); }); }

@NgModule({ imports: [ NativeScriptModule, NativeScriptHttpModule, NativeScriptRouterModule, TNSFrescoModule, NativeScriptUIListViewModule, NativeScriptRouterModule.forRoot(routes) ], declarations: [ AppComponent, ...navigatableComponents ], bootstrap: [AppComponent] }) export class AppModule {}

coden111 commented 6 years ago

main.html

` <RadListView [items]="dataItems">

    <!-- >> angular-listview-item-layouts-grid -->
    <ListViewGridLayout tkListViewLayout scrollDirection="Vertical" ios:itemHeight="200" spanCount="2"></ListViewGridLayout>

    <!-- << angular-listview-item-layouts-grid -->
</RadListView>

`

nsplugins commented 6 years ago

Hi @coden111,

Could you send us a sample project or playground where this behavior is reproducable?

coden111 commented 6 years ago

Hi @nsplugins this what causes the error <android> <FrescoDrawee horizontalAlignment="stretch" height="250" [imageUri]="item.image" verticalAlignment="top"></FrescoDrawee> </android> using <android></android> shows the images but i see that error in the terminal

coden111 commented 6 years ago

Taledo.zip there is the sample project

radeva commented 6 years ago

Hi @coden111 ,

I tested your demo project but I'm not able to receive such error. We made some code reorganization and fixed an issue related to this error. We'll probably release next week. If you're eager to try it, you can create a package using publish/pack.sh and try if this removes the error for you.

coden111 commented 6 years ago

okay i will wait till next week thanks

On 13 April 2018 at 15:52, radeva notifications@github.com wrote:

Hi @coden111 https://github.com/coden111 ,

I tested your demo project but I'm not able to receive such error. We made some code reorganization and fixed an issue related to this error. We'll probably release next week. If you're eager to try it, you can create a package using publish/pack.sh and try if this removes the error for you.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/NativeScript/nativescript-fresco/issues/59#issuecomment-381142273, or mute the thread https://github.com/notifications/unsubscribe-auth/AY-gZ4VnyzBrJwit8PCtgQIKw7C6bOy2ks5toK2tgaJpZM4SAY6P .

radeva commented 6 years ago

Hi @coden111 , the new version is now released.

VladimirAmiorkov commented 6 years ago

Closing due to no activity. Please let us know if you continue to experience this issue with the latest versions.