2
Every time I try to run my app on AVD or on my phone to test the following message appears to me:
Error while executing:
am start -n "com.example.vantajoso/com.example.vantajoso.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.vantajoso/.MainActivity }
Error type 3 Error:
Activity class {com.example.vantajoso/com.example.vantajoso.MainActivity}
does not exist.
Error while Launching activity
Below follows as is my Androidmaifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.vantajoso">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application android:allowBackup="true"
android:icon="@mipmap/iconvantajosoweb_round"
android:label="@string/app_name"
android:roundIcon="@mipmap/iconvantajosoweb_round"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat.DayNight.NoActionBar"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
My Mainactivity
package com.example.vantajoso;
import android.view.WindowManager;
import android.webkit.WebViewClient;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebView;
public class MainActivity extends AppCompatActivity {
private WebView mWebView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//remove o titulo
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
//codigo para o webview
setContentView(R.layout.activity_main);
WebView myWebView = (WebView) this.findViewById(R.id.webView1);
myWebView.setWebViewClient(new WebViewClient());
myWebView.getSettings().setJavaScriptEnabled(true);
myWebView.loadUrl("https://meusite.com.br");
}
}
Does anyone have any idea what it is?
It seems to me that this line
<action android:name="android.intent.category.LAUNCHER" />
should be<category android:name="android.intent.category.LAUNCHER" />
– Icaro Martins
@icaroMartins I tried here but the same error happens. I have no idea what to do :X
– Felipe Edwards Vanstocher