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

应用程序未安装android错误

夹谷浩博
2023-03-14

最近我安装了AndroidSDK 5.1,之后我发现了一些以前从未见过的错误,比如App is not installed error。如果用户单击设备中的应用程序图标,则会出现此错误。你能建议如何解决这个问题吗这是我的清单代码

 <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.srikanth"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="11"
        android:targetSdkVersion="21" />

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.FLASHLIGHT" />
    <!-- Internet permission -->

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />

    <application
        android:name="com.srikanth.utils.AppController"
        android:icon="@drawable/icon"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen" >
        <activity
            android:name="com.srikanth.SplashActivity"
            android:label="@string/app_name"
              android:exported="true"
            android:screenOrientation="portrait" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.facebook.FacebookActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
            android:label="@string/app_name" />

        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/APP_ID" />

        <provider
            android:name="com.facebook.FacebookContentProvider"
            android:authorities="com.facebook.app.FacebookContentProvider1234"
            android:exported="true" />

        <activity android:name="com.srikanth.MainActivity" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity android:name="com.srikanth.EditProfile" >
        </activity>
        <activity android:name="com.srikanth.UnlockActivity" >
        </activity>
        <activity android:name="com.srikanth.FacebookFriends" >
        </activity>
        <activity android:name="com.srikanth.HomeActivity" >
        </activity>
        <activity android:name="com.srikanth.SplashActivity" >
        </activity>
    </application>

这里是控制台中的错误报告

  [2015-04-20 13:01:08 - InstaScene] Starting activity com.instascene.SplashActivity on device EBAZFG148859
    [2015-04-20 13:01:09 - InstaScene] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.instascene/.SplashActivity }
    [2015-04-20 13:01:09 - InstaScene] ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.instascene/.SplashActivity } from null (pid=8344, uid=2000) not exported from uid 10131
    [2015-04-20 13:01:09 - InstaScene] ActivityManager: at android.os.Parcel.readException(Parcel.java:1472)
    [2015-04-20 13:01:09 - InstaScene] ActivityManager: at android.os.Parcel.readException(Parcel.java:1426)
    [2015-04-20 13:01:09 - InstaScene] ActivityManager: at android.app.ActivityManagerProxy.startActivityAsUser(ActivityManagerNative.java:2712)
    [2015-04-20 13:01:09 - InstaScene] ActivityManager: at com.android.commands.am.Am.runStart(Am.java:680)
    [2015-04-20 13:01:09 - InstaScene] ActivityManager: at com.android.commands.am.Am.onRun(Am.java:270)
    [2015-04-20 13:01:09 - InstaScene] ActivityManager: at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
    [2015-04-20 13:01:09 - InstaScene] ActivityManager: at com.android.commands.am.Am.main(Am.java:76)
    [2015-04-20 13:01:09 - InstaScene] ActivityManager: at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    [2015-04-20 13:01:09 - InstaScene] ActivityManager: at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:243)
    [2015-04-20 13:01:09 - InstaScene] ActivityManager: at dalvik.system.NativeStart.main(Native Method)

我已经在stackoverflow上检查了这个问题,并尝试了解决方案,但这里没有幸运的参考链接,我尝试了link1 link2

共有2个答案

郎祯
2023-03-14

您将注册您的SplashActive两次。

<activity android:name="com.srikanth.SplashActivity" >
    </activity>

 <activity
        android:name="com.srikanth.SplashActivity"
        android:label="@string/app_name"
          android:exported="true"
        android:screenOrientation="portrait" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

所以只需要删除其中一个,然后添加android:exported=“true”

祝叶五
2023-03-14

检查android:exported是否根据此处给出的安全说明设置为false。如果是,则需要将其设置为true,以使用USB调试在手机上测试应用,如下所示:

<activity 
    android:name=".MainActivity"
    android:exported="true">
  <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
  </intent-filter>
</activity>
 类似资料:
  • 当我添加一个意向过滤器(让谷歌能够抓取我的应用内容,并允许用户从搜索结果中输入我的应用)时,我的应用仍然在我手机上的Android Studio上运行,但它不再安装。 我的清单在下面,我已经注释掉了添加的意图过滤器,使其再次安装,所以现在我得到一个警告,谷歌搜索无法对其进行索引。我该怎么做才能使它安装并可转位? 这是我的第一个应用程序,所以很抱歉,如果这是显而易见的,但我感谢任何帮助。谢谢。

  • 安装失败,因为设备可能有与当前版本不匹配的陈旧dexed JAR(dexopt错误)。为了继续,您必须卸载现有的应用程序。 DEVICE SHELL命令:pm install-r“/data/local/tmp/com.example.tell_it_dell.myapplication1”pkg://data/local/tmp/com.example.tell_it_dell.myapplic

  • 我知道还有其他类似的问题,但我还没有找到解决我的问题的方法。我确定了之前没有安装过这个应用程序(在galaxy s6上测试),在Android Studio的Build Variants选项卡中,我已经将这个模块切换到了发布版(我还有一个Firebase和MainlibProj模块,我应该把它们也切换到发布版吗?)当我尝试安装它时,我在Logcat中得到的是:

  • 我已经在android Studio2.3.1和Gradle3.2中设计了2到3个应用程序。当我将应用程序从它运行到任何设备或仿真器时,所有的程序都运行良好。但当我从build文件夹中获取apk并手动安装到设备或仿真器时。它每次都崩溃并给我错误classnotfound。这是主要活动。 我在用Mac,我试过很多种方法。即使我建立了新的项目,但仍然是同样的错误。下面是它的logcat。

  • 我正试图在我的小米红米S2上运行我的Android Studio 3.5应用程序。在手机上安装应用程序时,它会抛出一个错误: 安装未成功。< br >无法安装该应用程序。< br >安装失败,原因是:“null” 真实设备: 小米红米S2

  • 我的公司在google play Store/Android Marketplace上发布了一个应用程序。我们在下一个版本的应用程序中要解决的问题之一是重新添加了xlargeScreen=true(在上一个版本中它被设置为false,所以现在该应用程序不会出现在较大的平板电脑上)。我们正在尝试得到alpha/beta测试设置,这样我们就可以确保我们所有的问题都被解决了,然后我们再推动apk的运行。