找不到默认活动添加Firebase [英] Default Activity not found adding firebase

查看:55
本文介绍了找不到默认活动添加Firebase的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个即时应用程序,并且运行良好,但是如果我将此行添加到我的 base/build.gradle 中,那么我将无法运行我的应用程序/已安装,请注意,我可以使用网址.

I have an instant app, and its working nice, but if I add this line to my base/build.gradle then I cant run my app/installed, note that I can run it with a url.

api 'com.google.firebase:firebase-core:16.0.1'

错误是未找到默认活动".删除编译后的火力地堡,找到活动.

The error is "Default activity not found". Removing the compile firebase, voilá the activity is found.

使用 implementation 而不是 api ,应用运行良好,但是firebase表示安装未成功",但使用了 api 并立即运行应用Firebase说成功"

Using implementation instead of api the app runs nice, but firebase says "installation unsucessful" but using api and running it as a instant app firebase says "successful"

我的build.gradle:

My build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion rootProject.ext.compileSdkVersion



    defaultConfig {
        applicationId "com.example.android.app"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode rootProject.ext.versionCodeInstalled
        versionName rootProject.ext.versionNameInstalled
    }

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

}

dependencies {
    implementation project(':feature')
    implementation project(':base')
}

清单应用:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.android.app" />

舱单基础:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.android">

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <meta-data
            android:name="aia-compat-api-min-version"
            android:value="1" />
    </application>

</manifest>

有什么主意吗?

推荐答案

此解决方案对我有用:

基本/清单

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <meta-data
        android:name="aia-compat-api-min-version"
        android:value="1" />

    <provider
        android:name="com.google.firebase.provider.FirebaseInitProvider"
        android:authorities="com.menuymenu.android.app.firebaseinitprovider"
        android:exported="false"
        tools:node="merge"/>

</application>

这篇关于找不到默认活动添加Firebase的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