I have just created my first Android Automotive project:
when I run AndroidAutoDemo.mobile module it works fine:
Unfortunately when I switch to AndroidAutoDemo.automotive module I get:
Could not identify launch activity: Default Activity not found
Error while Launching activity
Failed to launch an application on all devices
This is the Android Manifest file in AndroidAutoDemo.automotive module (left as default):
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.androidautodemo">
<uses-feature
android:name="android.hardware.type.automotive"
android:required="true" />
<application
android:allowBackup="true"
android:appCategory="audio"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.AndroidAutoDemo" />
</manifest>
This is my mobile emulator:
How can I fix?
To run automotive app you need Automotive emulator and Automotive flavor with Manifest like below. Also there is no Automotive emulator provided by Google yet but you can get other open source emulator from like Polestar https://developer.polestar.com/sdk/polestar2-sys-img.xml
and Volvo https://developer.volvocars.com/sdk/volvo-sys-img.xml
You don't have to add new activity
if want to understand you can go through example source code
https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:car/app/app-samples/helloworld/
`
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="androidx.car.app.sample.helloworld"
android:versionCode="1"
android:versionName="1.0">
<!-- Various required feature settings for an automotive app. -->
<uses-feature
android:name="android.hardware.type.automotive"
android:required="true" />
<uses-feature
android:name="android.software.car.templates_host"
android:required="true" />
<uses-feature
android:name="android.hardware.wifi"
android:required="false" />
<uses-feature
android:name="android.hardware.screen.portrait"
android:required="false" />
<uses-feature
android:name="android.hardware.screen.landscape"
android:required="false" />
<application
android:label="#string/app_name"
android:icon="#drawable/ic_launcher"
android:extractNativeLibs="false">
<meta-data
android:name="com.android.automotive"
android:resource="#xml/automotive_app_desc"
tools:ignore="MetadataTagInsideApplicationTag" />
<meta-data android:name="androidx.car.app.minCarApiLevel"
android:value="1"
tools:ignore="MetadataTagInsideApplicationTag" />
<service
android:name="androidx.car.app.sample.helloworld.common.HelloWorldService"
android:exported="true">
<intent-filter>
<action android:name="androidx.car.app.CarAppService" />
</intent-filter>
</service>
<activity
android:name="androidx.car.app.activity.CarAppActivity"
android:theme="#android:style/Theme.DeviceDefault.NoActionBar"
android:exported="true"
android:launchMode="singleTask"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="distractionOptimized" android:value="true"/>
</activity>
</application>
</manifest>
`
Each Manifest file should include information about available activities and launcher activity. Launcher activity needs to be defined with some additional Intent filters, for example:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.car">
<uses-permission android:name="android.car.permission.CAR_POWERTRAIN" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.DeviceDefault.NoActionBar">
<activity android:name="com.example.car.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Related
I am very new In Android Development and developed a "Time Stamp Clock - App" which reads NFC-Tags.
Everything fine, it is running on Device via USB-Debug-Mode without Errors as expected. When I build APK and install on the same Device, the installing is without errors, but after that, the open-button is grayed out and inactive and there is no desktop-icon to launch. In the APPS Overview it is displayed, but not able to open.
Can someone tell me, what can i do, to figure it out, what is going wrong there?
EDIT:
Manifest:
<?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.comidoszeiterfassung">
<uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-sdk android:minSdkVersion="21"
android:targetSdkVersion="30"></uses-sdk>
<application
android:name=".myGLOBAL"
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/Theme.ComidosZeiterfassung"
tools:ignore="Instantiatable">
<activity
android:name=".ui.login.MainActivity"
android:label="#string/title_activity_main"
android:theme="#style/Theme.ComidosZeiterfassung.NoActionBar"
android:exported="true">
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<data android:mimeType="text/plain" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ui.login.LoginActivity"
android:label="#string/app_name"
android:exported="true">
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
</application>
</manifest>
It is a simple structure in the app. LoginActivity as Start-Activity and a TabbedActivity for the NFC-Stuff.
I have an App that uses a some Services from a binded Jar.
But this Jar leaves it own launcher Icon when I deploy this App on a Device. (So I have two launcher Icons)
Here is the Manifest File from this Jar project. What do I have to remove/do to make my Application leaves only the one desired launch Icon. (Only from MainApp)
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.company.scandemo"
android:versionCode="1"
android:versionName="2.2" >
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<activity
android:name=".ScanDemoActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name="com.company.scandemo.FloatingService" />
<receiver android:name="com.company.scandemo.BootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<category android:name="android.intent.category.HOME"/>
</intent-filter>
</receiver>
</application>
</manifest>
What do I have to remove/do to make my Application leaves only the one desired launch Icon
Please delete the MainLauncher flag from the manifest file in your binded Jar:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
//Delete these flag
here is the project I got from my tutor, I got the error after running it on my test phone. I tried the answers on stackovetflow but nothing helps. The logcat and manifest.xml are as follows
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.imagerecognition"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="22" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".TakeBusinessCardActivity"
android:label="#string/app_name">
<!--<intent-filter>-->
<!--<action android:name="android.intent.action.MAIN" />-->
<!--<category android:name="android.intent.category.LAUNCHER" />-->
<!--</intent-filter>-->
</activity>
<activity android:name=".HistoryActivity" android:label="拍摄历史"/>
<activity android:name=".DecodeActivity" android:label="解码"/>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
try to change your
android:name=".MainActivity"
to fully specified name
android:name="com.imagerecognition.MainActivity"
sometime eclipse act weird.
if it does not work you can try this
unable to find activity
This following method worked for me. Right click on your project and select properties. The "Properties for " panel will open. From the menu on the left go to Java Build Path -> Order and Export . From the list below uncheck the box next to Android Dependencies. Finally clean your project and run.
Reference : Link
Try removing the imports and importing them manually again.
Have a problem with an already-published application on Google Play.
The application is in the store, but no one can download, because of an error Supported devices 0.
I did refactor the project, removed all unnecessary with the manifest. Compiled a new apk, and again "Supported devices 0".
I use pdfbox-android-1.8.8.jar.
If I remove the pdfbox from project, then are "Supported devices 7700".
I build project with Eclipse.
What does this mean?
Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.firm.project"
android:versionCode="3"
android:versionName="1.01" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="21"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CAMERA"/>
<application
android:name=".App"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<activity
android:name=".StartActivity"
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=".OneActivity" android:screenOrientation="portrait">
</activity>
</application>
</manifest>
Recently begun to experience this error when I try to run my android application using the Eclipse IDE, already looked at other solutions but found nothing to solve my problem. Below is the error log and my manifest file.
[2015-02-11 10:18:28 - PapiroSmart] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.prologica.papirosmart/.SplashScreenActivity }
[2015-02-11 10:18:28 - PapiroSmart] ActivityManager: Error type 3
[2015-02-11 10:18:28 - PapiroSmart] ActivityManager: Error: Activity class {com.prologica.papirosmart/com.prologica.papirosmart.SplashScreenActivity} does not exist.
Manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.prologica.papirosmart"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- Accessing camera hardware -->
<uses-feature android:name="android.hardware.camera" />
<!-- Access permission to Android Folders -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- Access permission to manage network conections -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" >
</uses-permission>
<!-- Wi-Fi Permissions -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" >
</uses-permission>
<uses-permission android:name="android.permission.UPDATE_DEVICE_STATS" >
</uses-permission>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" >
</uses-permission>
<application
android:name=".app.AppController"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/Theme.Papirosmart" >
<activity
android:name=".cliente.LoginActivity"
android:label="#string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".cliente.MainActivity"
android:label="#string/app_name"
android:parentActivityName="cliente.LoginActivity"
android:screenOrientation="portrait" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="cliente.LoginActivity" />
</activity>
<activity
android:name=".cliente.ConfigActivity"
android:label="#string/app_name"
android:parentActivityName="cliente.MainActivity"
android:screenOrientation="portrait" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="cliente.MainActivity" />
</activity>
<activity
android:name=".SplashScreenActivity"
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=".cliente.FileChooserActivity"
android:label="#string/app_name"
android:parentActivityName="cliente.MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="cliente.MainActivity" />
</activity>
<activity android:name="eu.janmuller.android.simplecropimage.CropImage" />
<provider
android:name="InternalStorageContentProvider"
android:authorities="eu.janmuller.android.simplecropimage.CropImage"
android:exported="true" />
<receiver android:name=".app.ConnectionReceiver" >
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
<action android:name="android.net.wifi.WIFI_STATE_CHANGED" />
</intent-filter>
</receiver>
<service android:name=".app.FileUploaderService" >
</service>
<receiver android:name=".app.FileUploaderReceiver" >
</receiver>
<service android:name=".app.SynchronizeService" >
</service>
</application>
</manifest>
it says com.prologica.papirosmart.SplashScreenActivity does not exists
so please use the specific packagename where SplashScreenActivity exists. supose if SplashScreenActivity is in package a.b.c. than use the package specific details with SplashScreenActivity .