I get ClassNotFoundException when I try to debug my application on Eclipse. I'm using an Asus Transformer Pad TF300T with android version 4.1.1 at my home computer. Doing the same thing on my work computer but with a Samsung Galaxy 10.1 with android version 3.2 everything works fine. This is the message I receive:
11-22 09:15:14.313: E/AndroidRuntime(2609): FATAL EXCEPTION: main
11-22 09:15:14.313: E/AndroidRuntime(2609): java.lang.RuntimeException: Unable to get
provider com.company.bill.contentprovider.BillProvider:
java.lang.ClassNotFoundException: com.company.bill.contentprovider.BillProvider
Names has been changed to protect the innocent ;)
I'm guessing that there is some problem with my environment but I haven't been able to figure out why. On my Assus I turned on the development options, USB debugging, Stay awake and allow Unknown Sources.
I have tried turning of the break point for ClassNotFound in eclipse but it doesn't change anything. I have also tried running eclipse as admin but it didn't help.
I got Eclipse Juno and windows 7 64-bit.
EDIT:
manifest file
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" android:theme="#android:style/Theme.Light" android:testOnly="false" android:debuggable="true">
<activity android:name=".LoginActivity"
android:label="#string/app_name" android:screenOrientation="landscape" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
did you add your activity declaration to your manifest file ?
I was able to fix it my self.
I downloaded the Android Support Library using Android SDK Manager and that fixed it.
try this way...
Right click on your project and go to Properties.
go to java build path..//which is on the 5th position on left side
go to Order and Export tab.
check(Tick Mark) on your selected jar file. and click ok.
Now, clean your project and Run.
Related
I cleared all the bugs... Recently before running this app it was showing "No default activity found" I changed configuration to "Nothing" & also added Android Manifest.xml file.
After successful build, Emulator shows app in settings>>app management.
But,
There is nothing in Apps Menu. Even I tried manually installing this app in my device. But it says "App Not Installed"
Share your experience. Help me out. Thank you.
Please include all manifest functions into this code, if I am missing something. This app is cloud storage app.
This is my manifest file :
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".activities.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>```
Sometimes android studio has quircks and bugs.
In this case when it complains of activity not found even though you know it's there do the following:
clean build - see if it works
remove cable of device reattach cable of device - see if it works
restart android studio - see if it works
invalidate caches and restart - see if it works
if none of the above work, that means you have some place in that activity that in theory compiles, in practice there is a problem with it.
Add this in your activity tag
<category android:name="android.intent.category.DEFAULT" />
So, I am getting this error on building Android Release. On debug things are fine. It wont even clean the solution.
Things were fine and now after updating to latest Xamarin.
This is what my Droid project top few lines look like
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Xamarin.Build.Download.0.6.0\build\Xamarin.Build.Download.props" Condition="Exists('..\packages\Xamarin.Build.Download.0.6.0\build\Xamarin.Build.Download.props')" />
<PropertyGroup>```
For me, simply restarting the visual studio fixed this issue.
A simple way is set android:usesCleartextTraffic="true" on you AndroidManifest.xml
android:usesCleartextTraffic="true"
Your AndroidManifest.xml look like
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.dww.drmanar">
<application
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:usesCleartextTraffic="true"
android:theme="#style/AppTheme"
tools:targetApi="m">
<activity
android:name=".activity.SplashActivity"
android:theme="#style/FullscreenTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
I hope this will help you.
android:usesCleartextTraffic="true" did not fix it for me.
I left that attribute in, because it might be enough in the future.
What fixed it was downgrading Xamarin.Build.Download nuget from 0.7.1 to 0.4.12-preview3. 0.4.11 also worked - that was what I was using prior to today, when I updated all nugets.
I also tried 0.7.0 and 0.5.0-rc1. Both had same problem as 0.7.1.
All my Android SDKs and Tools are up-to-date.
Targeting Android 9.0 Pie (API 28), minimum (25), launching to an emulator running Oreo 8.1 (27).
(iOS builds and run successfully with Xamarin.Build.Download 0.7.1; the problem only happened on Android.)
I have Xamarin.Build.Download version 0.8.0 and apparently for me the issue was that the shared code project didn't have a reference to the package, it happens in both, android and iOS, installing the package in the three projects apparently solves the issue.
In my Case this error was hiding another error behind. Using VS2017 V15.9.12, and i was juggling between 2 VS windows with 2 open Xamarin Android projects that had some library projects in common. Restarting the PC fixed the issue.
I have scoured the internet for this, but none of the "answers" I have found so far have fixed it for me. My app installs and runs 100% on my phone, which runs Android 4.1.2. It appears to install ok on my tablet too, which runs Android 4.3. But when I try to run it on the tablet, I get the "Application is not installed" error. What is even stranger is that if I run it using the App Manager inside ES File Explorer, it runs fine!
So my suspicion is that Android 4.3 is more strict about something that 4.1.2 lets through. But what? I just can't find it. And why it should run from within ES File Explorer is just weird. The app manifest is below. I have tried several different values for the target SDK, but nothing makes any difference. The app is signed using the Export Wizard in Eclipse, using a certificate created there.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="marshallarts.wordfinder"
android:versionCode="10"
android:versionName="1.10" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:permission="android.permission.WRITE_EXTERNAL_STORAGE"
android:theme="#style/AppTheme"
android:hasCode="true" >
<activity
android:name=".StartActivity"
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=".EnterActivity"
android:label="#string/title_activity_enter"
android:theme="#android:style/Theme.Dialog">
</activity>
<activity
android:name=".PlayActivity"
android:label="#string/title_activity_play" >
</activity>
</application>
</manifest>
Would add as a comment but don't have enough rep at the moment.
Have you changed your default launcher activity in your project recently? It could be that the link in your Android Home application is referencing the old activity.
Well I have solved this at last. It was (of course) my error - I had not correctly understood how to specify the app's permissions, and had not set them properly in the manifest. Corrected that, and it now runs happily. It is still a minor mystery why it ran on my phone - seems to me it should not have - but no matter, I am now on the right track.
I have recently started to face this issue that when I Run my application on AVD or Real Android Device via Eclipse it shows that app has been installed but does not launch. When I go and check the phone/AVD it does not show that app in the Apps area but when I go to "Manage Apps" here I can see my app is installed. Is there any reason why its happening?
All the help is much appreciated.
Thanks in Advance.
Ali
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.game.bond.of.jungle"
android:versionCode="1"
android:versionName="1.0" >
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
>
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main"
android:theme="#android:style/Theme.Black.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="androidintent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
Probably your main activity is missing the correct intent filters. Make sure it is declared like this:
<activity android:name="com.your.package.YourLauncherActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
Are you sure that you have set the right Run Configuration?
Right Click your project
Choose Run As
Choose Run Configuration
Check Launch Default Activity
Hit Apply and Ok
I was having the same problem, but for some reason the Launch Default Activity did not work. I thought I messed something up in the AndroidManifest.xml after adding a search intent filter in the project, but that was not the problem. It would not let me debug either, although the app would start fine when launched from the device.
This worked for me:
Right-click on the project
Select Run As
Select Run Configurations...
Select your application from the list on the left
Manually select Launch: MainActivity (or whatever you have it named) as the Launch Action instead of the default
Select apply
Number one thing to check in a situation like this is, look around the AndroidManifest.xml file. Most of the time,
if you had imported a project from SVN, Git or from existing source code your AndroidManifest.xml file might have replaced with a new one which doesn't specify which Activit(y)ies.java files are there and which one to bring up as the Launcher activity.
I'm having issues trying to put my own apps on my phone. I've looked around and no one has been able to help me so far. A bit of background information, I'm using the latest version of eclipse IDE, trying to get apps onto my galaxy s. I tried installing apps through gmail. When I go to install the app I get a parse error and it doesn't install. I have also tried using this method to install my app onto a htc wildfire s however I get the same issue. Is there a quick fix for this? Thanks for your time; any insight into what the problem is will be great.
Things I've tried: Ok I still have a parse error when I try installing my app. The min sdkversion was set to 9 which seems right to me as that is the api level for gingerbread which galaxy s uses (i think). I haven't set a target sdkversion yet as according to the android developer guide it if not stated it defaults to the minsdkversion. I also tried setting the minsdkversion to 1 and still no luck. Any ideas?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.guitartunergreatness.jj"
android:versionCode="1"
android:versionName="7" >
<uses-sdk android:minSdkVersion="7" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:debuggable="true">
<activity
android:name=".GuitarTunerActivity"
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>
Parse error usually occurs if your app supports a higher version of Android than the version of OS on your phone. Egs: your phone has 2.1 and application supports 2.2 onwards