android - Error: cannot find symbol variable LOLLIPOP -
i have seen many examples in different android libraries detecting if device lollipop supported or not. when use in app, throwing following error:
error:(20, 60) error: cannot find symbol variable lollipop
for example source code is:
static boolean islollipop() { return build.version.sdk_int == build.version_codes.lollipop || build.version.sdk_int == build.version_codes.lollipop_mr1; } i using latest version of android studio packages updated , installed.
error on statement:
build.version_codes.lollipop also when check options of version_codes, lollipop not exist in list.
it seems you're using old build tools or you're missing libraries.
i pasted code android studio , works.
please compare build.gradle one:
apply plugin: 'com.android.application' android { compilesdkversion 23 //this guy buildtoolsversion "23.0.2" //this guy defaultconfig { applicationid "com.example.piotr.myapplication" minsdkversion 15 targetsdkversion 23 //this guy versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) testcompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.1' //this guy compile 'com.android.support:design:23.1.1' } i've matched parts might important code.
hope help
Comments
Post a Comment