Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/387.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 安卓工作室说;无法解析符号“;尝试访问导入库中的方法时_Java_Android_Gradle_Android Studio_Firebase - Fatal编程技术网

Java 安卓工作室说;无法解析符号“;尝试访问导入库中的方法时

Java 安卓工作室说;无法解析符号“;尝试访问导入库中的方法时,java,android,gradle,android-studio,firebase,Java,Android,Gradle,Android Studio,Firebase,我正在运行Android Studio 0.8.6,并导入了两个Firebase库,用于我的项目 我设法创建Firebase简单登录类的对象,以及默认Firebase对象。然而。当我试图访问这些对象的任何方法时,Android Studio固执地说“无法解析符号” 这是我的代码(基本上是Firebase快速入门示例代码): 无法解析的是“.checkOutStatus”和“.createUser”方法 我一直在尝试这里描述的各种方法来修复它,但没有任何效果。 我还将build.gradle文件附

我正在运行Android Studio 0.8.6,并导入了两个Firebase库,用于我的项目

我设法创建Firebase简单登录类的对象,以及默认Firebase对象。然而。当我试图访问这些对象的任何方法时,Android Studio固执地说“无法解析符号”

这是我的代码(基本上是Firebase快速入门示例代码):

无法解析的是“.checkOutStatus”和“.createUser”方法

我一直在尝试这里描述的各种方法来修复它,但没有任何效果。 我还将build.gradle文件附加到以下位置:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.12.+'
    }
}
apply plugin: 'android'

repositories {
    mavenCentral()
}

android {
    compileSdkVersion 19
    buildToolsVersion "19.1.0"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 19
    }
}

dependencies {
    // Support Libraries
    compile 'com.android.support:appcompat-v7:19.1.0'
    compile files('libs/firebase-simple-login-1.4.1.jar')
    compile files('libs/firebase-client-jvm-1.0.16.jar')
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

提前感谢!:)

> P>解决符号问题时,请考虑如果项目具有“代码>设置”。GooLe<代码>不在根目录中,在Android Studio中不正确读取子模块。


以下是我对另一个听起来与您类似的问题的回答:

要使用Firebase消息服务,您需要将以下依赖项添加到应用程序的build.gradle文件中:

            compile 'com.google.firebase:firebase-messaging:9.4.0'
所有其他firebase依赖项文件包括:

dependencies {
    apply plugin: 'com.google.gms.google-services'
    compile 'com.google.firebase:firebase-core:10.0.1'
    compile 'com.google.firebase:firebase-database:10.0.1'
    compile 'com.firebase:firebase-client-android:2.5.0'
    compile 'com.google.firebase:firebase-messaging:9.4.0'
}
我也有同样的问题,但多亏了这个答案:


尝试同步项目。您不需要.jar文件,只需添加
编译'com.firebase:firebase simple login:1.4.1'
,然后进行梯度同步-它将自动下载lib并将其包含到您的项目中。@asylume我听从了您的建议,但gradle同步失败并显示:未能找到:com.firebase:firebase简单登录:1.4.1。有什么想法吗?@user3537089抱歉,刚刚检查了maven rep,有版本1.4.2,所以使用:
compile'com.firebase:firebase simple login:1.4.2'
@asylume解决了gradle问题,好的:)但我仍然无法访问我的firebase对象的那些方法:(Thx,但它没有真正起作用,所以我切换回Eclipse。没有足够的时间完全解决此问题,所以我必须稍后再做。无论如何,非常感谢您的帮助:)
dependencies {
    apply plugin: 'com.google.gms.google-services'
    compile 'com.google.firebase:firebase-core:10.0.1'
    compile 'com.google.firebase:firebase-database:10.0.1'
    compile 'com.firebase:firebase-client-android:2.5.0'
    compile 'com.google.firebase:firebase-messaging:9.4.0'
}