Didn't find class "com.imagerecognition.MainActivity" on path: DexPathList - java

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.

Related

Android Automotive: Could not identify launch activity: Default Activity not found

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>

Binded jar leaves launcher icon

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

Google play supported devices 0 with pdfbox-android

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>

Application package installer has stopped

I have copied my Manifest XML File. I am just not able to figure out the error. The application is running on my Redmi 1S but it is not running on my Micromax Canvas A110 I have already tried all the solutions which are already there on Stackoverflow related to this.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gilpix.am"
android:versionCode="1"
android:versionName="1.0" android:installLocation="auto">
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="19" />
<uses-configuration
android:reqTouchScreen="finger" android:reqKeyboardType="undefined"/>
<uses-feature
android:name="android.hardware.touchscreen" />
<uses-permission
android:name="android.permission.INTERNET" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true" android:xlargeScreens="true" android:resizeable="true"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" android:uiOptions="splitActionBarWhenNarrow">
<!-- Splash screen -->
<activity android:name="com.gilpix.am.Splash"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Black.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.gilpix.am.Login"
android:label="#string/app_name"
>
</activity>
<activity android:name="com.gilpix.am.Logind"
android:label="#string/logind_name"
android:uiOptions="splitActionBarWhenNarrow"
>
</activity>
<activity android:name="com.gilpix.am.U_home"
android:label="#string/app_name"
android:uiOptions="splitActionBarWhenNarrow" >
</activity>
</application>
</manifest>
clean your project and if it doesn't work than close
the project and restart, create new apk and install
This error is come due to different android version of your both android phones.
Please check the configuration for both the phones and change according to that in manifest.xml file
android:minSdkVersion="11"
android:targetSdkVersion="19"
Thanks

Android Application isn't installed after deployment

I've developed an application using Eclipse and when I run it on my Droid Ultra the application runs when running through Eclipse. To my understanding when that happens the application should be installed on the device. However, when I unplug the device and try to run the app by going through my phone applications it displays a toast message saying "App isn't installed". Does anyone know why this is happening? Is this a code problem, an environment issue, anything?
Here is my manifest if it helps?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.ggc.thinkfast"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="20" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" android:permission="android.permission.BLUETOOTH">
<activity
android:name=".MainScreen"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:noHistory="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".FactScreen"
android:screenOrientation="portrait"
android:noHistory="true"></activity>
<activity android:name=".CategoryScreen"
android:screenOrientation="portrait"></activity>
<activity android:name=".TimerScreen"
android:screenOrientation="portrait"
android:noHistory="true"></activity>
<activity android:name=".QuestionScreen"
android:screenOrientation="portrait"
android:noHistory="true"></activity>
<activity android:name=".NextQuestionScreen"
android:theme="#android:style/Theme.Dialog"
android:screenOrientation="portrait"
android:noHistory="true"></activity>
</application>
Do you already have the app installed previously on the device?If so please uninstall the existing app and try again with eclipse.The problem may be due to incorrectly signed certificates.

Categories