简体   繁体   中英

Can't open APK file on smartphone

I've made an application in eclipse using android project. Now I installed that APK-file on my smartphone.

When I hit install, it just installs, it's fine. But then I get the option "Cancel" , or "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-

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

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). You can now connect your phone to your computer and enjoy the simplicity of creating apps on Android.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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