Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
Posts: 12
Registered: ‎10-18-2011
My Device: Developer
Accepted Solution

Module attempts to access secure API

I've been getting complains from customers that they can't install our app from App World, they're getting "Error starting AppNameHere: Module 'AppNameHere-1' attempts to access a secure API."

 

The app is signed correctly and runs on OS 6+ devices (tested on Bold 9780 and Torch 9800) but gives this error on OS 5 devices (tested on Bold 9000). I've tried installing from App World, Web .jad install, and using development tools and it always gives me this error no matter how I sign it. The app USED to work on OS 5 but then I started using net.rim.json.org packages which aren't available on OS 5. I fixed that by following this: http://stackoverflow.com/questions/10010484/net-rim-json-org-not-found but now I'm getting this new error.

 

I'm stumped.

 

Any idea why this would be happening?

Developer
Posts: 16,986
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Module attempts to access secure API

you get this message if the cod is not correctly signed.
clean the OS 5 project, recompile and sign again.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
Posts: 12
Registered: ‎10-18-2011
My Device: Developer

Re: Module attempts to access secure API

I've been at this for days. Cleaned and signed 20+ times. Any other suggestions?

Developer
Posts: 16,986
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Module attempts to access secure API

i just checked an app where we used json, all the classes are in the org.json.me package (app was before 6.0, so no need to differenciate there) and all was signed properly.

in 100% of the problem cases so far the cod in question was not properly signed (copied the wrong one etc etc), if it is different in your case i don't know how i could help.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
Posts: 12
Registered: ‎10-18-2011
My Device: Developer

Re: Module attempts to access secure API

I've had this problem before where this error would occur on all devices and resigning fixed the problem. But in this case it only seems to be OS 5 so I don't see how it could be the wrong cod or something if OS 6 devices installed fine from the same source (tested using web distribution on our site). 

 

I was thinking about your last reply when you said "clean the OS 5 project...". Is there some setting in the app descriptor or something that I could have accidentally made this a non OS 5 project? I'm using Blackberry JRE 7.0 in the build path, would that have anything to do with it?

Developer
Posts: 16,986
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Module attempts to access secure API

for OS 5 you have to compile using BlackBerry JRE 5
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 209
Registered: ‎04-30-2011
My Device: BlackBerry Z10
My Carrier: Airtel

Re: Module attempts to access secure API

Hi,

Actually, you did sign the app on OS6. So do one thing. sign your code with OS5. Then you will not find any issue.

if you sign the app on os6, then some this issue come.

Thanks
Pawan
Developer
Posts: 16,986
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Module attempts to access secure API


pankajace12 wrote:
Hi,

Actually, you did sign the app on OS6. So do one thing. sign your code with OS5. Then you will not find any issue.

if you sign the app on os6, then some this issue come.

Thanks
Pawan

this is not correct, you can use whatever version of the signing tool you want, what matters is that the code is compiled on JRE 5 if it is to be used on OS 5.

 

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
Posts: 12
Registered: ‎10-18-2011
My Device: Developer

Re: Module attempts to access secure API

I have finally fixed this thanks to Simon

 

The problem was I was using Blackberry JRE 7.0.0 to compile and I believe this *was* working until I tried to use 'net.rim.device.api.util.ByteArrayUtilities' which doesn't appear to be included in OS5. (This is just my assumption as to why it mysteriously stopped working)

 

Steps to solve: 

I had to write my own 'ByteArrayUtilities.byteArrayToHex()' (Stolen from Here) after using JDE 5.0

 

Also,

 

I don't believe you can use org.json.me in OS5. Looks like it was only introduced in OS6. See the OS5 docs http://www.blackberry.com/developers/docs/5.0.0api/index.html

 

That's where I was getting my original error in OS5, so I've included this https://github.com/upictec/org.json.me in my project and included it as a custom package so it doesn't interfere in OS6+.

Highlighted
Developer
Posts: 16,986
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Module attempts to access secure API

if you compile for OS 5 you have to add the json sources yourself, in OS 6+ they are integrated in the OS.
(but you can use them just fine)
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter