facebook - Cannot find symbol class error in Android Studio -


i have problem in open old project , errors below. searched on internet how solve it. project has dependencies facebook don't know why doesn't appear in modules (automatic gradle) , when try import new facebook sdk, tells me have facebook module... same problem?

   error:(26, 20) error: cannot find symbol class request    error:(27, 20) error: cannot find symbol class session    error:(28, 20) error: cannot find symbol class sessionstate    error:(29, 20) error: cannot find symbol class uilifecyclehelper    error:(30, 26) error: package com.facebook.model not exist    error:(31, 27) error: package com.facebook.widget not exist    error:(110, 13) error: cannot find symbol class uilifecyclehelper    error:(111, 20) error: package session not exist    error:(540, 45) error: cannot find symbol class session 

gradle:

buildscript { repositories {     mavencentral()     maven { url 'https://maven.fabric.io/repo' } }  dependencies {     classpath 'com.android.tools.build:gradle:1.2.2'     classpath 'io.fabric.tools:gradle:1.+' } } apply plugin: 'com.android.application' apply plugin: 'io.fabric'  repositories { maven { url 'https://maven.fabric.io/repo' } }  android { compileoptions { sourcecompatibility javaversion.version_1_7     targetcompatibility javaversion.version_1_7 }  compilesdkversion 22 buildtoolsversion '22' defaultconfig {     minsdkversion 14     targetsdkversion 22     versioncode 1     versionname '0.85.1.0'     applicationid 'com.xxxxx'     multidexenabled = true  } buildtypes {     release {         proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.txt'     } } signingconfigs {     debug {         storefile file('keys/debug.keystore')      }     release {         storefile file('keys/xxx.jks')         storepassword 'xxx'         keyalias 'xxx'         keypassword 'xxx'     } //        debug { //            storefile file("keys/debug.keystore") //        } } productflavors {     local {         resvalue "string", "url", 'xxx'         resvalue "string" , "debug", '1'         versionname = android.defaultconfig.versionname + "_local"      }     remote {         resvalue "string", "url", 'xxx'         resvalue "string" , "debug", '0'         versionname = android.defaultconfig.versionname + "_remote"      } } defaultconfig {     testapplicationid "com.xxx.test"     testinstrumentationrunner "android.test.instrumentationtestrunner" } packagingoptions {     exclude 'meta-inf/asl2.0'     exclude 'meta-inf/license'     exclude 'meta-inf/notice'     exclude 'meta-inf/license.txt'     exclude 'meta-inf/notice.txt'     exclude 'meta-inf/notice.txt'     exclude 'meta-inf/license.txt' } productflavors { } lintoptions {     abortonerror false }     applicationvariants.all { variant ->         variant.outputs.each { output ->             def outputfile = output.outputfile             if (outputfile != null && outputfile.name.endswith('.apk')) {                 def apk = outputfile;                 def newname;                  newname = apk.name.replace(".apk",  variant.name +"-v" + defaultconfig.versionname + "_" + variant.name + ".apk")                         .replace(project.name, "xxx");  //                    newname = newname //                            .replace("-" + variant.buildtype.name, "") //                            .replace(project.name, "xxx");                  //output.outputfile = new file(apk.parentfile, newname);                 if (output.zipalign) {                     //variant.outputfile = new file(apk.parentfile, newname.replace("-unaligned", ""));                     newname = newname.replace("-unaligned", "");                 }                  //def filename = outputfile.name.replace('.apk', "-${versionname}.apk")                 output.outputfile = new file(outputfile.parent, newname)                  logger.info('info: set outputfile ' + output.outputfile + " [" + output.name + "]");             }         }     } }  dependencies { //    compile project(':facebook') compile 'com.android.support:support-v13:21.0.0' //    compile 'com.google.android.gms:play-services:7.0.0' compile 'com.google.android.gms:play-services-base:7.3.0' compile 'com.google.android.gms:play-services-maps:7.3.0' compile 'com.google.android.gms:play-services-gcm:7.3.0' compile 'com.google.android.gms:play-services-identity:7.3.0' compile 'com.google.android.gms:play-services-plus:7.3.0'  compile 'com.facebook.android:facebook-android-sdk:4.0.0' compile filetree(dir: 'libs', include: ['*.jar']) compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13' compile 'com.squareup.okhttp:okhttp:2.3.0' compile 'com.squareup.retrofit:retrofit:1.9.0'  compile 'com.squareup.picasso:picasso:2.5.2' compile project(':puntechsensorslib')  compile ("com.doomonafireball.betterpickers:library:1.5.3") {     exclude group: 'com.android.support', module: 'support-v4' } compile('com.crashlytics.sdk.android:crashlytics:2.0.1@aar') {     transitive = true; } }  ext.betadistributiongroupaliases="internal" 

it's because of conflicts in xml files.

as errors tell you, several xml files (in res folders, maybe "attr" ones cannot sure) has same name in different projects.

maybe belong definitions or third's, id resources must unique.

try checking if can yours , rename them.

edit:

now can see errors,

add jcenter() repos. facebook artifacts seem there. don't need remove previous one.

in repositories zone:

repositories {     jcenter()       // intellij main repo. } 

in case have "facebook" module, remove project structure (file -> project structure) , can delete module files in case want clean project. (attention: of if didn't customize "facebook" module").

with gradle, need import build.gradle, , not having own "facebook" module.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -