Android Studio GridLayout Compatibility for older Androids -


i'm getting error when trying emulate app on 2.3 avd:

    03-10 01:06:56.500      407-407/com.ak.ak0 e/androidruntime﹕ fatal exception: main java.lang.runtimeexception: unable start activity componentinfo{com.ak.ak0/com.ak.ak0.mainactivity}: android.view.inflateexception: binary xml file line #21: error inflating class gridlayout         @ android.app.activitythread.performlaunchactivity(activitythread.java:1647)         @ android.app.activitythread.handlelaunchactivity(activitythread.java:1663)         @ android.app.activitythread.access$1500(activitythread.java:117)         @ android.app.activitythread$h.handlemessage(activitythread.java:931)         @ android.os.handler.dispatchmessage(handler.java:99)         @ android.os.looper.loop(looper.java:123)         @ android.app.activitythread.main(activitythread.java:3683)         @ java.lang.reflect.method.invokenative(native method)         @ java.lang.reflect.method.invoke(method.java:507)         @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:839)         @ com.android.internal.os.zygoteinit.main(zygoteinit.java:597)         @ dalvik.system.nativestart.main(native method)  caused by: android.view.inflateexception: binary xml file line #21: error inflating class gridlayout         @ ................ 

thing is, unless i'm not understanding gradle file correctly, i'm using android support libraries compatibility:

apply plugin: 'android'  android { compilesdkversion 19 buildtoolsversion "19.0.3"  defaultconfig {     minsdkversion 9     targetsdkversion 19     versioncode 2     versionname "1.0.1"  }  signingconfigs {     release {         storefile file("//")         storepassword "//"         keyalias "//"         keypassword "//"     } }  buildtypes {     release {         runproguard true         proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.txt'          signingconfig signingconfigs.release     } } }  dependencies { compile 'com.android.support:gridlayout-v7:19.0.1' compile 'com.android.support:appcompat-v7:19.0.1' compile filetree(dir: 'libs', include: ['*.jar']) } 

the dependencies part build.gradle file automatically generated, i'm expecting them used (although not have concrete knowledge of functionality). question is, what's missing that's causing problem ?

ok running android studio: although adds dependency libraries itself, things not added automatically. following needs added @ beginning of xml file including gridlayout:

xmlns:grid="http://schemas.android.com/apk/res-auto" 

apart this, gridlayout tags xml file must replaced android.support.v7.widget.gridlayout

if, me, found out afterwards space needs modifications compatibility, space tags need replaced android.support.v7.widget.space


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -