Reputation: 947
The project builds properly, however starting it on the device / emulator fails. Odd thing is, that the package name is called two times before the .MainActivity part comes. So the error makes total sense as to there isn't a folder name com/example/myapp/com/example/myapp. However I don't understand why it is being called / concatenated twice?
With the default <intent-filter>
the app runs without errors, however without the possibility of deeplinking when calling exampleapp://...
.
Would appreciate any help and thanks in advance.
Following error is shown in the logs:
Error while executing: am start -n "com.example.myapp/com.example.myapp.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.myapp/.MainActivity } Error type 3 Error: Activity class {com.example.myapp/com.example.myapp.MainActivity} does not exist.
Error while Launching activity Failed to launch an application on all devices
Custom intent filter:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<!-- Accepts URIs that begin with "exampleapp://facebook” or "exampleapp://google" "exampleapp://payment -->
<data android:scheme="exampleapp" android:host="facebook" />
<data android:scheme="exampleapp" android:host="google" />
<data android:scheme="exampleapp" android:host="payment" />
</intent-filter>
What exactly is wrong defining the <intent-filter>
like above? Android Studio underlines the word exampleapp
and shows Typo in word 'exampleapp' and suggests me to change it to applicative
.
I don't really understand what this warning means and why it worked in my previous project without any problems in first place?
Upvotes: 2
Views: 435
Reputation: 76516
com.example.myapp/com.example.myapp.MainActivity} does not exist.
com.example.myapp
is your application package name
com.example.myapp.MainActivity
is your fully qualified class name, i.e. the java package plus the java class name.
Ensure that your applicationId matches your package name, and ensure that your MainActivity
is in a java package of com/example/myapp/MainActivity
.
After your question edit:
Make a separate intent-filter.
Make one filter with just the action and category without the data, the system will use that one.
Then separately, make your custom schema's in another intent-filter for your internal navigation.
Upvotes: 0