Android Layout Constraints

Hi everyone! Has anyone tried setting up fire to use the new layout constraints for xml android? … or it’s not supported yet?

You can use all XML Layout features supported by Android, in Elememts. We don’t touch the layout files at all, we just pass them thru.

Thanks marc! :slight_smile: but I’m having an error message even though build is successful … :frowning:

Screenshot:

Ok, that error comes from the Android build chain, not from our compiler. Check the complete build log for details; if the value is valid and should be known, maybe you are missing a reference to the Android library that pulls this in? What build of Elements are you using? I recommend trying the latest 8.4 beta, as we recently made a lot of improvements to the Android build chain, especially for references, gradle, and for the pre- and post-compile tools.

Thanks marc! I used build 8.3.93.1987 for the project. I’ll try this with the 8.4 beta … I’m also using the canary branch of the android sdk

1 Like

Hi there, any news about this topic? I have the same issue with Elements 9 and android tool 25.0.3. The aapt version is:
Android Asset Packaging Tool, v0.2-3544217

The full output is:

mono /Applications/Fire.app/Contents/Resources/Mono/lib/mono/4.5/xbuild.exe /var/folders/1t/fm6h918s5m126yf4cq_sl_m00000gn/T/com.wbigger.simonsaysfirebase.fire.temp.sln /nologo /target:Build /verbosity:normal /property:Configuration=Debug "/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" /toolsversion:4.0

Build started 3/17/2017 3:02:41 PM.
__________________________________________________
Project "/var/folders/1t/fm6h918s5m126yf4cq_sl_m00000gn/T/com.wbigger.simonsaysfirebase.fire.temp.sln" (Build target(s)):
        Target ValidateSolutionConfiguration:
                Building solution configuration "Debug|AnyCPU".
        Target Build:
                Project "/Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/com.wbigger.simonsaysfirebase.elements" (default target(s)):
                        Target CooperPreflight:
                                JDKRoot:/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home
                                JRERoot:/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/jre
                        Target PrepareForBuild:
                                Configuration: Debug Platform: AnyCPU
                        Target ResolveGradleReferences:
                        No input files were specified for target ResolveGradleReferences, skipping.
                        Target HandleAARFiles:
                        No input files were specified for target HandleAARFiles, skipping.
                        Target ResolveAssemblyReferences:
                                Reference: android
                                Reference: swift
                                Reference: cooper
                        Target CooperAndroidBeforeCompile:
                                XML: /Users/claudio/Library/Application Support/RemObjects Software/Elements/CooperPaths.xml
                                Run: "/Users/claudio/Library/Android/sdk/build-tools/25.0.2/aapt" package -f -v --auto-add-overlay -M "/Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/AndroidManifest.xml" -S "/Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res" -I "/Users/claudio/Library/Android/sdk/platforms/android-25/android.jar" -J "/Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android" -F "/Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/com.wbigger.simonsaysfirebase_unsigned.apk"
/Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml(9,1):  Androiderror Android: No resource identifier found for attribute 'layout_constraintBottom_toBottomOf' in package 'com.wbigger.simonsaysfirebase'
/Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml(9,1):  Androiderror Android: No resource identifier found for attribute 'layout_constraintLeft_toLeftOf' in package 'com.wbigger.simonsaysfirebase'
/Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml(9,1):  Androiderror Android: No resource identifier found for attribute 'layout_constraintRight_toLeftOf' in package 'com.wbigger.simonsaysfirebase'
/Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml(9,1):  Androiderror Android: No resource identifier found for attribute 'layout_constraintTop_toTopOf' in package 'com.wbigger.simonsaysfirebase'
/Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml(9,1):  Androiderror Android: No resource identifier found for attribute 'layout_constraintVertical_bias' in package 'com.wbigger.simonsaysfirebase'
/Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml(28,1):  Androiderror Android: No resource identifier found for attribute 'layout_constraintBottom_toBottomOf' in package 'com.wbigger.simonsaysfirebase'
/Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml(28,1):  Androiderror Android: No resource identifier found for attribute 'layout_constraintHorizontal_bias' in package 'com.wbigger.simonsaysfirebase'
/Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml(28,1):  Androiderror Android: No resource identifier found for attribute 'layout_constraintLeft_toLeftOf' in package 'com.wbigger.simonsaysfirebase'
/Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml(28,1):  Androiderror Android: No resource identifier found for attribute 'layout_constraintRight_toRightOf' in package 'com.wbigger.simonsaysfirebase'
/Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml(28,1):  Androiderror Android: No resource identifier found for attribute 'layout_constraintTop_toTopOf' in package 'com.wbigger.simonsaysfirebase'
/Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml(28,1):  Androiderror Android: No resource identifier found for attribute 'layout_constraintVertical_bias' in package 'com.wbigger.simonsaysfirebase'
/Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml(50,1):  Androiderror Android: No resource identifier found for attribute 'layout_constraintGuide_percent' in package 'com.wbigger.simonsaysfirebase'
                                Configurations:
                                (default)
                                ldpi-v4
                                mdpi-v4
                                hdpi-v4
                                xhdpi-v4
                                Files:
                                anim/blink_animation.xml
                                Src: () /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/anim/blink_animation.xml
                                drawable/icon.png
                                Src: (ldpi-v4) /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/drawable-ldpi/icon.png
                                Src: (mdpi-v4) /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/drawable-mdpi/icon.png
                                Src: (hdpi-v4) /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/drawable-hdpi/icon.png
                                Src: (xhdpi-v4) /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/drawable-xhdpi/icon.png
                                layout/main.layout-xml
                                Src: () /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml
                                values/colors.xml
                                Src: () /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/values/colors.xml
                                values/strings.xml
                                Src: () /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/values/strings.xml
                                values/styles.xml
                                Src: () /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/values/styles.xml
                                AndroidManifest.xml
                                Src: () /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/AndroidManifest.xml
                                Resource Dirs:
                                Type anim
                                anim/blink_animation.xml
                                Src: () /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/anim/blink_animation.xml
                                Type drawable
                                drawable/icon.png
                                Src: (ldpi-v4) /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/drawable-ldpi/icon.png
                                Src: (mdpi-v4) /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/drawable-mdpi/icon.png
                                Src: (hdpi-v4) /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/drawable-hdpi/icon.png
                                Src: (xhdpi-v4) /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/drawable-xhdpi/icon.png
                                Type layout
                                layout/main.layout-xml
                                Src: () /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml
                                Type values
                                values/colors.xml
                                Src: () /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/values/colors.xml
                                values/strings.xml
                                Src: () /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/values/strings.xml
                                values/styles.xml
                                Src: () /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/values/styles.xml
                                Including resources from package: /Users/claudio/Library/Android/sdk/platforms/android-25/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/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/drawable-ldpi/icon.png
                                Processing image: /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/drawable-mdpi/icon.png
                                Processing image: /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/drawable-hdpi/icon.png
                                Processing image: /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/drawable-xhdpi/icon.png
                                (processed image /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/drawable-ldpi/icon.png: 106% size of source)
                                (processed image /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/drawable-mdpi/icon.png: 104% size of source)
                                (processed image /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/drawable-hdpi/icon.png: 105% size of source)
                                (processed image /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/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/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml)
                                (new resource id blink_animation from /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/anim/blink_animation.xml)
                        Task "GenerateAndroidResources" execution -- FAILED
                        Done building target "CooperAndroidBeforeCompile" in project "/Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/com.wbigger.simonsaysfirebase.elements".-- FAILED
                Done building project "/Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/com.wbigger.simonsaysfirebase.elements".-- FAILED
        Task "MSBuild" execution -- FAILED
        Done building target "Build" in project "/var/folders/1t/fm6h918s5m126yf4cq_sl_m00000gn/T/com.wbigger.simonsaysfirebase.fire.temp.sln".-- FAILED
