如何在启动时解决权限错误

时间:2018-03-15 05:10:59

标签: android

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.asish.gorai">
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-feature android:name="android.hardware.location" android:required="false" />
    <uses-feature android:name="android.hardware.location.network" android:required="false" />
    <application
        android:largeHeap="true"
        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"
        android:fullBackupContent="@xml/backup_descriptor"
        tools:ignore="GoogleAppIndexingWarning">
        <activity android:name="com.appodeal.ads.InterstitialActivity"
            android:configChanges="orientation|screenSize"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
        <activity android:name="com.appodeal.ads.VideoActivity"
            android:configChanges="orientation|screenSize"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
        <activity android:name="com.appodeal.ads.LoaderActivity"
            android:configChanges="orientation|screenSize"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
        <activity android:name="com.appodeal.ads.VideoPlayerActivity"
            android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"/>
        <receiver android:name="com.appodeal.ads.AppodealPackageAddedReceiver" android:exported="true" android:enabled="true">
            <intent-filter>
                <action android:name="android.intent.action.PACKAGE_ADDED" />
                <data android:scheme="package" />
            </intent-filter>
        </receiver>
        <activity android:name="com.appodeal.ads.TestActivity"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />

        <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
        <activity android:name="com.google.android.gms.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
            tools:replace="android:theme" />

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

        <activity android:name="com.applovin.adview.AppLovinInterstitialActivity" android:configChanges="orientation|screenSize"/>
        <activity android:name="com.applovin.adview.AppLovinConfirmationActivity" android:configChanges="orientation|screenSize"/>

        <activity android:name="com.mopub.mobileads.MoPubActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:theme="@android:style/Theme.Translucent" />
        <activity android:name="com.mopub.common.MoPubBrowser"
            android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity android:name="com.mopub.mobileads.MraidActivity"
            android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity android:name="com.mopub.mobileads.MraidVideoPlayerActivity"
            android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity android:name="com.mopub.mobileads.RewardedMraidActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"/>

        <activity android:name="org.nexage.sourcekit.vast.activity.VASTActivity"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
            android:configChanges="keyboardHidden|orientation|screenSize"/>

        <activity android:name="org.nexage.sourcekit.vast.activity.VPAIDActivity"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />

        <activity android:name="com.appodeal.ads.networks.vpaid.VPAIDActivity"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />

        <activity android:name="com.amazon.device.ads.AdActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>

        <activity android:name="com.my.target.ads.MyTargetActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:hardwareAccelerated="true"/>

        <!--suppress AndroidDomInspection -->
        <activity android:name="com.facebook.ads.AudienceNetworkActivity" android:configChanges="keyboardHidden|orientation|screenSize" />

        <!--suppress AndroidDomInspection -->
        <activity android:name="com.startapp.android.publish.ads.list3d.List3DActivity"
            android:theme="@android:style/Theme" />
        <!--suppress AndroidDomInspection -->
        <activity android:name="com.startapp.android.publish.adsCommon.activities.OverlayActivity"
            android:theme="@android:style/Theme.Translucent"
            android:configChanges="orientation|keyboardHidden|screenSize" />
        <!--suppress AndroidDomInspection -->
        <activity android:name="com.startapp.android.publish.adsCommon.activities.FullScreenActivity"
            android:theme="@android:style/Theme"
            android:configChanges="orientation|keyboardHidden|screenSize" />
        <!--suppress AndroidDomInspection -->
        <service android:name="com.startapp.android.publish.common.metaData.PeriodicMetaDataService" />
        <!--suppress AndroidDomInspection -->
        <service android:name="com.startapp.android.publish.common.metaData.InfoEventService" />
        <receiver android:name="com.startapp.android.publish.common.metaData.BootCompleteListener" >
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
            </intent-filter>
        </receiver>


        <service android:name="com.yandex.metrica.MetricaService" android:enabled="true"
            android:exported="true" android:process=":Metrica"
            android:permission=""
            tools:ignore="ExportedService">
            <intent-filter>
                <category android:name="android.intent.category.DEFAULT" />
                <action android:name="com.yandex.metrica.IMetricaService" />
                <data android:scheme="metrica" />
            </intent-filter>
            <meta-data android:name="metrica:api:level" android:value="58" />
        </service>
        <receiver android:name="com.yandex.metrica.MetricaEventHandler"
            android:enabled="true" android:exported="true"
            android:permission=""
            tools:ignore="ExportedReceiver">
            <intent-filter>
                <action android:name="com.android.vending.INSTALL_REFERRER" />
            </intent-filter>
        </receiver>

        <!--suppress AndroidDomInspection -->
        <activity android:name="com.yandex.mobile.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />

        <activity android:name="com.unity3d.ads.adunit.AdUnitActivity"
            android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:hardwareAccelerated="true" />
        <activity android:name="com.unity3d.ads.adunit.AdUnitSoftwareActivity"
            android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:hardwareAccelerated="false" />
        <activity android:name="com.unity3d.ads2.adunit.AdUnitActivity"
            android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:hardwareAccelerated="true" />
        <activity android:name="com.unity3d.ads2.adunit.AdUnitSoftwareActivity"
            android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:hardwareAccelerated="false" />

        <!--suppress AndroidDomInspection -->
        <activity android:name="com.jirbo.adcolony.AdColonyOverlay"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
        <!--suppress AndroidDomInspection -->
        <activity android:name="com.jirbo.adcolony.AdColonyFullscreen"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" />
        <!--suppress AndroidDomInspection -->
        <activity android:name="com.jirbo.adcolony.AdColonyBrowser"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" />
        <!--suppress AndroidDomInspection -->
        <activity android:name="com.flurry.android.FlurryFullscreenTakeoverActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />
        <!--suppress AndroidDomInspection -->
        <activity android:name="com.flurry.android.FlurryShareActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />
        <!--suppress AndroidDomInspection -->
        <activity android:name="com.flurry.android.FlurryTileAdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />
        <!--suppress AndroidDomInspection -->
        <activity android:name="com.flurry.android.FlurryBrowserActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />

        <activity android:name="com.mobvista.msdk.offerwall.view.MVOfferWallActivity"
            android:configChanges="screenSize|orientation"
            android:screenOrientation="portrait" />
        <activity android:name="com.mobvista.msdk.offerwall.view.MVOfferWallRewardVideoActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:screenOrientation="landscape"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
        <activity android:name="com.mobvista.msdk.reward.player.MVRewardVideoActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
        <activity android:name="com.mobvista.msdk.videofeeds.vfplayer.VideoFeedsActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:screenOrientation="portrait" />
        <activity android:name="com.mobvista.msdk.out.LoadingActivity" />
        <activity android:name="com.mobvista.msdk.interstitial.view.MVInterstitialActivity"
            android:configChanges="orientation|screenSize"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
        <activity android:name="com.mobvista.msdk.shell.MVActivity"
            android:configChanges="keyboard|orientation"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />

        <!--suppress AndroidDomInspection -->
        <activity android:name="com.tapjoy.TJAdUnitActivity" android:configChanges="orientation|keyboardHidden|screenSize"
            android:hardwareAccelerated="true" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
        <!--suppress AndroidDomInspection -->
        <activity android:name="com.tapjoy.mraid.view.ActionHandler" android:configChanges="orientation|keyboardHidden|screenSize" />
        <!--suppress AndroidDomInspection -->
        <activity android:name="com.tapjoy.mraid.view.Browser" android:configChanges="orientation|keyboardHidden|screenSize" />
        <!--suppress AndroidDomInspection -->
        <activity android:name="com.tapjoy.TJContentActivity" android:configChanges="orientation|keyboardHidden|screenSize"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" android:hardwareAccelerated="true" />

        <!--suppress AndroidDomInspection -->
        <activity android:name="com.ironsource.sdk.controller.ControllerActivity" android:configChanges="orientation|screenSize"
            android:hardwareAccelerated="true" />
        <!--suppress AndroidDomInspection -->
        <activity android:name="com.ironsource.sdk.controller.InterstitialActivity" android:configChanges="orientation|screenSize"
            android:hardwareAccelerated="true" android:theme="@android:style/Theme.Translucent" />
        <!--suppress AndroidDomInspection -->
        <activity android:name="com.ironsource.sdk.controller.OpenUrlActivity" android:configChanges="orientation|screenSize"
            android:hardwareAccelerated="true" android:theme="@android:style/Theme.Translucent" />

        <!--suppress AndroidDomInspection -->
        <activity android:name="com.adcolony.sdk.AdColonyInterstitialActivity" android:configChanges="keyboardHidden|orientation|screenSize"
            android:hardwareAccelerated="true"/>
        <!--suppress AndroidDomInspection -->
        <activity android:name="com.adcolony.sdk.AdColonyAdViewActivity" android:configChanges="keyboardHidden|orientation|screenSize"
            android:hardwareAccelerated="true"/>

        <activity android:name="com.inmobi.rendering.InMobiAdActivity" android:configChanges="keyboardHidden|orientation|keyboard|smallestScreenSize|screenSize|screenLayout"
            android:hardwareAccelerated="true" android:resizeableActivity="false" android:theme="@android:style/Theme.NoTitleBar"
            tools:targetApi="n" />
        <receiver android:name="com.inmobi.commons.core.utilities.uid.ImIdShareBroadCastReceiver" android:enabled="true" android:exported="true"
            android:permission=""
            tools:ignore="ExportedReceiver">
            <intent-filter>
                <action android:name="com.inmobi.share.id"/>
            </intent-filter>
        </receiver>
        <!--optional, remove if not using Ogury-->
        <activity android:name="io.presage.activities.PresageActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
            android:hardwareAccelerated="true" android:theme="@android:style/Theme.Translucent.NoTitleBar">
            <intent-filter>
                <action android:name="io.presage.intent.action.LAUNCH_WEBVIEW" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <!--optional, remove if not using Ogury-->
        <receiver android:name="io.presage.receiver.AlarmReceiver" />
        <!--optional, remove if not using Millennial Media-->
        <provider
            android:name="com.millennialmedia.internal.utils.MediaContentProvider"
            android:authorities="${applicationId}.MediaContentProvider"
            android:grantUriPermissions="true"
            android:exported="false" />
        <activity android:name="com.asish.gorai.Permission"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name="com.asish.gorai.MainActivity"
            android:label="@string/app_name">
        </activity>
        <activity
            android:name="com.asish.gorai.SecondActivity"
            android:label="10 Best Foods for Keeping Your Skin Healthy" >
            <intent-filter>
                <action android:name="com.asish.gorai.SecondActivity" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity android:name="com.asish.gorai.ThirdActivity"
            android:label="10 Best  Foods for Diabetes and Blood Sugar">
        </activity>
        <activity android:name="com.asish.gorai.FrothActivity"
            android:label="10 Best Foods for Babies">
        </activity>
        <activity android:name="com.asish.gorai.FiveActivity"
            android:label="10 Best Foods for Pregnancy">
        </activity>
        <activity android:name="com.asish.gorai.SixdActivity"
            android:label="10 Best Foods for Osteoarthritis">
        </activity>
        <activity android:name="com.asish.gorai.SevenActivity"
            android:label="10 Best Foods for Better Eyesight">
        </activity>

        <activity android:name="com.asish.gorai.EightActivity"
            android:label="10 Best Foods for Blood Pressure">
        </activity>
        <activity android:name="com.asish.gorai.NineActivity"
            android:label="10 Best Foods for Hair Health">
        </activity>
        <activity android:name="com.asish.gorai.TenActivity"
            android:label="10 Best Foods for Weight Loss">
        </activity>
        <activity android:name="com.asish.gorai.ElevenActivity"
            android:label="10 Best Foods for Liver Health">
        </activity>
    </application>

</manifest>

从源代码生成应用程序后显示两条错误消息,虽然它不会影响应用程序,但是当有人打开我的应用程序并且在启动应用程序之前显示那些丑陋的错误时,它确实看起来很可能。

错误: -

  
      
  1. 缺少权限,使用权限android:name =“android.permission.WRITE_EXTERNAL_STORAGE#虽然我   给了许可#

  2.   
  3. 集成错误:已从jar文件加载Vungle类,删除不必要的Dex文件。 #i使用Appodeal SDK集成   #

  4.   

我无法理解我该怎么做,请帮助我。

2 个答案:

答案 0 :(得分:2)

关于案例一添加此

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

清单

中的应用程序标记

答案 1 :(得分:0)

您是否检查了它们的documentation?.,而且,如果您正在使用MultiDex或不使用MultiDex,请仔细查看示例,因为这些示例项目不同。在app文件夹中,查找proguard-rules.pro,然后在其中复制规则。