Swift to Android Tutorial

Hi,
I am relatively new to Swift 2.x (barely 3 month into it) but I have a working app on Apple App store already. I heard of Elements Silver, and thought of learning more about it via this tutorial

However, being a even bigger noob on Android development environment, I have faced errors which I have no idea how to resolve.

I have followed the tutorial up to the final section of “Running Your App” but am served with the following:
Waiting for Debugger
Application org.me.androidapplication (process org.me.android application) is waiting for the debugger to attached. (Force close button)

In my FIRE, under project Settings, I managed to set the USER column of Crossbox to the emulator virtual device. However, under DEBUG column, the dropdown menu for Crossbox row only shows GENERIC ANDROID DEVICE . Same for RELEASE, PROJECT, DEFAULT

I suspect this is the cause of problem. But how do I resolve this?

Many thanks in advanced.

When you run adb devices from the command line, does your device show there?

Oh I forgot to mention, that error appeared on Mac OS Fire

Sorry I am very new to this, but I assume TERMINAL is COMMAND LINE equilvilent? Tried adb devices on terminal and it says command not found

I’ve attached what the settings look like. No idea what I am doing wrong :expressionless:



abd is located in the android sdk folder. It won’t be found in terminal by default, you’ll need to specify the path — or open the terminal to the android sdk folder from fire’s Tools menu.

I am pretty sure I am missing something critical here…

Last login: Tue Apr 12 12:35:14 on ttys001
BT-MacBook-Pro:~ boon$ cd /Users/boon/Library/Android/sdk/platform-tools
BT-MacBook-Pro:platform-tools boon$ adb devices
-bash: adb: command not found
BT-MacBook-Pro:platform-tools boon$

You need to use ./ on UNIX to execute a file on the local folder. So ./adb, not just adb.

Oh Thanks. Got it

As per original question on whether the device appears on the list:

BT-MacBook-Pro:platform-tools boon$ ./adb devices
List of devices attached
emulator-5554 device

The Debug column still doens’t allow me to select anything else other than “Generic Android Device”

Top right corner of Fire says “Debug Session failed”

Build log says the following

mono /Applications/Developer/Fire.app/Contents/Resources/Mono/lib/mono/4.5/xbuild.exe /var/folders/r4/1l70c0xs3n3g14tccd9638xc0000gn/T/org.me.androidapplication.fire.temp.sln /nologo /target:Build /verbosity:normal /property:Configuration=Debug "/property:ElementsXbuildNougatSDKFolder=/Applications/Developer/Fire.app/Contents/Resources/Nougat SDKs" "/property:ElementsXbuildReferencePathsXMLFolder=/Applications/Developer/Fire.app/Contents/Resources/Reference Paths with Data Abstract Trial" /toolsversion:4.0

Build started 12/4/2016 12:23:36 pm.
__________________________________________________
Project "/var/folders/r4/1l70c0xs3n3g14tccd9638xc0000gn/T/org.me.androidapplication.fire.temp.sln" (Build target(s)):
        Target ValidateSolutionConfiguration:
                Building solution configuration "Debug|AnyCPU".
        Target Build:
                Project "/Users/boon/Downloads/org.me.androidapplication/org.me.androidapplication.elements" (default target(s)):
                        Target CooperPreflight:
                                JDKRoot:/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home
                                JRERoot:/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/jre
                        Target PrepareForBuild:
                                Configuration: Debug Platform: AnyCPU
                        Target ResolveGradleReferences:
                        No input files were specified for target ResolveGradleReferences, skipping.
                        Target ResolveAssemblyReferences:
                                Reference: android
                                Reference: swift
                                Reference: cooper
                        Target CooperAndroidBeforeCompile:
                                XML: /Users/boon/Library/Application Support/RemObjects Software/Elements/CooperPaths.xml
                                Run: "/Users/boon/Library/Android/sdk/build-tools/23.0.3/aapt" package -f -v --auto-add-overlay -M "/Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/AndroidManifest.xml" -S "/Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/res" -I "/Users/boon/Library/Android/sdk/platforms/android-23/android.jar" -J "/Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android" -F "/Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/org.me.androidapplication_unsigned.apk"
                                  Configurations:
                                   (default)
                                   ldpi-v4
                                   mdpi-v4
                                   hdpi-v4
                                   xhdpi-v4
                                  Files:
                                    drawable/icon.png
                                      Src: (ldpi-v4) /Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/res/drawable-ldpi/icon.png
                                      Src: (mdpi-v4) /Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/res/drawable-mdpi/icon.png
                                      Src: (hdpi-v4) /Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/res/drawable-hdpi/icon.png
                                      Src: (xhdpi-v4) /Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/res/drawable-xhdpi/icon.png
                                    layout/main.layout-xml
                                      Src: () /Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/res/layout/main.layout-xml
                                    values/strings.xml
                                      Src: () /Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/res/values/strings.xml
                                    AndroidManifest.xml
                                      Src: () /Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/AndroidManifest.xml
                                  Resource Dirs:
                                    Type drawable
                                      drawable/icon.png
                                        Src: (ldpi-v4) /Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/res/drawable-ldpi/icon.png
                                        Src: (mdpi-v4) /Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/res/drawable-mdpi/icon.png
                                        Src: (hdpi-v4) /Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/res/drawable-hdpi/icon.png
                                        Src: (xhdpi-v4) /Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/res/drawable-xhdpi/icon.png
                                    Type layout
                                      layout/main.layout-xml
                                        Src: () /Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/res/layout/main.layout-xml
                                    Type values
                                      values/strings.xml
                                        Src: () /Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/res/values/strings.xml
                                  Including resources from package: /Users/boon/Library/Android/sdk/platforms/android-23/android.jar
                                  applyFileOverlay for drawable
                                  applyFileOverlay for layout
                                  applyFileOverlay for anim
                                  applyFileOverlay for animator
                                  applyFileOverlay for interpolator
                                  applyFileOverlay for transition
                                  applyFileOverlay for xml
                                  applyFileOverlay for raw
                                  applyFileOverlay for color
                                  applyFileOverlay for menu
                                  applyFileOverlay for mipmap
                                  Processing image: /Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/res/drawable-ldpi/icon.png
                                  Processing image: /Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/res/drawable-mdpi/icon.png
                                  Processing image: /Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/res/drawable-hdpi/icon.png
                                  Processing image: /Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/res/drawable-xhdpi/icon.png
                                      (processed image /Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/res/drawable-ldpi/icon.png: 106% size of source)
                                      (processed image /Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/res/drawable-mdpi/icon.png: 104% size of source)
                                      (processed image /Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/res/drawable-hdpi/icon.png: 105% size of source)
                                      (processed image /Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/res/drawable-xhdpi/icon.png: 106% size of source)
                                      (new resource id icon from ldpi-v4/drawable/icon.png #generated)
                                      (new resource id icon from mdpi-v4/drawable/icon.png #generated)
                                      (new resource id icon from hdpi-v4/drawable/icon.png #generated)
                                      (new resource id icon from xhdpi-v4/drawable/icon.png #generated)
                                      (new resource id main from /Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/res/layout/main.layout-xml)
                                    Writing symbols for class R.
                                  Opening '/Users/boon/Downloads/org.me.androidapplication/obj/Debug/Android/org.me.androidapplication_unsigned.apk'
                                  Writing all files...
                                        'AndroidManifest.xml' (compressed 63%)
                                        'res/drawable-hdpi-v4/icon.png' (not compressed)
                                        'res/drawable-ldpi-v4/icon.png' (not compressed)
                                        'res/drawable-mdpi-v4/icon.png' (not compressed)
                                        'res/drawable-xhdpi-v4/icon.png' (not compressed)
                                        'res/layout/main.layout-xml' (compressed 64%)
                                        'resources.arsc' (not compressed)
                                  Generated 7 files
                                  Included 0 files from jar/zip files.
                                  Checking for deleted files
                                  Done!
                        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 CooperAndroidAfterCompile:
                        Skipping target "CooperAndroidAfterCompile" because its outputs are up-to-date.
                Done building project "/Users/boon/Downloads/org.me.androidapplication/org.me.androidapplication.elements".
Done building project "/var/folders/r4/1l70c0xs3n3g14tccd9638xc0000gn/T/org.me.androidapplication.fire.temp.sln".

Build succeeded.
         0 Warning(s)
         0 Error(s)

Time Elapsed 00:00:00.5304980

That’s your problem, then. I can’t tell you WHY it’s not listed, but the core Android SDK does not recognize or see your device. As a result, Fire does not see it either, but it’s not a problem within Fire that’s causing that, Fire just goes by what the SDK tells it. (Android Studio would not see the device either).

I suggest to check with the manufacturer to see if there are any drivers you might need to install, or anything of the sorts. Also, maybe double check that your Windows VM is not accidentally grabbing access to the device, and preventing Mac OS X to see it.