So I have tried using Fire (the latest beta just downloaded) and then opened Sugar.sln. I have compiled the
Sugar.Cooper target and I get errors:
mono /Applications/Fire.app/Contents/Resources/Mono/lib/mono/4.5/xbuild.exe /Volumes/MacHDD2/Developmemt/Java/sugar/Sugar.sln /nologo /target:Build /verbosity:normal /property:Configuration=Debug "/property:ElementsXbuildNougatSDKFolder=/Applications/Fire.app/Contents/Resources/Nougat SDKs" "/property:ElementsXbuildReferencePathsXMLFolder=/Applications/Fire.app/Contents/Resources/Reference Paths with Data Abstract Trial" /toolsversion:4.0
Build started 14/12/2015 18:58:58.
__________________________________________________
/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar.Data/Sugar.Data.Echoes.WP8.oxygene: warning : Could not find project file /Applications/Fire.app/Contents/Resources/XbuildTargets/RemObjects Software/Oxygene/WindowsPhone/v8.0/RemObjects.Oxygene.Echoes.WindowsPhone.targets, to import. Ignoring.
/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Echoes.WP8.oxygene: warning : Could not find project file /Applications/Fire.app/Contents/Resources/XbuildTargets/RemObjects Software/Oxygene/WindowsPhone/v8.0/RemObjects.Oxygene.Echoes.WindowsPhone.targets, to import. Ignoring.
Project "/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar.sln" (Build target(s)):
Target ValidateSolutionConfiguration:
Building solution configuration "Debug|AnyCPU".
Target Build:
Project "/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Nougat.OSX.oxygene" (default target(s)):
Target PrepareForBuild:
Configuration: Debug Platform: AnyCPU
Target GenerateSatelliteAssemblies:
No input files were specified for target GenerateSatelliteAssemblies, skipping.
Target CoreCompile:
Skipping target "CoreCompile" because its outputs are up-to-date.
Target CopyFXToOutputDirectory:
Copying file from '/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/obj/Debug/OS X/libSugar.fx' to '/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/bin/OS X/libSugar.fx'
('$(RunPostBuildEvent)' != 'OnOutputUpdated' or
'$(_AssemblyModifiedTimeBeforeCompile)' != '$(_AssemblyModifiedTimeAfterCompile)')
Done building project "/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Nougat.OSX.oxygene".
Project "/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Nougat.iOS.oxygene" (default target(s)):
Target PrepareForBuild:
Configuration: Debug Platform: AnyCPU
Target GenerateSatelliteAssemblies:
No input files were specified for target GenerateSatelliteAssemblies, skipping.
Target CoreCompile:
Skipping target "CoreCompile" because its outputs are up-to-date.
Target CopyFXToOutputDirectory:
Copying file from '/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/obj/Debug/iOS/libSugar.fx' to '/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/bin/iOS/libSugar.fx'
('$(RunPostBuildEvent)' != 'OnOutputUpdated' or
'$(_AssemblyModifiedTimeBeforeCompile)' != '$(_AssemblyModifiedTimeAfterCompile)')
Done building project "/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Nougat.iOS.oxygene".
Project "/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Nougat.tvOS.oxygene" (default target(s)):
Target PrepareForBuild:
Configuration: Debug Platform: AnyCPU
Target GenerateSatelliteAssemblies:
No input files were specified for target GenerateSatelliteAssemblies, skipping.
Target CoreCompile:
Skipping target "CoreCompile" because its outputs are up-to-date.
Target CopyFXToOutputDirectory:
Copying file from '/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/obj/Debug/tvOS/libSugar.fx' to '/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/bin/tvOS/libSugar.fx'
('$(RunPostBuildEvent)' != 'OnOutputUpdated' or
'$(_AssemblyModifiedTimeBeforeCompile)' != '$(_AssemblyModifiedTimeAfterCompile)')
Done building project "/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Nougat.tvOS.oxygene".
Project "/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Nougat.watchOS.oxygene" (default target(s)):
Target GetTargetSDK:
: CrossBox error GetTargetSDKType: No matching version of Unknown has been found that is supported by both your local .fx files (supported versions are: none) and the active version of Xcode (supported versions are: none).
Visit the following URL to read more about getting support for other SDK versions: http://docs.elementscompiler.com/Platforms/Cocoa/ImportingSDKs
Task "GetTargetSDKType" execution -- FAILED
Done building target "GetTargetSDK" in project "/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Nougat.watchOS.oxygene".-- FAILED
Done building project "/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Nougat.watchOS.oxygene".-- FAILED
Project "/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Cooper.oxygene" (default target(s)):
Target PrepareForBuild:
Configuration: Debug Platform: AnyCPU
Target CooperPreflight:
JDKRoot:/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home
JRERoot:/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre
Target ResolveAssemblyReferences:
Reference: com.remobjects.elements.rtl.jar
Reference: rt.jar
Target GenerateSatelliteAssemblies:
No input files were specified for target GenerateSatelliteAssemblies, skipping.
Target CoreCompile:
Skipping target "CoreCompile" because its outputs are up-to-date.
('$(RunPostBuildEvent)' != 'OnOutputUpdated' or
'$(_AssemblyModifiedTimeBeforeCompile)' != '$(_AssemblyModifiedTimeAfterCompile)')
Target CooperAfterCompile:
Skipping target "CooperAfterCompile" because its outputs are up-to-date.
Done building project "/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Cooper.oxygene".
Project "/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Cooper.Android.oxygene" (default target(s)):
Target CooperPreflight:
JDKRoot:/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home
JRERoot:/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre
Target PrepareForBuild:
Configuration: Debug Platform: AnyCPU
Target ResolveAssemblyReferences:
Reference: android.jar
Reference: com.remobjects.elements.rtl.jar
Target GenerateSatelliteAssemblies:
No input files were specified for target GenerateSatelliteAssemblies, skipping.
Target CoreCompile:
Skipping target "CoreCompile" because its outputs are up-to-date.
('$(RunPostBuildEvent)' != 'OnOutputUpdated' or
'$(_AssemblyModifiedTimeBeforeCompile)' != '$(_AssemblyModifiedTimeAfterCompile)')
Done building project "/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Cooper.Android.oxygene".
Project "/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Echoes.oxygene" (default target(s)):
Target PrepareForBuild:
Configuration: Debug Platform: AnyCPU
Target GenerateSatelliteAssemblies:
No input files were specified for target GenerateSatelliteAssemblies, skipping.
Target CoreCompile:
Skipping target "CoreCompile" because its outputs are up-to-date.
('$(RunPostBuildEvent)' != 'OnOutputUpdated' or
'$(_AssemblyModifiedTimeBeforeCompile)' != '$(_AssemblyModifiedTimeAfterCompile)')
Done building project "/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Echoes.oxygene".
/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Echoes.WP8.oxygene: error : /Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Echoes.WP8.oxygene: /Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Echoes.WP8.oxygene could not import "$(MSBuildExtensionsPath)/RemObjects Software/Oxygene/$(TargetFrameworkIdentifier)/$(TargetFrameworkVersion)/RemObjects.Oxygene.Echoes.$(TargetFrameworkIdentifier).targets"
at Microsoft.Build.BuildEngine.Import.ForEachExtensionPathTillFound (System.Xml.XmlElement xmlElement, Microsoft.Build.BuildEngine.Project project, Microsoft.Build.BuildEngine.ImportedProject importingProject, System.Func`3 func) <0x10a3a45b0 + 0x00adb> in <filename unknown>:0
at Microsoft.Build.BuildEngine.Project.AddImport (System.Xml.XmlElement xmlElement, Microsoft.Build.BuildEngine.ImportedProject importingProject, Boolean evaluate_properties) <0x10a3a4260 + 0x002b4> in <filename unknown>:0
at Microsoft.Build.BuildEngine.Project.ProcessElements (System.Xml.XmlElement rootElement, Microsoft.Build.BuildEngine.ImportedProject ip) <0x1095e7170 + 0x00441> in <filename unknown>:0
at Microsoft.Build.BuildEngine.Project.ProcessXml () <0x1095e08e0 + 0x005e1> in <filename unknown>:0
at Microsoft.Build.BuildEngine.Project.DoLoad (System.IO.TextReader textReader) <0x1095eb940 + 0x004b0> in <filename unknown>:0
--- End of inner exception stack trace ---
at Microsoft.Build.BuildEngine.Project.DoLoad (System.IO.TextReader textReader) <0x1095eb940 + 0x00593> in <filename unknown>:0
at Microsoft.Build.BuildEngine.Project.Load (System.String projectFileName, ProjectLoadSettings settings) <0x1095e8f00 + 0x0049d> in <filename unknown>:0
at Microsoft.Build.BuildEngine.Project.Load (System.String projectFileName) <0x1095e8ec0 + 0x0001b> in <filename unknown>:0
at Microsoft.Build.BuildEngine.Engine.BuildProjectFileInternal (System.String projectFile, System.String[] targetNames, Microsoft.Build.BuildEngine.BuildPropertyGroup globalProperties, IDictionary targetOutputs, BuildSettings buildFlags, System.String toolsVersion) <0x10a39f8b0 + 0x003f0> in <filename unknown>:0
at Microsoft.Build.BuildEngine.Engine.BuildProjectFile (System.String projectFile, System.String[] targetNames, Microsoft.Build.BuildEngine.BuildPropertyGroup globalProperties, IDictionary targetOutputs, BuildSettings buildFlags, System.String toolsVersion) <0x10a39e470 + 0x00088> in <filename unknown>:0
Project "/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Echoes.WinRT.oxygene" (default target(s)):
Target _ValidateWinRT:
/Applications/Fire.app/Contents/Resources/XbuildTargets/RemObjects Software/Oxygene/RemObjects.Oxygene.Echoes.WinRT.targets: error : Building for WinRT is currently only supported on Windows
Task "Error" execution -- FAILED
Done building target "_ValidateWinRT" in project "/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Echoes.WinRT.oxygene".-- FAILED
Done building project "/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Echoes.WinRT.oxygene".-- FAILED
Task "MSBuild" execution -- FAILED
Done building target "Build" in project "/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar.sln".-- FAILED
Done building project "/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar.sln".-- FAILED
Build FAILED.
Warnings:
/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar.Data/Sugar.Data.Echoes.WP8.oxygene: warning : Could not find project file /Applications/Fire.app/Contents/Resources/XbuildTargets/RemObjects Software/Oxygene/WindowsPhone/v8.0/RemObjects.Oxygene.Echoes.WindowsPhone.targets, to import. Ignoring.
/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Echoes.WP8.oxygene: warning : Could not find project file /Applications/Fire.app/Contents/Resources/XbuildTargets/RemObjects Software/Oxygene/WindowsPhone/v8.0/RemObjects.Oxygene.Echoes.WindowsPhone.targets, to import. Ignoring.
Errors:
/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar.sln (Build) ->
(Build target) ->
/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Nougat.watchOS.oxygene (default targets) ->
/Applications/Fire.app/Contents/Resources/XbuildTargets/RemObjects Software/Oxygene/RemObjects.Oxygene.Nougat.targets (GetTargetSDK target) ->
: CrossBox error GetTargetSDKType: No matching version of Unknown has been found that is supported by both your local .fx files (supported versions are: none) and the active version of Xcode (supported versions are: none).
/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar.sln (Build) ->
(Build target) ->
/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Echoes.WP8.oxygene: error : /Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Echoes.WP8.oxygene: /Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Echoes.WP8.oxygene could not import "$(MSBuildExtensionsPath)/RemObjects Software/Oxygene/$(TargetFrameworkIdentifier)/$(TargetFrameworkVersion)/RemObjects.Oxygene.Echoes.$(TargetFrameworkIdentifier).targets"
/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar.sln (Build) ->
(Build target) ->
/Volumes/MacHDD2/Developmemt/Java/sugar/Sugar/Sugar.Echoes.WinRT.oxygene (default targets) ->
/Applications/Fire.app/Contents/Resources/XbuildTargets/RemObjects Software/Oxygene/RemObjects.Oxygene.Echoes.WinRT.targets (_ValidateWinRT target) ->
/Applications/Fire.app/Contents/Resources/XbuildTargets/RemObjects Software/Oxygene/RemObjects.Oxygene.Echoes.WinRT.targets: error : Building for WinRT is currently only supported on Windows
2 Warning(s)
3 Error(s)
Time Elapsed 00:00:03.4653000
Looks like your xcode install is different than what we expect and the WinPhone one doesn’t build (that last one expected). However here’s a zip with the fixed sugar jar:
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
MiaClasse2 sampleAPI = new MiaClasse2();
String apiURL = "http://www.musixmatch.com";
sampleAPI.httpCall(apiURL);
int result = sampleAPI.add__b(5,12);
Log.d("TEST", Integer.toString(result));
}
//…
The issue was:
Caused by: java.lang.ClassNotFoundException: Didn’t find class “java.awt.EventQueue” on path: DexPathList[[zip file “/data/app/musixmatch.com.sampleandroidapp-2/base.apk”],nativeLibraryDirectories=[/data/app/musixmatch.com.sampleandroidapp-2/lib/arm, /vendor/lib, /system/lib]]
Following the full stacktrace:
12-15 12:07:27.675 30350-30350/? I/art: Late-enabling -Xcheck:jni
12-15 12:07:27.743 30350-30350/musixmatch.com.sampleandroidapp W/System: ClassLoader referenced unknown path: /data/app/musixmatch.com.sampleandroidapp-2/lib/arm
12-15 12:07:27.842 30350-30350/musixmatch.com.sampleandroidapp I/System.out: http://www.musixmatch.com
12-15 12:07:27.846 30350-30350/musixmatch.com.sampleandroidapp D/AndroidRuntime: Shutting down VM
12-15 12:07:27.848 30350-30350/musixmatch.com.sampleandroidapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: musixmatch.com.sampleandroidapp, PID: 30350
java.lang.ExceptionInInitializerError
at com.remobjects.elements.system.FutureHelper.ExecuteAsync()
at sugar.Http.ExecuteRequest()
at samplelibrary.MiaClasse2.httpCall(/Users/admin/Documents/StaticLibrary/SharedProject/Library.swift:16)
at musixmatch.com.sampleandroidapp.MainActivity.onCreate(MainActivity.java:36)
at android.app.Activity.performCreate(Activity.java:6251)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.ClassNotFoundException: Didn’t find class “java.awt.EventQueue” on path: DexPathList[[zip file “/data/app/musixmatch.com.sampleandroidapp-2/base.apk”],nativeLibraryDirectories=[/data/app/musixmatch.com.sampleandroidapp-2/lib/arm, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at com.remobjects.elements.system.AWTThreadSyncHelper.()
at com.remobjects.elements.system.Task.()
at com.remobjects.elements.system.FutureHelper.ExecuteAsync()
at sugar.Http.ExecuteRequest()
at samplelibrary.MiaClasse2.httpCall(/Users/admin/Documents/StaticLibrary/SharedProject/Library.swift:16)
at musixmatch.com.sampleandroidapp.MainActivity.onCreate(MainActivity.java:36)
at android.app.Activity.performCreate(Activity.java:6251)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Suppressed: java.lang.ClassNotFoundException: java.awt.EventQueue
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
… 19 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
12-15 12:07:32.844 30350-30350/? I/Process: Sending signal. PID: 30350 SIG: 9
@ck Yes please. Drop me your email, I’m going to send you both the Fire project with the cross-library test and the sample android app (from AndroidStudio).
Thanks for the updated jar. This time I get it working partially. In fact I can see a logging withing the sdk, but the HTTP request started.
And it works for both the ExecuteRequestAsJson and ExecuteRequest.
Now I have two questions
How to pass back the json object to the Android couterpart to have it like a parsable json object i.e. which is the Sugar.Json.JsonDocument mapping in Android and iOS of course)?
How to write this completion handler with no errors:
// this code generates a "No matching overload" error.
let plainCallback: HttpResponseBlock<String!>! = { response in
Json doesn’t map on Java (since there’s no json class included with Java); The classes are plainly usable from java, in the sugar.json namespace (JsonObject and friends).[quote=“Loreto_Parisi, post:18, topic:7719”]
How to write this completion handler with no errors:
// this code generates a “No matching overload” error. let plainCallback: HttpResponseBlock! = { response in
} Http.ExecuteRequest(Url( url ), plainCallback)
[/quote]
I think it wants a HttpResponseBlock, not HttpResponseBlock! does it say something more as a hint?