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

fix: Fix for #59 and improved typing #74

Closed DickSmith closed 6 years ago

DickSmith commented 6 years ago

Fix for #59 and improved typing

Fatal Exception: com.tns.NativeScriptException
Calling js method onCreateView failed Error: com.facebook.imagepipeline.request.ImageRequestBuilder$BuilderException: Invalid request builder: Resource URI must not be empty com.facebook.imagepipeline.request.ImageRequestBuilder.validate(ImageRequestBuilder.java:277) com.facebook.imagepipeline.request.ImageRequestBuilder.build(ImageRequestBuilder.java:253) com.tns.Runtime.callJSMethodNative(Native Method) com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1100) com.tns.Runtime.callJSMethodImpl(Runtime.java:982) com.tns.Runtime.callJSMethod(Runtime.java:969) com.tns.Runtime.callJSMethod(Runtime.java:953) com.tns.Runtime.callJSMethod(Runtime.java:945) com.tns.FragmentClass.onCreateView(FragmentClass.java:45) android.app.Fragment.performCreateView(Fragment.java:2220) android.app.FragmentManagerImpl.moveToState(FragmentManager.java:973) android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1148) android.app.BackStackRecord.run(BackStackRecord.java:793) android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1535) android.app.FragmentManagerImpl$1.run(FragmentManager.java:482) android.os.Handler.handleCallback(Handler.java:739) android.os.Handler.dispatchMessage(Handler.java:95) android.os.Looper.loop(Looper.java:148) android.app.ActivityThread.main(ActivityThread.java:5417) java.lang.reflect.Method.invoke(Native Method) com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:742) com.android.internal.os.ZygoteInit.main(ZygoteInit.java:632) File: "<embedded>, line: 36, column: 1105305 StackTrace: Frame: function:'t.initImage', file:'<embedded>', line: 36, column: 1105306 Frame: function:'t.initDrawee', file:'<embedded>', line: 36, column: 1104279 Frame: function:'t.initNativeView', file:'<embedded>', line: 36, column: 1102653 Frame: function:'t.setNativeView', file:'<embedded>', line: 36, column: 1286625 Frame: function:'t._setupUI', file:'<embedded>', line: 36, column: 1286119 Frame: function:'', file:'<embedded>', line: 36, column: 1286374 Frame: function:'t.eachChildView', file:'<embedded>', line: 36, column: 1464842 Frame: function:'n.eachChild', file:'<embedded>', line: 36, column: 1273517 Frame: function:'t._setupUI', file:'<embedded>', line: 36, column: 1286350 Frame: function:'', file:'<embedded>', line: 36, column: 1286374 Frame: function:'t.eachChildView', file:'<embedded>', line: 36, column: 1464842 Frame: function:'n.eachChild', file:'<embedded>', line: 36, column: 1273517 Frame: function:'t._setupUI', file:'<embedded>', line: 36, column: 1286350 Frame: function:'', file:'<embedded>', line: 36, column: 1286374 Frame: function:'t.eachChildView', file:'<embedded>', line: 36, column: 1464842 Frame: function:'n.eachChild', file:'<embedded>', line: 36, column: 1273517 Frame: function:'t._setupUI', file:'<embedded>', line: 36, column: 1286350 Frame: function:'', file:'<embedded>', line: 36, column: 1286374 Frame: function:'t.eachChildView', file:'<embedded>', line: 36, column: 628054 Frame: function:'n.eachChild', file:'<embedded>', line: 36, column: 1273517 Frame: function:'t._setupUI', file:'<embedded>', line: 36, column: 1286350 Frame: function:'', file:'<embedded>', line: 36, column: 1286374 Frame: function:'t.eachChildView', file:'<embedded>', line: 36, column: 1464842 Frame: function:'n.eachChild', file:'<embedded>', line: 36, column: 1273517 Frame: function:'t._setupUI', file:'<embedded>', line: 36, column: 1286350 Frame: function:'', file:'<embedded>', line: 36, column: 1286374 Frame: function:'t.eachChildView', file:'<embedded>', line: 36, column: 628054 Frame: function:'t.eachChildView', file:'<embedded>', line: 36, column: 1448752 Frame: function:'n.eachChild', file:'<embedded>', line: 36, column: 1273517 Frame: function:'t._setupUI', file:'<embedded>', line: 36, column: 1286350 Frame: function:'t._addViewCore', file:'<embedded>', line: 36, column: 1284245 Frame: function:'t._addView', file:'<embedded>', line: 36, column: 1283968 Frame: function:'e.onCreateView', file:'<embedded>', line: 36, column: 560440 Frame: function:'t.onCreateView', file:'<embedded>', line: 36, column: 1316946
com.tns.Runtime.callJSMethodNative (Runtime.java)
com.tns.Runtime.dispatchCallJSMethodNative (Runtime.java:1100)
com.tns.Runtime.callJSMethodImpl (Runtime.java:982)
com.tns.Runtime.callJSMethod (Runtime.java:969)
com.tns.Runtime.callJSMethod (Runtime.java:953)
com.tns.Runtime.callJSMethod (Runtime.java:945)
com.tns.FragmentClass.onCreateView (FragmentClass.java:45)
android.app.Fragment.performCreateView (Fragment.java:2220)
android.app.FragmentManagerImpl.moveToState (FragmentManager.java:973)
android.app.FragmentManagerImpl.moveToState (FragmentManager.java:1148)
android.app.BackStackRecord.run (BackStackRecord.java:793)
android.app.FragmentManagerImpl.execPendingActions (FragmentManager.java:1535)
android.app.FragmentManagerImpl$1.run (FragmentManager.java:482)
android.os.Handler.handleCallback (Handler.java:739)
android.os.Handler.dispatchMessage (Handler.java:95)
android.os.Looper.loop (Looper.java:148)
android.app.ActivityThread.main (ActivityThread.java:5417)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:742)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:632)
Caused by com.facebook.imagepipeline.request.ImageRequestBuilder$BuilderException
Invalid request builder: Resource URI must not be empty
com.facebook.imagepipeline.request.ImageRequestBuilder.validate (ImageRequestBuilder.java:277)
com.facebook.imagepipeline.request.ImageRequestBuilder.build (ImageRequestBuilder.java:253)
com.tns.Runtime.callJSMethodNative (Runtime.java)
com.tns.Runtime.dispatchCallJSMethodNative (Runtime.java:1100)
com.tns.Runtime.callJSMethodImpl (Runtime.java:982)
com.tns.Runtime.callJSMethod (Runtime.java:969)
com.tns.Runtime.callJSMethod (Runtime.java:953)
com.tns.Runtime.callJSMethod (Runtime.java:945)
com.tns.FragmentClass.onCreateView (FragmentClass.java:45)
android.app.Fragment.performCreateView (Fragment.java:2220)
android.app.FragmentManagerImpl.moveToState (FragmentManager.java:973)
android.app.FragmentManagerImpl.moveToState (FragmentManager.java:1148)
android.app.BackStackRecord.run (BackStackRecord.java:793)
android.app.FragmentManagerImpl.execPendingActions (FragmentManager.java:1535)
android.app.FragmentManagerImpl$1.run (FragmentManager.java:482)
android.os.Handler.handleCallback (Handler.java:739)
android.os.Handler.dispatchMessage (Handler.java:95)
android.os.Looper.loop (Looper.java:148)
android.app.ActivityThread.main (ActivityThread.java:5417)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:742)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:632)
VladimirAmiorkov commented 6 years ago

Hi @DickSmith ,

Thank you for your PR. As I was in the middle of migrating (#16) the entire plugin to use the latest version of the native Android library I also internally applied your PR changes as it would have made this PR outdated and require it to be rebased.

I will be closing this PR you can follow this one to be notified when it is released with your changes.