New Android Project Does not compile

I am coming back to re-evaluate Fire with swift as solution and I already have android studio and xcode installed and used both without issue. I installed Fire on my Mac and made sure the preference screen was correct and all items are listed as found.

I was able to create an empty iOS project and have it run successfully in the iOS simulator, but when I create an empty android project it won’t compile and I am looking for some direction. For now I will just paste the error, but I could paste the entire build log if necessary.

                            processing com/rgbz/mytestapp/MainActivity.class...
                            processing com/rgbz/mytestapp/R.class...
                            processing com/rgbz/mytestapp/R$attr.class...
                            processing com/rgbz/mytestapp/R$drawable.class...
                            processing com/rgbz/mytestapp/R$layout.class...
                            processing com/rgbz/mytestapp/R$string.class...
                            Run: "/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/bin/java"  -Xmx1024M -classpath "" com.android.sdklib.build.ApkBuilderMain "obj/Debug/Android/com.rgbz.mytestapp_unaligned.apk" -z "/Users/robertgreenberg/Dev/Fire/com.rgbz.mytestapp/obj/Debug/Android/com.rgbz.mytestapp_unsigned.apk" -v -rj  "/Applications/Fire.app/Contents/Resources/References/Cooper/swift.jar" -rj  "/Applications/Fire.app/Contents/Resources/References/Cooper/cooper.jar"

/Applications/Fire.app/Contents/Resources/XbuildTargets/RemObjects Software/Elements/RemObjects.Elements.Cooper.Android.targets: error : Error: Could not find or load main class com.android.sdklib.build.ApkBuilderMain
Task “AndroidPack” execution – FAILED
Done building target “CooperAndroidAfterCompile” in project “/Users/robertgreenberg/Dev/Fire/com.rgbz.mytestapp/com.rgbz.mytestapp.elements”.-- FAILED
Done building project “/Users/robertgreenberg/Dev/Fire/com.rgbz.mytestapp/com.rgbz.mytestapp.elements”.-- FAILED
Task “MSBuild” execution – FAILED
Done building target “Build” in project “/var/folders/87/f7yjhpx57mb89zcg4ws30hm00000gn/T/com.rgbz.mytestapp.fire.temp.sln”.-- FAILED
Done building project “/var/folders/87/f7yjhpx57mb89zcg4ws30hm00000gn/T/com.rgbz.mytestapp.fire.temp.sln”.-- FAILED

Build FAILED.
Errors:

/var/folders/87/f7yjhpx57mb89zcg4ws30hm00000gn/T/com.rgbz.mytestapp.fire.temp.sln (Build) ->
(Build target) ->
/Users/robertgreenberg/Dev/Fire/com.rgbz.mytestapp/com.rgbz.mytestapp.elements (default targets) ->
/Applications/Fire.app/Contents/Resources/XbuildTargets/RemObjects Software/Elements/RemObjects.Elements.Cooper.Android.targets (CooperAndroidAfterCompile target) ->

    /Applications/Fire.app/Contents/Resources/XbuildTargets/RemObjects Software/Elements/RemObjects.Elements.Cooper.Android.targets: error : Error: Could not find or load main class com.android.sdklib.build.ApkBuilderMain

     0 Warning(s)
     1 Error(s)

Time Elapsed 00:00:04.3487970

Any luck with this?

I have a similar problem in Windows, with Oxygene. I had Android Studio 2.1 and an old SDK installed. I was able to build and to edit the UI in Android Studio. Then I installed Android Studio 2.3 and the latest SDK (7.1.1 - 25).
No I get this error:
C:\Program Files (x86)\MSBuild\RemObjects Software\Elements\RemObjects.Elements.Cooper.Android.targets(285,3): error : Error: no se ha encontrado o cargado la clase principal com.android.sdklib.build.ApkBuilderMain
It can’t find the class com.android.sdklib.build.ApkBuilderMain
It seems they’ve changed the structure of the SDKs.

Also, If I try to edit the UI in Android Studio it says the project is corrupt.

I’m using latest 9.1 Beta

No luck yet. I am just evaluating the product so Im using fire 9.0.97.2071 (Master).

I can’t get a new empty android project to compile. So at this point I probably won’t pursue evaluating this product.

Hi, I’ve downloaded this version of the tools. I’ve extracted it to the SDK folder, after renaming the old tools to another thing, just in case I wanna go back.

https://dl-ssl.google.com/android/repository/tools_r20-windows.zip

Now I can build, so the problem is indeed related to the change of structure of the SDK.

Is there a definitive solution for this?

Regards

Ok, which SDK version(s), exactly, works fore and with doesn’t?

Ok, I’ve been doing some tests. This is what I’ve found:

  • The problem is not the SDK version. The problem is the tools. They removed some things from sdk/tools.
    Even after downloading an older SDK Version from the SDK Manager the tools seems to have the new structure.
    However I extracted the tools folder from the r20 tools and it builds again. Even if the SDK is the latest (25).
    Combining both folders also works. The files present only in r20 plus the existing files in r25.

  • UI integration with Android Studio is broken for Android Studio 2.2 and greater (I’ve installed 2.1, 2.2 and 2.3 to check it out).
    In 2.3 I also found some problems with the emulator and debugging. Maybe because of using the tools form r20. Now I’m going back to 2.1 (where the UI integration works) and see if launching the emulator and debugging works.

k, thanx! i’ll have a look tomorrow.

Let me know if you need me to test something.
I’ve just installed Fire + Android Studio 2.3 and the UI Designer is also missing on Mac.
On windows I’m now with Android Studio 2.3 and today’s beta.
The UI designer is missing, but at least I can build/debug (after mixing the tools folder from r20 with the tools from the SDK 25)

Hi, on Fire + Android Studio 2.3 + SDK 25 (installed by Android Studio) I get these errors:

Target CoreCompile:
        RemObjects Elements (Oxygene, C# and Swift) Compiler for .NET, Cocoa, Java and Island.
        Version 9.1.100.2115 (beta) built on talax, 20170310-164629. Commit d147ded.
        Copyright 2003-2017 RemObjects Software, LLC. All rights reserved.
        Source file: /Users/jasl/Documents/org.me.androidapplication/MainActivity.pas
        Source file: /Users/jasl/Documents/org.me.androidapplication/obj/Debug/Android/R.java
        Reference: /Users/jasl/Library/Android/sdk/platforms/android-25/android.jar
        Reference: /Applications/Fire.app/Contents/Resources/References/Cooper/cooper.jar
        Reference: /Applications/Fire.app/Contents/Resources/References/Cooper/elements.jar
: error JE20: Could not load referenced Java archive "/Users/jasl/Library/Android/sdk/platforms/android-25/android.jar": Could not load file or assembly 'Elements, Version=9.1.100.2115, Culture=neutral, PublicKeyToken=3df3cad1b7aa5098' or one of its dependencies.
: error JE20: Could not load referenced Java archive "/Applications/Fire.app/Contents/Resources/References/Cooper/cooper.jar": Could not load file or assembly 'Elements, Version=9.1.100.2115, Culture=neutral, PublicKeyToken=3df3cad1b7aa5098' or one of its dependencies.
: error JE20: Could not load referenced Java archive "/Applications/Fire.app/Contents/Resources/References/Cooper/elements.jar": Could not load file or assembly 'Elements, Version=9.1.100.2115, Culture=neutral, PublicKeyToken=3df3cad1b7aa5098' or one of its dependencies.

It’s just an empty Android Application.
It also fails if I try to build an empty console application:

/Applications/Fire.app/Contents/Resources/Mono/bin/mono /Applications/Fire.app/Contents/Resources/Mono/lib/mono/4.5/xbuild.exe "/property:ElementsXbuildNougatSDKFolder=/Applications/Fire.app/Contents/Resources/Toffee SDKs" "/property:ElementsXbuildToffeeSDKFolder=/Applications/Fire.app/Contents/Resources/Toffee SDKs" "/property:ElementsXbuildReferencePathsXMLFolder=/Applications/Fire.app/Contents/Resources/Reference Paths with Data Abstract Trial" /property:CrossBox=Local /var/folders/6y/66zx10vj6lx7lvv4sx_1c8wh0000gn/T/org.me.androidapplication.fire.temp.sln /nologo /target:Build /verbosity:normal /property:Configuration=Debug /property:TreatFixableErrorsAsWarnings=True /toolsversion:4.0
Build started 11/03/2017 11:55:18.
__________________________________________________
Project "/var/folders/6y/66zx10vj6lx7lvv4sx_1c8wh0000gn/T/org.me.androidapplication.fire.temp.sln" (Build target(s)):
        Target ValidateSolutionConfiguration:
                Building solution configuration "Debug|AnyCPU".
        Target Build:
                Project "/Users/jasl/Documents/org.me.androidapplication/consoleapplication/consoleapplication.elements" (default target(s)):
                        Target PrepareForBuild:
                                Configuration: Debug Platform: AnyCPU
                        Target CooperPreflight:
                                JDKRoot:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home
                                JRERoot:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre
                        Target ResolveGradleReferences:
                        No input files were specified for target ResolveGradleReferences, skipping.
                        Target ResolveAssemblyReferences:
                                Reference: rt
                                Reference: cooper
                                Reference: elements
                        Target GenerateSatelliteAssemblies:
                        No input files were specified for target GenerateSatelliteAssemblies, skipping.
                        Target CoreCompile:
                                RemObjects Elements (Oxygene, C# and Swift) Compiler for .NET, Cocoa, Java and Island.
                                Version 9.1.100.2115 (beta) built on talax, 20170310-164629. Commit d147ded.
                                Copyright 2003-2017 RemObjects Software, LLC. All rights reserved.
                                Source file: /Users/jasl/Documents/org.me.androidapplication/consoleapplication/Program.pas
                                Reference: /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/rt.jar
                                Reference: /Applications/Fire.app/Contents/Resources/References/Cooper/cooper.jar
                                Reference: /Applications/Fire.app/Contents/Resources/References/Cooper/elements.jar
: error JE20: Could not load referenced Java archive "/Applications/Fire.app/Contents/Resources/References/Cooper/cooper.jar": Could not load file or assembly 'Elements, Version=9.1.100.2115, Culture=neutral, PublicKeyToken=3df3cad1b7aa5098' or one of its dependencies.
: error JE20: Could not load referenced Java archive "/Applications/Fire.app/Contents/Resources/References/Cooper/elements.jar": Could not load file or assembly 'Elements, Version=9.1.100.2115, Culture=neutral, PublicKeyToken=3df3cad1b7aa5098' or one of its dependencies.
: error E0: Internal error: Could not load file or assembly 'Elements, Version=9.1.100.2115, Culture=neutral, PublicKeyToken=3df3cad1b7aa5098' or one of its dependencies.
                        Task "OxygeneCompiler" execution -- FAILED
                        Done building target "CoreCompile" in project "/Users/jasl/Documents/org.me.androidapplication/consoleapplication/consoleapplication.elements".-- FAILED
                Done building project "/Users/jasl/Documents/org.me.androidapplication/consoleapplication/consoleapplication.elements".-- FAILED
        Task "MSBuild" execution -- FAILED
        Done building target "Build" in project "/var/folders/6y/66zx10vj6lx7lvv4sx_1c8wh0000gn/T/org.me.androidapplication.fire.temp.sln".-- FAILED
Done building project "/var/folders/6y/66zx10vj6lx7lvv4sx_1c8wh0000gn/T/org.me.androidapplication.fire.temp.sln".-- FAILED

Build FAILED.
Errors:

/var/folders/6y/66zx10vj6lx7lvv4sx_1c8wh0000gn/T/org.me.androidapplication.fire.temp.sln (Build) ->
(Build target) ->
/Users/jasl/Documents/org.me.androidapplication/consoleapplication/consoleapplication.elements (default targets) ->
/Applications/Fire.app/Contents/Resources/XbuildTargets/RemObjects Software/Elements/RemObjects.Elements.Cooper.Common.targets (CoreCompile target) ->

        : error JE20: Could not load referenced Java archive "/Applications/Fire.app/Contents/Resources/References/Cooper/cooper.jar": Could not load file or assembly 'Elements, Version=9.1.100.2115, Culture=neutral, PublicKeyToken=3df3cad1b7aa5098' or one of its dependencies.
        : error JE20: Could not load referenced Java archive "/Applications/Fire.app/Contents/Resources/References/Cooper/elements.jar": Could not load file or assembly 'Elements, Version=9.1.100.2115, Culture=neutral, PublicKeyToken=3df3cad1b7aa5098' or one of its dependencies.
        : error E0: Internal error: Could not load file or assembly 'Elements, Version=9.1.100.2115, Culture=neutral, PublicKeyToken=3df3cad1b7aa5098' or one of its dependencies.

         0 Warning(s)
         3 Error(s)

Time Elapsed 00:00:01.4912990

Actually, this was a regression in .2113, and should be fixed in .2115 (out yesterday), but it should also not happen with 9.0. This has nothing to do with Android, .2113 was just completely broken because a couple of new compiler .dlls were not properly registered.

Can you retry with the new beta?

That was with .2115
I installed it just to check it out. + JDK 1.8 + Android Studio 2.3 + SDK 25
The problems reported for windows are also tested with .2115, VS 2015 instead of Fire.

Regards

Hmm, weird. i had that bug fixed and a couple people confirmed it with custom .2114 builds i sent them. i’ll need to investigate further. That said, this problem definkitely is/was Fire speciifc, so i can’t believe it also shows on Windows with VS…

Reproduced; fixing.

Yes Fire and Windows problems are different. What they have in common is you cannot build android apps, that’s why I’m reporting them together.

On the other hand, the problem with the UI designer in Android Studio 2.2+ must be the same for Windows and Mac.
Please try with Android Studio 2.3

Regards

The problem is, its really tough to diagnose and narrow down a problem if there’s three separate issues intermingled in one report. :wink: I’m fixing the Fire issue, then i’ll look at the rest. Please retest with Fire and let me know what (if any) errors you get now, when .2116 is up (in ~30m or so).

thanx!
marc

I’ll do it.

I understand :wink:

Just to help to clarify the independent problems:
1 .- This last one about Fire not finding jar files.
2 .- The UI designer is not shown in Android Studio 2.3 and above, when you use “Edit UI files in Android Studio”
3.- VS 2015 trying to build Android Apps with recent SDKs: RemObjects.Elements.Cooper.Android.targets(285,3): error : Error: no se ha encontrado o cargado la clase principal com.android.sdklib.build.ApkBuilderMain
4.- Problems with AVDs + Debugging. I’ve not reported this in detail because I want to wait to be able to build without touching the SDK’s tools folder.

I can separate them in different posts if you want.

Regards

Ok,

1: should be fixed with .2116 going up now (eta 10 minutes
2: i believe i can reproduce this: i see this: http://share.dwarfland.com/jVp8, do you see the same message?
3: i can’t/won’t test VS2015 until Monday (because life’s too short for Windows on the weekend ;). in Fire, i have no problems building my own Android app, against 25 and with ADS 2.3 installed. I’d appreciate if you could (a) let me know if this issue also shows in Fire, for you, once 1 is fixed and (b) send me your test project and a complete build log from VS (if it does not) or from Fire (if it does).
4: i’d appreciate more details on this.

Curious: http://share.dwarfland.com/jWHP

ps: .2116 is up now.

Downloading

Yes, but I think there is more. At some point, somehow, that message wasn’t showing, but still the Designer tab was missing.
I’ve also realized that the res folder is not marked as the “resources folder” in the project structure editor.

Fair enough :slight_smile:
My test project is just an empty Android Application, as you get it from the template. So If you can build in fire, I suppose it only happens on windows.

I think is related with this:

But I need to do more testing.

Regards

It’s weird. its like ADS doesn’t see 25 even though it’s installed. That’s why the designers don’t show. I’ll investigate more tomorrow or monday…