Sunday, November 6, 2022
HomeGame Developmentsys.localStorage crashes native builds. v3.6.1 - Cocos Creator

sys.localStorage crashes native builds. v3.6.1 – Cocos Creator


Howdy i’m making an attempt to make a local construct for Mac OS. When i do that the editor logs plenty of errors:

I do know it occurs provided that i’ve a reference to sys.localStorage in any class which is exported as const.

When i take away sys.localStorage from my code the editor makes a construct with out errors.

So right here an instance:

Screen Shot 2022-11-06 at 18.59.17

Screen Shot 2022-11-06 at 18.59.48

MainEnums.ts has just one line:
export const check = new Take a look at()

Take a look at.ts:

import {sys} from 'cc'

export class Take a look at {
    constructor() {
        sys.localStorage.removeItem('check')
        const merchandise = sys.localStorage.getItem('check')
        sys.localStorage.setItem('check', "null")
    }
}


RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments