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

Android Studio-错误:未找到可绘制的资源/abc_ic_ab_

拓拔辰钊
2023-03-14

我收到以下错误:

错误:未找到可绘制的资源/abc_ic_ab_mtrl_am_。

错误:链接文件资源失败。

错误:java.util.concurrent.ExecutionException:java.util.concurrent.ExecutionException:com.android.tools.aapt2.Aapt2异常:AAPT2错误:检查日志以获取详细信息

错误:任务执行失败:应用程序:processDebugResources。无法执行aapt

这是我的机器人清单:

<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>

共有3个答案

范翰飞
2023-03-14

在我的例子中,这个问题是由两个问题引起的,我害怕破坏我所有的项目,但这是两件简单的事情,第一件我没有注意的事情是命名一个可绘制的东西,Android Studio本身可能会在某个地方使用,在我的案例中是<code>border。xml,当我创建了这个可绘制文件,然后我编写了一些其他代码,然后我尝试运行我的项目,但它无法读取我的任何可绘制文件。因此,我对我的项目感到害怕,但后来我想起了这个词<code>(border)是一种特殊的东西。Android Studio本身可能在某些位置使用它,所以我只是将名称改为<code>simple_border。xml,然后第二个问题就是在一个xml文件中放入两行xml定义行,如下所示:-

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

所以,不要害怕这个问题,只需要做一些清洁工作,记住你在上一次编码时做了什么,也不要忘记命名问题,不要使用你认为Android Studio本身可能会使用的特殊东西,还要检查最近编辑的xml文件是否存在重复xml定义行的问题,希望能有所帮助。

陈康胜
2023-03-14

在我的例子中,错误的原因是在我的一个矢量绘图中丢失了结束标记。检查您的基于xml的drawables是否具有有效的格式。令人误解的是,编译器生成了许多指向有效drawable的错误,而问题可能只出现在一个drawable中。查看此答案了解更多信息。

麹渊
2023-03-14

我只是碰到了这个问题,却找不到任何解决方法。

最后,我开始检查我最近做的所有布局和绘图,错误出在其中一个。我已经写了两次进口声明。

<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显示的错误远未指向它。

 类似资料: