Error licensing

Stimulsoft Reports.Flex discussion
hugo
Posts: 359
Joined: Fri Mar 08, 2013 10:46 am

Error licensing

Post by hugo »

Hello,

It's a long time since I don't update Stimulsoft on my App !
I decided to give a try and update my SWC for viewer and designer.
Now, I just need to license according to the new key but I got the following error:

ReferenceError: Error #1065: Variable JSON is not defined.
at stimulsoft.base.licenses::StiLicenseObject/loadFromString()
at stimulsoft.base.licenses::StiLicenseObject/decryptFromString()
at stimulsoft.base.licenses::StiLicenseKey$/getFromString()
at stimulsoft.base.licenses::StiLicense$/setNewLicenseKey()
at stimulsoft.base.licenses::StiLicense$/set key()

Please, advice.

Thank you,
Hugo.
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: Error licensing

Post by Vladimir »

Hello Hugo,

To convert the JSON string into an object, we use the following AC3 class:
http://help.adobe.com/en_US/FlashPlatfo ... /JSON.html

For some reason this class is not found.
Please check this class in your project on any simple JSON string for convert to the object.
Also let us know if you are aware of the possible options for the lack of this class.

Thank you.
hugo
Posts: 359
Joined: Fri Mar 08, 2013 10:46 am

Re: Error licensing

Post by hugo »

Hello Vladimir,

I don't use JSON on my project or even have a class with such a name.
The only reference to JSON is from Flex (see the attachment).

I'm using Flex 4.16 + AIR 25.
Probably it's an issue between the version of Flex to you are using and the current version.

Using the license.key file, where should I put the file from the source code ?
On src of the project ?
Attachments
Screen Shot 2017-05-17 at 13.53.28.png
Screen Shot 2017-05-17 at 13.53.28.png (62.66 KiB) Viewed 6945 times
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: Error licensing

Post by Vladimir »

Hello Hugo,

We have analyzed the problem. Based on similar problems in the Internet, most likely you are using a version of SDK that does not contain the JSON class in the runtime mode.

You can update the SDK. Also, we've added a simple JSON parser in our library, and in the absence of the JSON class a license key will work correctly. But the JSON data adapter for reports will not work in this case.

The update will be available in the 2017.1.5 version.

Using the license.key file, where should I put the file from the source code ?
You can load this file in the initialize event of the application. For example:

1. Using the license.key file:

Code: Select all

var file: File = File.applicationDirectory.resolvePath("license.key");
if (file.exists)
{
	var buffer: ByteArray = new ByteArray();
	var fileStream: FileStream = new FileStream();
	fileStream.open(file, FileMode.READ);
	fileStream.readBytes(buffer);
	fileStream.close();
	
	StiLicense.loadFromByteArray(buffer);
}
2. Using the base64 license key:

Code: Select all

StiLicense.key = "6vJhGtLLLz2......";
Thank you.
hugo
Posts: 359
Joined: Fri Mar 08, 2013 10:46 am

Re: Error licensing

Post by hugo »

Vladimir wrote:You can update the SDK
I'm using the very last version from Apache :)
Vladimir wrote:we've added a simple JSON parser in our library, and in the absence of the JSON class a license key will work correctly
For me, that's seems to be a good workaround and may work for me.
Vladimir wrote:But the JSON data adapter for reports will not work in this case
No problem for me. I'm using the XML version.
hugo wrote:The update will be available in the 2017.1.5 version
No problem for me because it's not a block issue on the current version that is outdated.
I will wait for the new version and then give a try.
Just to know, when is predicted the new version ?

I will wait for the new version and only use the loadFromByteArray method as the last resource because I prefer to not be depedent on an external file.
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: Error licensing

Post by Vladimir »

hugo wrote:Just to know, when is predicted the new version ?
The exact date has not yet been appointed, but it is about the end of next week.

Thank you.
hugo
Posts: 359
Joined: Fri Mar 08, 2013 10:46 am

Re: Error licensing

Post by hugo »

OK, thank you.
No problem.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Error licensing

Post by Alex K. »

Hello

Please let us know if you need any additional help.

Thank you.
hugo
Posts: 359
Joined: Fri Mar 08, 2013 10:46 am

Re: Error licensing

Post by hugo »

Hello,
The error is still present on version 2017.1.5.

I also tried the following methods with the same error result:

[Embed(source="/assets/licenses/reports.key", mimeType="application/octet-stream")]
private static var reports:Class;
StiLicense.loadFromByteArray(ByteArrayAsset(new reports()));

StiLicense.loadFromString(".. my secret key ...");
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: Error licensing

Post by Vladimir »

Hello Hugo,

Please try to use libraries from the following archive:

https://drive.google.com/file/d/0BxTYlh ... sp=sharing

Please inform us about the result. Also please send the full error stack if error will occur on the new libraries.

Thank you.
Locked