2017-02-11 4 views
0

Обновление, исправлено. Я прочел, что некоторые erros в манифесте заставляют Android Studio по какой-то причине открыть сгенерированный файл манифеста и выбросить много ошибок. Я исправил его, удалив пустое значение в правом манифесте. Спасибо всем за помощь.Android Студия случайно начала показывать: Идентификатор ресурса не найден для атрибута 'applicationId' в пакете 'android'

Однажды после обновления моего Android Studio, я начал получать эту ошибку при попытке построить: Error:No resource identifier found for attribute 'applicationId' in package 'android'

С тех пор я должен был прекратить разработку моего приложения, потому что я не могу найти способ почини это. Я попытался вернуться к более старым версиям Android Studio, я перестроил, очистил, очистил кеш.

Я где-то читал, что это что-то об Android Studio по какой-либо причине, переписывающей мой манифест с его собственной сгенерированной, которая просто ломает приложение. Удаление этого не поможет, оно просто продолжает восстанавливать свою собственную дерьмо, которая создает кучу ошибок. Он генерирует манифест в эту папку:

Когда я открываю сгенерированный манифест на студии Android, он в основном краснеет все.

Вот файл build.grade для модуля приложения:

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:

// 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 Studio создает и генерирует ошибки:

<?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> 
+0

где атрибут 'applicationId' определен? – rafsanahmad007

+0

показать ваш файл build.gradle модуля приложения – Aryan

+0

@ rafsanahmad007 он определен по какой-либо причине автоматически сгенерированный файл манифеста. – StefanJM

ответ

0

Для интеграции Firebase в ваше приложение. Требуется приложение google-services.json файл в папке вашего модуля приложения. По моему мнению, вы потеряли свой файл .json или имя пакета в том, что .json-файл отличается от вашего имени пакета приложений.

+0

У меня есть это, и я изменил имя для этого вопроса. – StefanJM

0

Я прочитал, что некоторые erros в манифесте заставляют Android Studio по какой-то причине открыть сгенерированный файл манифеста и выбросить намного больше ошибок. Я исправил его, удалив пустое значение в правом манифесте. Спасибо всем за помощь.

Смежные вопросы