问题描述
我收到这些错误:
错误:资源可绘制/abc_ic_ab_back_mtrl_am_alpha(又名com.instacoin:drawable/abc_ic_ab_back_mtrl_am_alpha) 未找到.
错误:链接文件资源失败.
Error:failed linking file resources.
错误:java.util.concurrent.ExecutionException:java.util.concurrent.ExecutionException:com.android.tools.aapt2.Aapt2Exception:AAPT2 错误:检查日志详情
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
错误:任务:app:processDebugResources"的执行失败.执行 aapt 失败
Error:Execution failed for task ':app:processDebugResources'. Failed to execute aapt
这是我的 AndroidManifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.instacoin"
android:versionCode="11"
android:versionName="7.3" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="23" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<!-- Below is optional -->
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<permission
android:name="com.instacoin.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:theme="@style/AppTheme"
android:name="com.instacoin.MyApplication"
android:windowSoftInputMode="stateAlwaysHidden">
<activity android:name="com.chartboost.sdk.CBImpressionActivity"
android:excludeFromRecents="true"
android:hardwareAccelerated="true"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
android:configChanges="keyboardHidden|orientation|screenSize" />
<meta-data android:name="applovin.sdk.key"
android:value="@string/applovin_sdk_key" />
<meta-data android:name="com.revmob.app.id" android:value="@string/revmob_media_id"/>
<activity android:name="com.revmob.FullscreenActivity"
android:theme="@android:style/Theme.Translucent"
android:configChanges="keyboardHidden|orientation">
</activity>
<activity android:name="com.applovin.adview.AppLovinInterstitialActivity" />
<activity android:name="com.applovin.adview.AppLovinConfirmationActivity" />
<activity
android:name="com.instacoin.ActivitySplashScreen"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.instacoin.ActivityLogin"
android:label="@string/title_screen_sign_in"
android:theme="@style/AppTheme"
android:windowSoftInputMode="stateAlwaysHidden" >
</activity>
<activity
android:name="com.instacoin.ActivityRegister"
android:label="@string/title_screen_sign_up"
android:screenOrientation="portrait"
android:theme="@style/AppTheme"
android:windowSoftInputMode="stateAlwaysHidden" >
</activity>
<activity
android:name="com.instacoin.ActivityMainWallet"
android:clearTaskOnLaunch="true"
android:label="@string/app_name"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/AppTheme"
android:windowSoftInputMode="stateAlwaysHidden" >
</activity>
<!-- <activity
android:name="com.facebook.LoginActivity"
android:theme="@style/AppTheme"/>-->
<activity android:name="com.facebook.FacebookActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name"
tools:replace="android:theme" />
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/sdk_facebook_app_id" />
<receiver
android:name="com.google.android.gcm.GCMBroadcastReceiver"
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="com.sensiblewallet" />
</intent-filter>
</receiver>
<receiver android:name="com.instacoin.NotificationReciver" />
<service android:name="com.instacoin.GCMIntentService" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<!-- appgrade -->
<activity
android:name="com.appgrade.sdk.view.InterstitialActivity"
android:theme="@style/InterstitialDialogTheme"/>
<!-- supersonicads -->
<activity
android:name="com.supersonicads.sdk.controller.ControllerActivity"
android:configChanges="orientation|screenSize"
android:hardwareAccelerated="true" />
<activity
android:name="com.supersonicads.sdk.controller.InterstitialActivity"
android:configChanges="orientation|screenSize"
android:hardwareAccelerated="true"
android:theme="@android:style/Theme.Translucent" />
<activity
android:name="com.supersonicads.sdk.controller.OpenUrlActivity"
android:configChanges="orientation|screenSize"
android:hardwareAccelerated="true"
android:theme="@android:style/Theme.Translucent" />
<!-- TrialPay's activities -->
<activity
android:name="com.trialpay.android.views.webcontainer.WebContainerActivity"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|uiMode|touchscreen|screenSize"
android:hardwareAccelerated="true"
android:theme="@android:style/Theme.NoTitleBar"
android:windowSoftInputMode="adjustResize" >
</activity>
<activity
android:name="com.trialpay.android.views.webcontainer.WebContainerPopupActivity"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|uiMode|touchscreen|screenSize"
android:hardwareAccelerated="true"
android:theme="@android:style/Theme.Translucent.NoTitleBar" >
</activity>
<activity
android:name="com.trialpay.android.views.videocontainer.VideoContainerActivity"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|uiMode|touchscreen|screenSize"
android:hardwareAccelerated="true"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
</activity>
<!-- persona -->
<activity android:name="ly.persona.sdk.OffersActivity" />
<!-- Tapjoy -->
<activity
android:name="com.tapjoy.TJAdUnitActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:hardwareAccelerated="true"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity
android:name="com.tapjoy.mraid.view.ActionHandler"
android:configChanges="orientation|keyboardHidden|screenSize" />
<activity
android:name="com.tapjoy.mraid.view.Browser"
android:configChanges="orientation|keyboardHidden|screenSize" />
<!-- nativex -->
<activity
android:name="com.nativex.monetization.activities.InterstitialActivity"
android:configChanges="orientation|screenSize"
android:hardwareAccelerated="true"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity
android:name="com.nativex.videoplayer.VideoActivity"
android:configChanges="orientation|screenSize" />
<!-- required Activity to show Superrewards video ads -->
<activity
android:name="com.playerize.superrewards.activities.SRWebViewActivity"
android:screenOrientation="portrait" />
<!-- required Activity to show AdscendMedia video ads -->
<activity
android:name="com.adscendmedia.sdk.ui.OffersActivity"
android:configChanges="orientation|screenSize" >
</activity>
<!-- required Activity to show Adcolony video ads -->
<activity
android:name="com.jirbo.adcolony.AdColonyOverlay"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity
android:name="com.jirbo.adcolony.AdColonyFullscreen"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" />
<activity
android:name="com.jirbo.adcolony.AdColonyBrowser"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" />
<!-- required Activity to show Vungle video ads -->
<activity
android:name="com.vungle.publisher.FullScreenAdActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
<activity
android:name="net.adxmi.android.AdBrowser"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Light.NoTitleBar" >
</activity>
<service
android:name="net.adxmi.android.AdService"
android:exported="false" >
</service>
<!-- Component that rewarded ADs needs -->
<service
android:name="net.adxmi.android.ExpService"
android:exported="false" >
</service>
<!-- Optional Component -->
<receiver
android:name="net.adxmi.android.AdReceiver" >
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED" />
<data android:scheme="package" />
</intent-filter>
</receiver>
<activity android:name="com.heyzap.sdk.ads.HeyzapInterstitialActivity" android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize" />
<activity android:name="com.heyzap.sdk.ads.HeyzapVideoActivity" android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize" />
<activity android:name="com.heyzap.sdk.ads.HeyzapProxyActivity" />
<activity android:name="com.heyzap.sdk.ads.VASTActivity" android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize" />
<activity android:name="com.heyzap.sdk.ads.MediationTestActivity" />
<receiver android:name="com.heyzap.sdk.ads.PackageAddedReceiver">
<intent-filter>
<data android:scheme="package"/>
<action android:name="android.intent.action.PACKAGE_ADDED"/>
</intent-filter>
</receiver>
</application>
推荐答案
我刚遇到这个问题,找不到任何解决方案.
I just ran into this problem unable to find any solution whatsoever.
最后,我开始检查我最近制作的所有布局和可绘制对象,错误出在其中之一.我已经写了两次导入语句.
Finally I started checking all the layouts and drawables I had recently made and the error lied in one of them. I had written the import statement twice.
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<!--drawable code here-->
</item>
</layer-list>
删除它为我解决了它.Android Studio 显示的错误一点也没有.
Removing this solved it for me. The error displayed by Android Studio pointed nowhere near it.
这篇关于Android Studio - 错误:找不到资源可绘制/abc_ic_ab_back_mtrl_am_alpha(又名 com.instacoin:drawable/abc_ic_ab_back_mtrl_am_alpha)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!