android - Unexpected error while executing: -- Error while Launching activity -


<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="com.example.vaibhav.myapplication">      <application         android:allowbackup="true"         android:icon="@mipmap/ic_launcher"         android:label="@string/app_name"         android:supportsrtl="true"         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>     </application>  </manifest> 

...........................................................................

above code , looks fine don't know why getting below error ...

unexpected error while executing: start -n "com.example.vaibhav.myapplication/com.example.vaibhav.myapplication.mainactivity" -a android.intent.action.main -c android.intent.category.launcher error while launching activity

................. 1 thing , , am start command taking package name twice though declared correctly in

am start -n "com.example.vaibhav.myapplication/com.example.vaibhav.myapplication.mainactivity" -a android.intent.action.main -c android.intent.category

you should use classified class name activity in androidmanifest.xml.

android:name

the name of class implements activity, subclass of activity. attribute value should qualified class name (such as, "com.example.project.extracurricularactivity"). however, shorthand, if first character of name period (for example, ".extracurricularactivity"), appended package name specified in element.

for more info refer android developer site


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -