当前位置: 首页 > 知识库问答 >
问题:

在现有的Android Studio项目中无法连接到Firebase

上官正志
2023-03-14
                   Caused by: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.dji.GSDemo.GoogleMap. Make sure to call FirebaseApp.initializeApp(Context) first.
Could not parse the Android Application Module's Gradle config. Resolve gradle build issues and/or resync.

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
defaultConfig {

    ndk {
        abiFilters 'armeabi-v7a'
    }

    applicationId "com.dji.GSDemo.GoogleMap"
    minSdkVersion 23
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    //Enabling multidex support
    multiDexEnabled true //Mention in the doc

}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

//Mention in the doc
dexOptions {
    incremental = true;
    preDexLibraries = false
    javaMaxHeapSize "4g" // 2g should be also OK
}

packagingOptions{
    doNotStrip "*/*/libdjivideo.so"
    doNotStrip "*/*/libSDKRelativeJNI.so"
    doNotStrip "*/*/libFlyForbid.so"
    doNotStrip "*/*/libduml_vision_bokeh.so"
    doNotStrip "*/*/libyuv2.so"
    doNotStrip "*/*/libGroudStation.so"
    doNotStrip "*/*/libFRCorkscrew.so"
    doNotStrip "*/*/libUpgradeVerify.so"
    doNotStrip "*/*/libFR.so"
}
}
dependencies {

compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'

implementation 'com.android.support:appcompat-v7:27.0.2'
compile 'com.android.support:design:27.0.2'
compile 'com.google.android.gms:play-services-gcm:11.8.0'
implementation 'com.google.android.gms:play-services:11.8.0'
implementation 'com.android.support:support-v4:27.0.2'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.firebaseui:firebase-ui-database:2.3.0'
implementation 'com.google.android.gms:play-services-location:11.8.0'
implementation 'com.github.medyo:android-about-page:1.2.1'
implementation 'com.google.android.gms:play-services-places:11.8.0'
compile 'com.github.medyo:android-about-page:1.2.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.android.support:cardview-v7:27.0.2'

implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:animated-vector-drawable:27.0.2'
implementation 'com.android.support:mediarouter-v7:27.0.2'


compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android.gms:play-services-ads:11.8.0'

compile ('com.dji:dji-sdk:4.4.1')
provided ('com.dji:dji-sdk-provided:4.4.1')
}

共有1个答案

萧德馨
2023-03-14
implementation 'com.firebaseui:firebase-ui-database:2.3.0'
implementation 'com.firebaseui:firebase-ui-database:3.2.2'
 类似资料:
  • 我按照这个https://spring.io/guides/gs/accessing-data-mysql/指南连接mysql db到Spring启动项目 但是在运行应用程序时出现以下错误,我正在生成Spring starter项目,并且在通过Spring工具套件创建项目时仅选择web、mysql和jpa框 以下是application.properties 和pom.xml 编辑:添加sprin

  • 我在react native by CLI中创建了我的项目: 然后我在Android手机上安装了,并扫描了电脑屏幕上的二维码。 但是,我的手机无法连接到项目,我不知道为什么。它只是加载并失败。这是错误消息: 无法加载exp://192.168.56.1:19000。网络响应超时。 这是视图错误: “未捕获错误:java,not.SocketTimeoutException:在10000毫秒后无法连

  • 我做错了什么?多谢了。

  • 我试图建立一个具有以下依赖关系的应用程序。 这是我在红帽网站上找到的一个例子-http://www.jboss.org/quickstarts/eap/helloworld-jms/ 我正在使用Netbeans 8.0.2。(还在dos和eclipse中使用Maven命令进行了尝试)我在构建时遇到了一个错误,下面是相同的日志: 我可以在以下路径找到文件: https://maven.reposit

  • 我正在windows计算机上安装vue storefront api和vue storefront。在windows power shell或命令提示符下运行docker compose up时,我收到一个错误,指出找不到现有的Kibana索引、“prevState”:“red”、“prevMsg”:“无法连接到Elasticsearch at”http://es1:9200."}. 在kiban

  • 我正在尝试构建一个简单的Spring Boot CRUD应用程序,它还具有Spring Boot安全性的登录和注册选项。我已经在使用MySQL数据库,它可以很好地为我的应用程序保存数据。 问题是,在尝试在securityConfig类中创建jdbcAuthentication时,它说我无法自动连接Datasource,并且没有找到“Datasource”类型的bean(同样,我已经成功地将MySQ