GameAnalytics / GA-SDK-AIR

Public repository for official GameAnalytics Adobe AIR SDK.
MIT License
5 stars 1 forks source link

Error #1007: Instantiation attempted on a non-constructor. #10

Closed Shaunmax closed 4 years ago

Shaunmax commented 4 years ago

When trying to initialize i am getting the following error

[Fault] exception, information=TypeError: Error #1007: Instantiation attempted on a non-constructor.

GameAnalytics.config
.setAutoDetectAppVersion(true)
.setResourceCurrencies(new ["gems", "coins"])
.setGameKeyAndroid("xxxxxxxx")
.setGameSecretAndroid("xxxxxxxxx");

if(GameAnalytics.init())
{
// SDK has been initialized correctly now
GameAnalytics.addDesignEvent("Game:Started");
}

When I remove the line .setResourceCurrencies(new ["gems", "coins"]) the error is gone! What is the issue with .setResourceCurrencies(new ["gems", "coins"]) in the above code.

Also in the editor i can see red under line : -

Screen Shot 2020-09-15 at 10 29 07 PM

but code compiles with no issue!

the1schwartz commented 4 years ago

Ok what happens if you replace new ["coins", "diamonds"] with new <String>["coins", "diamonds"]?

the1schwartz commented 4 years ago

The documentation page has been updated to show the correct way. Let me know if it helps.

Shaunmax commented 4 years ago

The documentation page has been updated to show the correct way. Let me know if it helps.

That fixed the issue! thanks a lot!