I've developed an app but when I run it, it crashes and shows the error: android unable to instantiate activity componentinfo classnotfoundexception.
I've read a lot about this error. I've tried Project -> Properties -> Java Build Path -> Order & Export and ensure Android Private Libraries and all other library projects are checked.
I've also noticed that when I press ctrl and pass the mouse over, for example, .MainActivity in my Android Manifest file, it doesn't display or link me to the Activity, don't know why.
Any ideas about this problem? Thank you so much.
EDIT: Manifest added
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.isa.mememe"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="13"
android:targetSdkVersion="16" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</manifest>
Related
I am trying to integrate this Material Drawer to my project, however i am facing a Manifest error. I have tried changing the minSdk and targetSdk as it is suggested on some similar questions but with no success.
Here is the error i get:
Error:Execution failed for task ':app:processDebugManifest'.
> Error: [project_path\build\intermediates\exploded-aar\it.neokree\MaterialNavigationDrawer\1.2.9\AndroidManifest.xml:8] Invalid instruction 'overrideLibrary', valid instructions are : REMOVE,REPLACE,STRICT
Here is my app manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="my.package.name">
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<activity
android:name=".activities.SplashScreenActivity"
android:configChanges="orientation"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:theme="#style/NavigationDrawer" />
</application>
</manifest>
I am using Android Studio (Beta) 0.8.0.
What is causing this error?
I solved the error by going to the MaterialDrawer library Manifest and removing the uses-sdk:
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="21"
tools:overrideLibrary="at.markushi.ui" >
</uses-sdk>
I am not sure if that will bring up any error later on but at least it solve the problem i had
I'm trying to develop an android app that needs a user to record his voice.
I was following the Dev guide on http://developer.android.com/guide/topics/media/audio-capture.html
Eclipse gives me this error in my manifest file
The prefix "adroid" for attribute "adroid:name" associated with an element type "uses- permission" is not bound.`
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.rectest"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.rectest.MainActivity"
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>
Looks like you had a typo error when you first wrote the code.
`The prefix "adroid" for attribute "adroid:name" associated with an element type "uses- permission" is not bound`.`
As it should have been "android" and not "adroid".
The code you attached looks fine, so you should try to Clean and re-build your project.
Go to Project -> Clean -> Select your project. If this keeps, try to restart your eclipse.
I've edited and added features from a programme which has involved adding another class (not activity class) since then when I load the app onto my android device I cannot see an icon appear but the app appears in the Application Manager. I have no errors showing and have commented out each section of the new class to turn it back to the original app. Could anyone tell me whether the problem is most likely to be in the manifest, the main.xml or the activity class? Or if they have come across a similar problem?
Cannot publish code due to company policy.
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myAppName" <!-- real package name cannot be supplied -->
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAINACTIVITY" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<provider
android:name="com.example.MyAppName.ProviderClassName"
android:authorities="com.example.MyAppName.ProviderClassName"
/>
</application>
</manifest>
App works fine when tested from Eclipse on phone via USB/Sync, when I try and Export it to an .apk, the Manifest.xml looses track of 2 activities under the parent "MasterActvity". Then even the USB/Sync stops working because it can't locate the activities. No memory storage is used, just text displays.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.theoreferenceguide"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.theoreferenceguide.MasterActivity"
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="TipActivity"></activity> This keeps getting kicked out during .apk
<activity android:name="UccActivity"></activity> This keeps getting kicked out during .apk
</application>
</manifest>
I agree with nicopico. It looks like you are missing the . infront of the activity which tells the manifest that the activity is in the local namespace. Alternatively if TipActivity is in the same namespace as MasterActivity you can also do android:name="com.example.theoreferenceguide.TipActivity"
When I create an Android project in Eclipse and send it to my device for debugging, the app works fine but when I try to uninstall it, I get a strange message. Below are the steps to recreate my problem:
Eclipse Version: 4.2.0 Build id: I20120608-1400
ADT Version: 2.0.3 v201208082019-427395
Run Eclipse
Click File->New->Project...
Select Android/Android Application Project
Click Next.
Enter Application Name: Test
Build SDK: Android 4.1
Minimum Required SDK: API 8 Android 2.2
Enable: Create custom launcher icon / Create project in workspace
Click Next thrice.
Click Finish.
Connect 4.1 Android device to computer via USB.
Click Run->Run from menu.
Select "Android application" on popup the "Run As" popup.
Click Ok.
MainActivity application runs on device.
Click the Back button on the Android device.
Open applications on device and find "MainActivity" app.
Long press the MainActivity icon and drag to trash.
Here's the puzzling part:
Instead of getting a standard
Do you want to uninstall this app?
I get a dialog with this text:
MainActivity is part of the following app: Test
Do you want to uninstall this app?
Why do I get this message instead of the standard one?
Why is MainActivity the name of the app when I specifically stated the name of the app is "Test"?
Additional Information:
If I go to Settings->Apps, the Application shows up as Test but is listed in my Launcher as MainActivity.
AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<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" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
The solution is to remove android:label="#string/title_activity_main" in the activity element.
The AndroidManifest.xml below solves the problem on Android 4.1.1 .
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
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>
</application>
Make sure your app name app_name is not styled.
Since I was using the app name somewhere else in the app I had made it bold, like this - In my strings.xml
<string name="app_name"><b>We are sons<b></string>
When I removed
<b></b>
tags, it worked.
Just keep it :
<string name="app_name">We are sons</string>
I do not know how to solve the first issue but the second can be solved in the following way. The problem is connected with Android new project wizzard. To solve this problem you can correct your manifest file in the following way and redeploy your project:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<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" >
<intent-filter android:label="#string/app_name" >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Do not forget to check what is the value of app_name. Some more details you can find in this post