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

Android™ Runtime Development

Reply
Visitor
sieryuu
Posts: 1
Registered: ‎04-24-2013
My Device: Z10

Android compile to blackberry error

This is my error show in eclipse

 

Description Resource Path Location Type
[ERROR] Invalid argument: C:\Program Files\Android\android-sdk" -t C:\Documents
[ERROR] Invalid argument: and
[ERROR] Invalid argument: Settings\user\My
[ERROR] Invalid argument: Documents\Android_Workspace\Blackberry\dist\Android
[ERROR] Invalid argument: 2.3.3 Blackberry C:\Documents and Settings\user\My Documents\Android_Workspace\Blackberry\bin\Blackberry.apk BlackBerry Packaging Problem

 

When I compile to my simulator this error appear, any one can help me?

Please use plain text.
Developer
ndsmyter
Posts: 648
Registered: ‎09-26-2012
My Device: Limited Edition Z10, Playbook 16GB/32GB, Dev Alpha A/B/C

Re: Android compile to blackberry error

It seems like you are passing a value to the compiler ? If so you forgot to add quotes around the path, causing the compiler to think that these are seperate arguments.


A like is always appreciated,
but a nomination for BB Elite even more :-)
You can also contact me on Twitter: @ndsmyter
Please use plain text.
New Contributor
mhawes
Posts: 5
Registered: ‎05-03-2013
My Device: Developer (various devices)

Re: Android compile to blackberry error

I'm also getting this error. My Android SDK is working fine, I can compile and run my project for Android without a problem. When I try to compile it for BlackBerry World I get this error:

 

C:\Eclipse\Eclipse BB Android>java -Djava.awt.headless=true -Xmx512M -cp "C:\Eclipse\Eclipse BB Android\plugins\net.rim.ajde_1.5.2.201302260701\blackberry.tools.SDK\bin\\..\lib\BARPackager.jar;C:\Eclipse\Eclipse BB Android\plugins\net.rim.ajde_1.5.2.201302260701\blackberry.tools.SDK\bin\\..\lib\Apk2Bar.jar" net.rim.tools.apk2bar.Apk2Bar [Eclipse project folder]\bin\[apk name].apk [Eclipse project folder]\android.cfg "C:\Program Files (x86)\Android\android-sdk\" -t "[Eclipse project folder]\dist\Android 2.3.3"
Apk2Bar version 1.5.2
Research In Motion Ltd ? 2012 All rights reserved.
[ERROR] Invalid argument: C:\Program Files (x86)\Android\android-sdk" -t C:\Development\Projects\Android\AndroidSVN\campusM_Android_Blackberry_Merged\dist\Android
[ERROR] Invalid argument: 2.3.3
[ERROR] Android SDK path is not set.

 

 

I've also tried moving the android sdk to the root directory and running apk2bar on the command line like so, with a similar error:

 

C:\Development\Projects\Android\blackberry.tools.SDK\bin>apk2bar [Eclipse project folder] "C:\android-sdk\"

C:\Development\Projects\Android\blackberry.tools.SDK\bin>set LIB=C:\Development\Projects\Android\blackberry.tools.SDK\bin\\..\lib

C:\Development\Projects\Android\blackberry.tools.SDK\bin>java -Djava.awt.headless=true -Xmx512M -cp "C:\Development\Projects\Android\blackberry.tools.SDK\bin\\..\lib\BARPackager.jar;C:\Development\Projects\Android\blackberry.tools.SDK\bin\\..\lib\Apk2Bar.jar" net.rim.tools.apk2bar.Apk2Bar [Eclipse project folder] "C:\android-sdk\"
Apk2Bar version 1.5.2
Research In Motion Ltd ? 2012 All rights reserved.
[ERROR] Invalid argument: C:\android-sdk"
[ERROR] Android SDK path is not set.

 

 

It looks like some problem with the Android SDK but mine works just fine for Android projects. The BlackBerry 10 build process had been working fine for some time as well, and it's possible that some update to the Android SDK caused it to break, but I can't find a way of installing an old version of the SDK without going all the way back to SDK 1.6.

Please use plain text.
New Contributor
mhawes
Posts: 5
Registered: ‎05-03-2013
My Device: Developer (various devices)

Re: Android compile to blackberry error

Weirdly enough, it's suddenly started working from the command line, here's the command I used:

 

C:\Eclipse\Eclipse BB Android\plugins\net.rim.ajde_1.5.2.201302260701\blackberry.tools.SDK\bin>apk2bar [Eclipse project folder]\bin "C:\Program Files (x86)\Android\android-sdk"

 

 

And here's the output for what calls it made:

C:\Eclipse\Eclipse BB Android\plugins\net.rim.ajde_1.5.2.201302260701\blackberry.tools.SDK\bin>set LIB=C:\Eclipse\Eclipse BB Android\plugins\net.rim.ajde_1.5.2.201302260701\blackberry.tools.SDK\bin\\..\lib

C:\Eclipse\Eclipse BB Android\plugins\net.rim.ajde_1.5.2.201302260701\blackberry.tools.SDK\bin>java -Djava.awt.headless=true -Xmx512M -cp "C:\Eclipse\Eclipse BB Android\plugins\net.rim.ajde_1.5.2.201302260701\blackberry.tools.SDK\bin\\..\lib\BARPackager.jar;C:\Eclipse\Eclipse BB Android\plugins\net.rim.ajde_1.5.2.201302260701\blackberry.tools.SDK\bin\\..\lib\Apk2Bar.jar" net.rim.tools.apk2bar.Apk2Bar [Eclipse project folder]\bin "C:\Program Files (x86)\Android\android-sdk"

 

 

From there it goes ahead and repackages the project just fine.

 

It's still not working from Eclipse though, and it's having the same error as before with any call to that same tool. I've reinstalled Eclipse, the ADT plugin and the BlackBerry Android plugin, and it made no difference. Please help.

Please use plain text.
New Contributor
discordance
Posts: 5
Registered: ‎05-05-2013
My Device: Developer

Re: Android compile to blackberry error

As ndsmyter said you are having issues with quotes

 

[ERROR] Invalid argument: C:\Program Files (x86)\Android\android-sdk" -t C:\Development\Projects\Android\AndroidSVN\campusM_Android_Blackberry_Merged\dist\Android
[ERROR] Invalid argument: 2.3.3

 

C:\Development\Projects\Android\AndroidSVN\campusM_Android_Blackberry_Merged\dist\Android 2.3.3 is being split into two arguments because of the space and the lack of quotes around it. Fix your quotes or just stop using paths with spaces in for development. Dropping spaces is a little ugly but it saves you headaches like this.

Please use plain text.
New Contributor
mhawes
Posts: 5
Registered: ‎05-03-2013
My Device: Developer (various devices)

Re: Android compile to blackberry error

My eclipse project folder has no spaces in it, and if you look at the calls that were made, all of the paths with spaces in were surrounded by double quotes.

 

I tried uninstalling JRE 7 and just using 6, and now it works. I don't know for sure that that is what fixed it though, and I really do need to have JRE 7 installed. Let me know if you have any other ideas.

Please use plain text.
New Contributor
discordance
Posts: 5
Registered: ‎05-05-2013
My Device: Developer

Re: Android compile to blackberry error

[ Edited ]

Actually I think "dist/Android 2.3.3" is generated by the blackberry tools, thats where the bars are ending up right? Thats the folder its having issue with, if you haven't tweaked the blackberry tool paths yourself it could be an issue with default config from BB. It needs a double quote round the full path to that folder because of the space and its not getting it.

Please use plain text.
New Contributor
mhawes
Posts: 5
Registered: ‎05-03-2013
My Device: Developer (various devices)

Re: Android compile to blackberry error

But the quotes do match up... here's the call you're referring to:

 

