Runtime Error Attempt to invoke virtual method java.lang.Class java.lang.Object.getClass()' on a null object reference


blocks (4)
blocks (3)


Runtime error not showing on kodular compainion test, its only showing after apk installed on device
Please help me

It is hard to guess the problem with your blocks screenshot… When you are getting such error? Your error seems to be problem with dynamic component wrong id it seems , but not sure

1 Like

Try by removing phase from end of the procedure just try

1 Like

Eventhough its showing the same

If i use loop insted of timmer its working well, why i dont use loop because of lagging, loop is very faster so device hangging problem

You have to use loop :curly_loop: instead of timer. Because of timer it can’t able to get the class. Best way is to use loop

1 Like

But loop number going in a fraction of sec duration its may causes hanging device cant deal with large data
And i used similar timmer insted of loop in my another screen its working well

I suggest you to shorten your blocks like use schema instead of long procedure.
I can’t figure out the issue. Use loop efficiently

1 Like

No need of timer, just use any spinning process.

I dont know about schema
Could you give any idea about it please

I dont know , i am new to kodular
Could you give any idea regarding spinning process.

If you share your aia here or in private message to me, it will be easy to identify the problem but i am sure it is due to number only maximum

1 Like

Thankyou so much i will share you

The mentioned error generally occurs when you are trying to assign a property(may be text, size, any value, etc) to a dynamic component before its even created

2 Likes

if I created index with loop its working fine withoit error, if i create index with timmer it giving error

This post was flagged by the community and is temporarily hidden.

The error maybe because with timer,the blocks in the Clock.timer event are executed in the decided time without checking if the component was created or not. So even if component is not created ,it is trying to assign some value(property) to the component that is not present or is yet to be created.

Whereas with loops all the blocks are executed one-by-one and one after the other. So its taking time and lagging but not giving any error

1 Like

Could you give suggest to decrease lagg with large data insted of using loop
Is there any alternative
And one more is the error showing only while screen intiation , after screen start no error even reloading data then only not getting error

You can load data or make component on scrolling if you are using scroll arrangement to show data

If you design it properly even clock also would give you correct order

1 Like