Coder Social home page Coder Social logo

Comments (15)

aligkts avatar aligkts commented on June 26, 2024

I have same issues.I could not solve it.

from androidfillableloaders.

Letme avatar Letme commented on June 26, 2024

Can you2 paste some code producing this or what did you follow when this appeared?

from androidfillableloaders.

Letme avatar Letme commented on June 26, 2024

(I am not on computer but lets get more info).

Can you print/share the value of you path (SvgPath.Bag.path)? It seems like that is NULL...

from androidfillableloaders.

Letme avatar Letme commented on June 26, 2024

(your replies are a bit messed since you reply on mails)

Ok, so since public FillableLoaderBuilder svgPath(String svgPath) takes String and you feed it with val we can start with that alignment. Here I assume that path contains something like string with "\n" for end of line characters, some string numbers with dots and stuff (so not OS path)...

from androidfillableloaders.

aligkts avatar aligkts commented on June 26, 2024

Yes my path contains "\n" and "+".What do you think?

from androidfillableloaders.

Letme avatar Letme commented on June 26, 2024

Did you try to change the path variable from val to String? It seems like the length is somehow null and that hits the null pointer exception.

from androidfillableloaders.

aligkts avatar aligkts commented on June 26, 2024

It is already 'val path: String?' when I change it to 'path: String?',this does not refers path 'val path= SvgPath.Bag.path'

from androidfillableloaders.

Letme avatar Letme commented on June 26, 2024

I would indeed change val path= SvgPath.Bag.path to String path= SvgPath.Bag.path to make it more explicit. You confirmed with debugger that path then contains a proper string which is passed to svgPath()? Just go step by step with break points if logcat print messages are not revealing enough.

from androidfillableloaders.

aligkts avatar aligkts commented on June 26, 2024

In Kotlin language, val path= SvgPath.Bag.path refers to Java's String path= SvgPath.Bag.path

from androidfillableloaders.

aligkts avatar aligkts commented on June 26, 2024

Path does not comes null I checked that but I have no idea about what is the problem :(

from androidfillableloaders.

Letme avatar Letme commented on June 26, 2024

Kotlin... huh I am indeed rusty. Can you again paste the LogCat error and a nicely formatted example? I was on Java, but this might be issue with Kotlin calling Java?

from androidfillableloaders.

aligkts avatar aligkts commented on June 26, 2024

java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference at com.github.jorgecastillo.svg.SvgPathParser.parsePath(SvgPathParser.java:52) at com.github.jorgecastillo.FillableLoader.buildPathData(FillableLoader.java:374) at com.github.jorgecastillo.FillableLoader.onSizeChanged(FillableLoader.java:224)

this is LogCat error

from androidfillableloaders.

Letme avatar Letme commented on June 26, 2024

So the error reads exactly what I said, but what you pasted before was .build() method - so I assume logcat marks that line as failure in your application? You will have to give a lot more information if you want me to help you debug this, because now I can only guess.

from androidfillableloaders.

aligkts avatar aligkts commented on June 26, 2024

https://gist.github.com/aligkts/94722473e34f55b812c56ca1977f3b37
https://gist.github.com/aligkts/2f3c1f5ef55ba594fd84dad3d2adb99b
https://gist.github.com/aligkts/560b8c1da5b1a743fde3f8c8d3c93e50

You can check it from these links easily.

from androidfillableloaders.

Letme avatar Letme commented on June 26, 2024

OK few ideas (remember don't know Kotlin syntax or background so might be totally off):

  • I assume you confirmed without this lines the fragment loads (put a textview in to start with), because I remember you have to inflate fragments and stuff like that
  • Maybe a simple var string instead of enum class would do the trick (although I read over Kotlin help on enum class and it should return String like you say it does)
  • For future you are missing fillableLoader.setOnStateChangeListener(this); later on, because I see your error originates from: com.github.jorgecastillo.FillableLoader.onSizeChanged(FillableLoader.java:224), which might also be something coming from onStateChange trigger in second loop (error is kinda short and does not map to your code so I am guessing again).

from androidfillableloaders.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.