C:\Eclipse\Eclipse BB Android>java -Djava.awt.headless=true -Xmx512M -cp "C:\Eclipse\Eclipse BB Android\plugins\net.rim.ajde_1.5.2.201302260701\bl

ackberry.tools.SDK\bin\\..\lib\BARPackager.jar;C:\Eclipse\Eclipse BB Android\plugins\net.rim.ajde_1.5.2.201302260701\blackberry.tools.SDK\bin\\..\lib\Apk2Bar.jar" net.rim.tools.apk2bar.Apk2Bar [Eclipse project folder]\bin\[apk name].apk [Eclipse project folder]\android.cfg "C:\Program Files (x86)\Android\android-sdk\" -t "[Eclipse project folder]\dist\Android 2.3.3"

 

It's got one pair of quotes around the references to all the jar files, one pair of quotes around the Android SDK directory, and one pair of quotes around the output folder here:

 

-t "[Eclipse project folder]\dist\Android 2.3.3"

Please use plain text.
New Contributor
discordance
Posts: 5
Registered: ‎05-05-2013
My Device: Developer

Re: Android compile to blackberry error

Are you still getting the original error?

 

[ERROR] Invalid argument: C:\Program Files (x86)\Android\android-sdk" -t C:\Development\Projects\Android\AndroidSVN\campusM_Android_Blackberry_Merged\dist\Android
[ERROR] Invalid argument: 2.3.3

 

I'm still talking about that one above, you might have sorted it already. If you are getting the above error maybe theres an odd number of quotes tripping it up.

Please use plain text.
New Contributor
mhawes
Posts: 5
Registered: ‎05-03-2013
My Device: Developer (various devices)

Re: Android compile to blackberry error

I've answered that already. I don't get where you're coming from. Let me reiterate. Here's the log of the error from Eclipse, along with the call that caused it:

 

 

C:\Eclipse\Eclipse BB Android>java -Djava.awt.headless=true -Xmx512M -cp "C:\Eclipse\Eclipse BB Android\plugins\net.rim.ajde_1.5.2.201302260701\blackberry.tools.SDK\bin\\..\lib\BARPackager.jar;C:\Eclipse\Eclipse BB Android\plugins\net.rim.ajde_1.5.2.201302260701\blackberry.tools.SDK\bin\\..\lib\Apk2Bar.jar" net.rim.tools.apk2bar.Apk2Bar [Eclipse project folder]\bin\[apk name].apk [Eclipse project folder]\android.cfg "C:\Program Files (x86)\Android\android-sdk\" -t "[Eclipse project folder]\dist\Android 2.3.3"


Apk2Bar version 1.5.2
Research In Motion Ltd ? 2012 All rights reserved.
[ERROR] Invalid argument: C:\Program Files (x86)\Android\android-sdk" -t C:\Development\Projects\Android\AndroidSVN\campusM_Android_Blackberry_Merged\dist\Android
[ERROR] Invalid argument: 2.3.3
[ERROR] Android SDK path is not set.

 

 

As you can see, the number of quotes in the call that caused the error is even, and they are correctly matched around the list of .jars, the Android SDK directory and the output directory. Just read it yourself.

 

Since then here's a list of things I've done:

 

1. Reinstalled the BlackBerry Eclipse plugin (still didn't work)

2. Reinstalled Eclipse and all the plugins (still didn't work)

3. Copied the Android SDK to the root directory, so its directory had no spaces in it, and pointed it at that (still didn't work, deleted that copy of the Android SDK immediately afterwards)

4. Uninstalled JRE 7 and ensured there was only one copy of the Java 6 JRE and JDK

 

It now works, with the original Android SDK directory and the original project directory and the original Eclipse directory. The call it's making to Apk2Bar I've copied in is still the same, but now it works. The problem is I need to be able to have JRE 7 installed, and I'm not even 100% sure that's the problem. Tomorrow I'll install JRE 7 again and see if that breaks it.

Please use plain text.