Build successful but crashes - android

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.harshil.home.myapplication">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.harshil.home.myapplication.CustomActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="com.harshil.home.myapplication.LAUNCH"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:scheme="http"/>
</intent-filter>
</activity>
</application>
What is wrong with above android manifest.xml?
Everytime my app is crashing. I m new to stackoverflow so didnt know how to post so i just copy pasted.

It was due to exception button which i created but running it second time from emulator or mobile it works fine! Thanks all!

Related

Deep link url define in debug Manifest is not working

It was working fine till we have single Manifest file now we have created different Manifest for different build variant now deep link for debug variant not working. Please help me on this.Thanks
Here is the Manifest file for debug
<?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.app.myapp">
<application
android:name=".MyApplication"
android:hardwareAccelerated="true"
android:icon="#mipmap/ic_launcher"
android:roundIcon="#mipmap/ic_launcher_round"
android:label="#string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:allowBackup="false"
android:theme="#style/Theme.AndroidAppUser.Default"
tools:replace="android:allowBackup"
>
<activity
android:name=".ui.MainActivity"
android:screenOrientation="portrait"
android:launchMode="singleTask"
android:exported="true"
android:windowSoftInputMode="adjustPan"
android:hardwareAccelerated="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="https"
android:host="mydomain.com"
android:pathPattern="/.*" />
</intent-filter>
</activity>
</application>
</manifest>

App is being divided into 3 parts

Why is this is happening? That's an code error from .xml or from Java?
That's my app, it is divided into 3 parts (every part is a layout that is also an App) and I don't know why]
This app is part of my project for college. Ive used my partners activity and then this error appeared right after the import.
Probably this error appeared because of the import. Im not sure about what I have to do now and Im really new at Android programming.
<?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.carro.robo.mobile.ufj.approbo">
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<application
android:allowBackup="false"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:ignore="AllowBackup,GoogleAppIndexingWarning">
<activity
android:name=".MainBluetoothActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".PairedDevices"
android:parentActivityName=".MainBluetoothActivity" >
</activity>
<activity
android:name=".DiscoveredDevices"
android:parentActivityName=".MainBluetoothActivity" >
</activity>
<activity android:name=".Tela_bemVindo">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".CriacaoQuestoes">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
That is my .xml code. Android Version: 19 (KitKat 4.4)
Your app can have more than 1 item in the launcher. Every Activity that has a launcher intent filter gets an entry in it. Yours has 3. If you don't want them to be in the launcher, remove the launcher intent filter from the ones you don't want to show up.

"Error running app: Default Activity not Found"

I'm programming an app with sqlite+JSON, but suddenly I couldn't Run it anymore, and it popped this message, here's my AndroidManifest.xml , Idk if there's something wrong with it, my main activity is called DatosActivity, I wish you could help me.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.hitan.practica2_u3">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name="com.example.hitan.practica2_u3.DatosActivity"
android:theme="#style/AppTheme.NoActionBar"></activity>
</application>
</manifest>
You should add category.LAUNCHER & action.MAIN .
<activity
android:name="com.example.hitan.practica2_u3.DatosActivity"
android:theme="#style/AppTheme.NoActionBar"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
This error is coming because you have not added the default screen which should execute first. So try adding following code snippet, and your problem will be solved:
<activity
android:name="com.example.hitan.practica2_u3.DatosActivity"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Hope it helps.
Please Add Intent Filter Tag in Manifest To Make It Default while Launching.
Add this intent filter inside your activity tag
<activity
android:name="com.example.hitan.practica2_u3.DatosActivity"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

App does not come up with http scheme

My manifest file is:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ir.technovaa.offer">
<application
android:name=".OfferApplication"
android:allowBackup="false"
android:icon="#drawable/offer_icon"
android:label="#string/app_name"
android:supportsRtl="false"
android:theme="#style/AppTheme">
<activity
android:name=".activity.MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activity.IntroductionActivity" />
<activity
android:name=".activity.CallbackActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="http"
android:host="offer.ir"
android:path="/refer"/>
</intent-filter>
</activity>
</application>
</manifest>
So, problem is in CallbackActivity, with the http scheme, CallbackActivity does not come up with a link, but if I change it to a custom scheme like android:scheme="offer" it works just fine and the activity will come up with the redirect link. So, what should I do for make http scheme works. Thank you.

Default Activity Not Found in android studio version 1.2.2

I am new to android application development and i am following the video tutorials of New Boston. My appication gave error in the emulator "application closed unexpectedly" but when i tried to run it again it gave Error : Default activity not found.
After spending hours of time on google and stack overflow i realised it is related to android manifest.
so this is my manifest file.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.shubhangkhattar.newboston" >
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".Splash"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.shubhangkhattar.newboston.SPLASH" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.shubhangkhattar.newboston.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Menu"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.shubhangkhattar.newboston.MENU" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
I have already tried invalidate catches/restart and sync project with gradle files.
Change
<action android:name="com.example.shubhangkhattar.newboston.SPLASH"/>
To
<action android:name="android.intent.action.MAIN"/>
Intents reference

Categories

Resources