Done building project "/var/folders/1t/fm6h918s5m126yf4cq_sl_m00000gn/T/com.wbigger.simonsaysfirebase.fire.temp.sln".-- FAILED

Build FAILED.
Errors:

/var/folders/1t/fm6h918s5m126yf4cq_sl_m00000gn/T/com.wbigger.simonsaysfirebase.fire.temp.sln (Build) ->
(Build target) ->
/Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/com.wbigger.simonsaysfirebase.elements (default targets) ->
/Applications/Fire.app/Contents/Resources/XbuildTargets/RemObjects Software/Elements/RemObjects.Elements.Cooper.Android.targets (CooperAndroidBeforeCompile target) ->

        /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml(9,1):  Androiderror Android: No resource identifier found for attribute 'layout_constraintBottom_toBottomOf' in package 'com.wbigger.simonsaysfirebase'
        /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml(9,1):  Androiderror Android: No resource identifier found for attribute 'layout_constraintLeft_toLeftOf' in package 'com.wbigger.simonsaysfirebase'
        /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml(9,1):  Androiderror Android: No resource identifier found for attribute 'layout_constraintRight_toLeftOf' in package 'com.wbigger.simonsaysfirebase'
        /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml(9,1):  Androiderror Android: No resource identifier found for attribute 'layout_constraintTop_toTopOf' in package 'com.wbigger.simonsaysfirebase'
        /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml(9,1):  Androiderror Android: No resource identifier found for attribute 'layout_constraintVertical_bias' in package 'com.wbigger.simonsaysfirebase'
        /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml(28,1):  Androiderror Android: No resource identifier found for attribute 'layout_constraintBottom_toBottomOf' in package 'com.wbigger.simonsaysfirebase'
        /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml(28,1):  Androiderror Android: No resource identifier found for attribute 'layout_constraintHorizontal_bias' in package 'com.wbigger.simonsaysfirebase'
        /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml(28,1):  Androiderror Android: No resource identifier found for attribute 'layout_constraintLeft_toLeftOf' in package 'com.wbigger.simonsaysfirebase'
        /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml(28,1):  Androiderror Android: No resource identifier found for attribute 'layout_constraintRight_toRightOf' in package 'com.wbigger.simonsaysfirebase'
        /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml(28,1):  Androiderror Android: No resource identifier found for attribute 'layout_constraintTop_toTopOf' in package 'com.wbigger.simonsaysfirebase'
        /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml(28,1):  Androiderror Android: No resource identifier found for attribute 'layout_constraintVertical_bias' in package 'com.wbigger.simonsaysfirebase'
        /Users/claudio/Documents/tech/fire/com.wbigger.simonsaysfirebase/obj/Debug/Android/res/layout/main.layout-xml(50,1):  Androiderror Android: No resource identifier found for attribute 'layout_constraintGuide_percent' in package 'com.wbigger.simonsaysfirebase'

         0 Warning(s)
         12 Error(s)

Time Elapsed 00:00:00.4498840

I’ll have a look next week. If you can send me a compete test case project, that’d be appreciated.

Hi Marc, I would like to port this Android project into Fire/Silver:
https://github.com/Tritium-3h/SimonSaysAndroid

I just created a new Android project e copied activity_main.xml and colors.xml into the Fire project.

In attachment the Fire project.

Thanks
Claudio
com.wbigger.simontest.zip (75.7 KB)

1 Like