Intellij does not open APK after installation

Asked

Viewed 515 times

0

In my application, after installing , Intellij does not "command" open the apk.

My manifest already configured the main activity

<application 
...
    <activity
        android:name=".Activitys.Main"
        android:label="@string/title_activity_main"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>
...

Apparently in Intellij is correct the configuration of "build"

inserir a descrição da imagem aqui

I have tried changing this option by manually choosing Activity.. but it did not work.. just install APK, but it does not open.. I have to go manually there on the option to open...

With this I have problem when debugging the class Application

Can anyone have any idea what might be happening? I’ve already restarted Android and PC too..

[Edited]

Today the following error appeared while trying to install:

Error while executing: am startservice meu.pacote/com.android.tools.fd.runtime.InstantRunService
Starting service: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=meu.pacote/com.android.tools.fd.runtime.InstantRunService }
Error: Not found; no service started.

With this information I disabled Instantrun, and app started to open normal, but anyway.. I would like to leave Instant Run enabled, if anyone has any idea how to solve this...

1 answer

0

Check next to the Run button if you have the 'app' option selected as well. If not it will try to run where the selection is in the 'Project' tab'

Because your Edit does not seem to find the main class, open the Andoridmanifest position your cursor in the name of the main class ".Activityes.Main" and press Ctrl+B to navigate to it, if you do not find Voce declared the wrong package.

And another thing, package names start with minuscule letter, and component names that have extended from Android use the type suffix in the class name: "Mainactivity".

Browser other questions tagged

You are not signed in. Login or sign up in order to post.