首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >Android随机开始显示:在'android‘包中找不到属性'applicationId’的资源标识符

Android随机开始显示:在'android‘包中找不到属性'applicationId’的资源标识符
EN

Stack Overflow用户
提问于 2017-02-11 10:26:43
回答 2查看 392关注 0票数 0

更新,修正了它。我在清单中看到一些错误导致Android由于某种原因打开生成的清单文件并抛出许多错误。我通过删除右清单中的空值来修正它。谢谢大家的帮助。

在更新了Android之后的一天,当我尝试构建:Error:No resource identifier found for attribute 'applicationId' in package 'android'时,我开始收到这个错误

从那以后,我不得不停止开发我的应用程序,因为我找不到解决这个问题的方法。我试着回到旧版本的Android,重建,清理,清理缓存。

我在某个地方读到过,它是关于Android的,不管出于什么原因,用它自己生成的清单覆盖我的清单,这只会破坏应用程序。删除它不会有帮助,它只是不断地重新生成它自己的垃圾,这会产生大量的错误。它生成这个文件夹的清单:app\build\intermediates\manifests\full\debug

当我在android上打开生成的清单时,它基本上会将所有内容都红线化。

下面是应用程序模块的build.grade文件:

代码语言:javascript
运行
AI代码解释
复制
apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion '25.0.0'

    defaultConfig {
        applicationId "emptied"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 4
        versionName "1"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    dexOptions {
        javaMaxHeapSize "2g"
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.3.0'
    compile 'com.android.support:design:23.3.0'
    compile 'com.android.support:support-v4:23.3.0'
    compile 'com.google.firebase:firebase-ads:10.0.1'
    compile 'com.google.android.gms:play-services:10.0.1'
    compile 'com.android.support:multidex:1.0.1'
}
apply plugin: 'com.google.gms.google-services'

下面是gradle项目:

代码语言:javascript
运行
AI代码解释
复制
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.0-beta3'
        classpath 'com.google.gms:google-services:3.0.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

这里不是我使用的清单,而是Android生成并抛出错误的清单:

代码语言:javascript
运行
AI代码解释
复制
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="emptied"
    android:versionCode="4"
    android:versionName="1" >

    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="23" />

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

    <!-- Optional permission for Analytics to run. -->
    <uses-permission android:name="android.permission.WAKE_LOCK" /> <!-- Permissions required for GCM -->
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

    <permission
        android:name="emptied.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />

    <uses-permission android:name="emptied.permission.C2D_MESSAGE" />

    <application
        android:name="android.support.multidex.MultiDexApplication"
        android:applicationId=""
        android:icon="@mipmap/typer_ic_launcher"
        android:label="@string/app_name" >
        <meta-data
            android:name="com.google.android.gms.games.APP_ID"
            android:value="@string/app_id" />
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <activity
            android:name="emptied.MainActivity"
            android:configChanges="orientation|keyboardHidden"
            android:label="emptied"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme.NoActionBar.SplashScreen" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="emptied.GameSelection"
            android:label="Select a Gamemode"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme.NoActionBar" />
        <activity
            android:name="emptied.ResultScreen"
            android:configChanges="orientation|keyboardHidden"
            android:label="Aftermath"
            android:noHistory="true"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme.NoActionBar" />
        <activity
            android:name="emptied.PracticeGame"
            android:configChanges="orientation|keyboardHidden"
            android:label="Just practice typing"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme.NoActionBar"
            android:windowSoftInputMode="adjustResize" />
        <activity
            android:name="emptied.WordsPerMInuteGame"
            android:configChanges="orientation|keyboardHidden"
            android:label="Words Per Minute Gamemode"
            android:noHistory="true"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme.NoActionBar"
            android:windowSoftInputMode="adjustResize" />
        <activity
            android:name="emptied.NoMistakesGame"
            android:configChanges="orientation|keyboardHidden"
            android:label="Make No Mistakes Gamemode"
            android:noHistory="true"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme.NoActionBar"
            android:windowSoftInputMode="adjustResize" />
        <!-- Include the AdActivity and InAppPurchaseActivity configChanges and themes. -->
        <activity
            android:name="com.google.android.gms.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:theme="@android:style/Theme.Translucent" />
        <activity
            android:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity"
            android:theme="@style/Theme.IAPTheme" />
        <activity
            android:name="com.google.android.gms.appinvite.PreviewActivity"
            android:exported="true"
            android:theme="@style/Theme.AppInvite.Preview" >
            <intent-filter>
                <action android:name="com.google.android.gms.appinvite.ACTION_PREVIEW" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.google.android.gms.auth.api.signin.internal.SignInHubActivity"
            android:excludeFromRecents="true"
            android:exported="false"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />
        <!--
Service handling Google Sign-In user revocation. For apps that do not integrate with
            Google Sign-In, this service will never be started.
        -->
        <service
            android:name="com.google.android.gms.auth.api.signin.RevocationBoundService"
            android:exported="true"
            android:permission="com.google.android.gms.auth.api.signin.permission.REVOCATION_NOTIFICATION" />

        <receiver android:name="com.google.android.gms.cast.framework.media.MediaIntentReceiver" />

        <service android:name="com.google.android.gms.cast.framework.media.MediaNotificationService" />
        <service android:name="com.google.android.gms.cast.framework.ReconnectionService" />
        <!--
 FirebaseMessagingService performs security checks at runtime,
             no need for explicit permissions despite exported="true"
        -->
        <service
            android:name="com.google.firebase.messaging.FirebaseMessagingService"
            android:exported="true" >
            <intent-filter android:priority="-500" >
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>
        <service
            android:name="com.google.android.gms.tagmanager.TagManagerService"
            android:enabled="true"
            android:exported="false" />

        <activity
            android:name="com.google.android.gms.tagmanager.TagManagerPreviewActivity"
            android:noHistory="true" > <!-- optional, removes the previewActivity from the activity stack. -->
            <intent-filter>
                <data android:scheme="tagmanager.c.emptied" />

                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.google.android.gms.common.api.GoogleApiActivity"
            android:exported="false"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />

        <receiver
            android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
            android:enabled="true"
            android:exported="false" >
        </receiver>
        <receiver
            android:name="com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver"
            android:enabled="true"
            android:permission="android.permission.INSTALL_PACKAGES" >
            <intent-filter>
                <action android:name="com.android.vending.INSTALL_REFERRER" />
            </intent-filter>
        </receiver>

        <service
            android:name="com.google.android.gms.measurement.AppMeasurementService"
            android:enabled="true"
            android:exported="false" />

        <receiver
            android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
            android:exported="true"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

                <category android:name="emptied" />
            </intent-filter>
        </receiver>
        <!--
 Internal (not exported) receiver used by the app to start its own exported services
             without risk of being spoofed.
        -->
        <receiver
            android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
            android:exported="false" />
        <!--
 FirebaseInstanceIdService performs security checks at runtime,
             no need for explicit permissions despite exported="true"
        -->
        <service
            android:name="com.google.firebase.iid.FirebaseInstanceIdService"
            android:exported="true" >
            <intent-filter android:priority="-500" >
                <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
            </intent-filter>
        </service>

        <provider
            android:name="com.google.firebase.provider.FirebaseInitProvider"
            android:authorities="emptied.firebaseinitprovider"
            android:exported="false"
            android:initOrder="100" />
    </application>

</manifest>
EN

回答 2

Stack Overflow用户

发布于 2017-02-12 03:50:00

用于应用程序中的Firebase集成。应用程序需要google-services.json文件在您的应用程序模块文件夹。据我所知,您丢失了您的.json文件或包名,因为.json文件与应用程序包名不同。

票数 0
EN

Stack Overflow用户

发布于 2017-02-12 09:46:13

我在清单中看到一些错误,导致Android出于某种原因打开生成的清单文件并抛出更多的错误。我通过删除右清单中的空值来修正它。谢谢大家的帮助。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42179593

复制
相关文章
iOS中的「回调(callback)」
本文主要参考:《Object-C 编程 Big Nerd Ranch Guide》一书第24章
iOS Development
2019/02/14
3.5K0
iOS 回调只会用Block和Delegate?
写一个View,View上放一个按钮,如果按钮点击后要调用Controller的方法可以用Block或者委托实现。除了Block和委托外还可以使用ReactiveObjC
赵哥窟
2021/12/16
6130
Runloop(4):应用
1、线程创建需要的内存和时间消耗都比较大,因此建议你的入口点函数做相当数量的工作,或建立一个Run Loops允许进行经常性的工作。 2、Run Loops可以让你使用最小的资源来创建长时间运行线程。因为run loop在没有任何事件处理的时候会把它的线程置于休眠状态,它消除了消耗CPU周期轮询,并防止处理器本身进入休眠状态并节省电源。
Helloted
2022/06/07
2920
回调
回调简单而言:在一个类(A)的方法(a)中调用另一个类(B)的方法(b),当方法(b)执行完之后就调用类(A)中的方法(c),这就是回调的过程,是不是很简单?简单分析可以知道一个类(A)持有另一个类(B)的引用,方法(c)就叫做回调函数,画成UML图就如下所示:
晚上没宵夜
2020/03/10
2.6K0
​29 - 回调函数和回调地狱
原文地址:https://dev.to/bhagatparwinder/callback-functions-callback-hell-79n
前端黑板报
2022/12/01
4.6K0
一个创建自定义事件源的例子
本文讲述了一种可配置化的事件驱动架构,通过使用RunLoop、Event、Timer、DispatchSource等框架,结合自定义事件源,实现了代码可配置化的异步事件驱动架构。该架构可以灵活地应对各种不同的异步任务,具有良好的可扩展性和可维护性。同时,本文还提供了丰富的实例,以展示该架构的用法和实现细节,对于有兴趣深入了解该架构的读者,具有较好的参考价值。
MelonTeam
2018/01/04
2.2K0
一个创建自定义事件源的例子
什么是回调地狱?如何解决回调地狱问题_地狱回调
这个问题呢,需要从Node.js的API说起,这里就会有人问了?博主你不是说回调地狱的问题吗,怎么说到API了,别急,看博主一步一步的解释给你听:
全栈程序员站长
2022/11/15
3.2K0
七、回调
修改PspNotifyEnableMask为00000009,创建和退出进程时就不会触发回调
zhang_derek
2022/09/29
1.7K0
关于回调
爱学习的前端歌谣
2023/10/18
2000
关于回调
回调函数
什么是回调函数,上面的问题说的是不是很空洞,不是太形象,下面是知乎上的一位网友给的答案:
LiosWong
2018/10/29
3.9K0
回调函数
  有点类似模板的功能,可以使用函数指针作为参数,当调用函数时,使用void *进行传递参数,细致比较时,再用int *之类的进行强制转换。回调函数,其实就是在参数中定义函数,调用时,回到主函数去调用这个函数。仔细用法如下: 首先定义查找函数 Node * search_list(Node *node, void const *value, int (*compare)(void const *,void const *)){ while(node!=NULL){ if(compar
用户1154259
2018/01/17
3.3K0
回调函数
回调地狱
一个函数,作为参数的形式传给另一个函数调用,那么这个这个函数就叫做回调函数。 当然回调函数很常见,如下
用户4793865
2023/01/12
1.4K0
回调地狱
前言 从前一文中你真的了解回调?我们已知道回调函数是必须得依赖另一个函数执行调用,它是异步执行的,也就是需要时间等待,典型的例子就是Ajax应用,比如http请求,在不刷新浏览器的情况下,当你执行DO
itclanCoder
2020/10/28
2.3K0
回调地狱
回调函数
原文链接:https://note.noxussj.top/?source=cloudtencent 什么是回调函数? 简单的来说,一个函数作为另外一个函数的参数,可以称为回调函数。这个理解其实不完全
菜园前端
2023/05/20
1.7K0
使用委托实现同步回调与异步回调
使用委托可以执行的一项有用操作是实现回调。回调是传入函数的方法,在函数结束执行时调用该方法。 例如,有一个执行一系列数学操作的函数。在调用该函数时,也向其传递一个回调方法,从而在函数完成其计算工作时,调用回调方法,向用户通知计算结果。 同步回调    首先声明两个方法: AddTwoNumbers():接受两个整型实参以及一个类型委托 ResultCallback():接受一个字符串,并显示出来。代码如下: using System; using System.Collections.Generic
hbbliyong
2018/03/05
3.1K0
使用委托实现同步回调与异步回调
iOS开发之窥探UICollectionViewController(二) --详解CollectionView各种回调
UICollectionView的布局是可以自己定义的,在这篇博客中先在上篇博客的基础上进行扩充,我们先使用UICollectionViewFlowLayout,然后好好的介绍一下UICollectionView的一些回调方法,主要包括UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,UICollectionViewDelegate相关回调方法,并通过实例来介绍每个回调的用法。并且给每个Section添加定制的Header和Foote
lizelu
2018/01/11
1.7K0
iOS开发之窥探UICollectionViewController(二) --详解CollectionView各种回调
Fragment回调Activity
如果你需要在fragment中处理一些事情,事情的处理结果或者你需要告 诉activity马上要做什么事,这时候就需要和activity进行通讯。包括很多fragment在viewpager中的情况,而且可以保证activity能即时进行响应。相比发送广播,性能更好,代码更少。
坑吭吭
2018/08/31
1.8K0
回调函数案例
内置数据类型: #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> //回调函数---通用数组型打印案例 //参数1:数组首地址 参数2:数组中每个元素的大小 参数3:数组元素个数 参数4:回调函数对数组内容进行输出 void printArray(void* array, int size, int len, void(*MyPrint)(void *)) { //void*没有数组的概念,因此如果想通用可以用char*,如果用int*的话,打印字符串
大忽悠爱学习
2021/03/04
3.9K0
JavaScript回调函数
JavaScript中的回调函数是一种特殊类型的函数,它被传递给其他函数作为参数,并在特定的事件或条件发生时被调用。回调函数用于处理异步操作、事件处理、定时器等情况,以确保代码在合适的时机执行。在JavaScript中,回调函数常用于处理非阻塞的操作,以避免程序的停顿和等待。
堕落飞鸟
2023/05/17
2.5K0
回调函数的工作机制 回调函数的用途
在一般人的眼中,对回调函数并不是十分的了解。实际上,在现在的互联网技术上这种函数有着十分重要的地位。这种函数不仅仅可以使得编程的效率大大提升,还是实现一些特殊功能的必须组成部分。那么什么是回调函数?这样的函数究竟有什么作用?下面就来为大家介绍一下。
用户8739405
2021/07/09
6.8K0

相似问题

CFSocket数据回调

12

iphone网络cfsocket回调多线程

20

未调用ios NSURLConnectionDataDelegate didReceiveData回调

11

未调用iOS 9 UIApplicationDidBecomeActiveNotification回调

60

iOS通知:未调用的回调

11
添加站长 进交流群

领取专属 10元无门槛券

AI混元助手 在线答疑

扫码加入开发者社群
关注 腾讯云开发者公众号

洞察 腾讯核心技术

剖析业界实践案例

扫码关注腾讯云开发者公众号
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文