简体   繁体   English

无法在智能手机上打开APK文件

[英]Can't open APK file on smartphone

I've made an application in eclipse using android project. 我已经使用Android项目在Eclipse中制作了一个应用程序。 Now I installed that APK-file on my smartphone. 现在,我在智能手机上安装了该APK文件。

When I hit install, it just installs, it's fine. 当我点击install时,它就安装好了。 But then I get the option "Cancel" , or "open" . 但是然后我得到选项“ Cancel”“ open” But I can't click on "Open". 但是我无法单击“打开”。

Just nothing happens every time I try to open it. 每当我尝试打开它时,什么都不会发生。 It's not with my other apps. 我的其他应用程序不支持。

I can find it at "downloads", but I just can't open it. 我可以在“下载”中找到它,但无法打开它。 I can update and install it again countless times. 我可以无数次地更新和安装它。 Unknown sources in my settings is on. 我的设置中的未知来源已开启。

Does anyone know this issue, and/or how to fix it? 有谁知道这个问题,和/或如何解决?

Help would be appreciated. 帮助将不胜感激。

Manifest code: 清单代码:

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

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

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.Main" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".BezoekActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="com.example.rodekruis.BezoekActivity" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name=".AfspraakActivity"
            android:label="@string/title_activity_afspraak" >
        </activity>
        <activity
            android:name=".ContactActivity"
            android:label="@string/title_activity_contact" >
        </activity>
        <activity
            android:name=".MeningActivity"
            android:label="@string/title_activity_mening" >
        </activity>
        <activity
            android:name=".RouteActivity"
            android:label="@string/title_activity_route" >
        </activity>
        <activity
            android:name=".SpecialistenActivity"
            android:label="@string/title_activity_specialisten" >
        </activity>
        <activity
            android:name=".BWCActivity"
            android:label="@string/title_activity_bwc" >
        </activity>
        <activity
            android:name=".AgendaActivity"
            android:label="@string/title_activity_agenda" >
        </activity>
        <activity
            android:name=".InfoActivity"
            android:label="@string/title_activity_informatie" >
        </activity>
        <activity
            android:name=".VriendActivity"
            android:label="@string/title_activity_vriend" >
        </activity>
        <activity
            android:name=".FoldersActivity"
            android:label="@string/title_activity_folders" >
        </activity>
        <activity
            android:name=".NieuwsActivity"
            android:label="@string/title_activity_nieuws">
        </activity>
    </application>

</manifest>

Register your launchable Activity in AndroidManifest.xml like this- 像这样在AndroidManifest.xml注册您的可启动Activity

<application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <!--______________Activities______________-->

        <activity
            android:name=".MainActivity"  //launchable activity 
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
</application>

Hope this will help you. 希望这会帮助你。

Have you been able to launch it through ADB directly in Android Studio ? 您是否能够直接在Android Studio中通过ADB启动它?

You might want to do it this way during your implementation, it is much faster to build and test. 您可能希望在实现过程中采用这种方式,因此构建和测试速度要快得多。

Just enable the developer mode in the settings and the "usb debugging" in the new menu that appeared (also in settings). 只需在设置中启用开发人员模式,然后在出现的新菜单中(也在设置中)启用“ usb调试”即可。 You can now connect your phone to your computer and enjoy the simplicity of creating apps on Android. 现在,您可以将手机连接到计算机,并享受在Android上创建应用程序的简便性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM