ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.act - android

I have a problem...
I'm making a simple program about GIS, and when I'm trying to launch it from eclipse to my device, I get warning when I check the console.
ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.warteg.GIS/.Splash } from null (pid=16196, uid=2000) requires null
and the program is not installed in my device, but when I try with emulator from eclipse, the program is launched.
Can someone solve my problem? Here's my manifest XML.
<?xml version="1.0" encoding="utf-8"?>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name="Splash"
android:label="#string/app_name">
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<uses-library android:name="com.google.android.maps"></uses-library>
<activity android:name=".Splash"></activity>
<activity android:name=".FormPetunjuk"></activity>
<activity android:name=".Peta"></activity>
</application>

your are registering Splash activity two times in manifest.xml so remove this one:
<activity android:name=".Splash"></activity>

Related

Android exception: Runtime exception on launching login activity

I'm an android newbie. I'm using the android studio and connecting to a device, 4.04, api 14. I created a default login activity. It throws up the following exception:
Launching application: com.noatta.www.noatta_14/com.noatta.www.noatta_14.LoginActivity.
DEVICE SHELL COMMAND: am start -n "com.noatta.www.noatta_14/com.noatta.www.noatta_14.LoginActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.noatta.www.noatta_14/.LoginActivity }
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.noatta.www.noatta_14/.LoginActivity } from null (pid=16079, uid=2000) not exported from uid 10127
at android.os.Parcel.readException(Parcel.java:1332)
at android.os.Parcel.readException(Parcel.java:1286)
at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1691)
at com.android.commands.am.Am.runStart(Am.java:451)
at com.android.commands.am.Am.run(Am.java:107)
at com.android.commands.am.Am.main(Am.java:80)
at com.android.internal.os.RuntimeInit.finishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:260)
at dalvik.system.NativeStart.main(Native Method)
Manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.noatta.www.noatta_14" >
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".LoginActivity"
android:label="#string/app_name"
android:windowSoftInputMode="adjustResize|stateHidden" >
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
<!-- To access Google+ APIs: -->
<uses-permission android:name="android.permission.INTERNET" />
<!--
To retrieve OAuth 2.0 tokens or invalidate tokens to disconnect a user. This disconnect
option is required to comply with the Google+ Sign-In developer policies
-->
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<!-- To retrieve the account name (email) as part of sign-in: -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- To auto-complete the email text field in the login form with the user's emails -->
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
</manifest>
Anybody have a suggestion on how to prevent the read exception?
You're missing <intent-filter> in activity definition:
<activity
android:name=".LoginActivity"
android:label="#string/app_name"
android:windowSoftInputMode="adjustResize|stateHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
You are missing the intent-filter and the exception states you were missing the android:exported="true" in your AndroidManifest.xml
<activity
android:name=".LoginActivity"
android:label="#string/app_name"
android:windowSoftInputMode="adjustResize|stateHidden"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

Changing default activity in android

hello I want to change default activity. But when I do that the app doesn't launch at all without any errors
<activity
android:name="com.example.dimmer.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>
<activity
android:name="com.example.dimmer.DevicesActivity" >
</activity>
This way MainActivty launches with no proble. It also goes to Device activity when I press the button. So everything works fine.
Now I need DevcieACtivty to be default one.
I change Manifest like that
<activity
android:name="com.example.dimmer.DevicesActivity"
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="com.example.dimmer.MainActivity" >
</activity>
but now app doesn't launch. no errors. nothing is written in console.
it's just doesn't do anything,
what might be a problem?
It starts to write the following error
ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.dimmer/.MainActivity }
[2014-05-16 21:17:10 - Dimmer] ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.dimmer/.MainActivity } from null (pid=13093, uid=2000) requires null
full Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dimmer"
android:versionCode="1"
android:versionName="1.0"
android:hardwareAccelerated="false">
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="14" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.dimmer.DevicesActivity"
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="com.example.dimmer.MainActivity" >
</activity>
</application>
</manifest>
[2014-05-16 22:13:25 - Dimmer] Android Launch!
[2014-05-16 22:13:25 - Dimmer] adb is running normally.
[2014-05-16 22:13:25 - Dimmer] Performing com.example.dimmer.MainActivity activity launch
[2014-05-16 22:13:26 - Dimmer] Uploading Dimmer.apk onto device 'SH17VT514235'
[2014-05-16 22:13:26 - Dimmer] Installing Dimmer.apk...
[2014-05-16 22:13:29 - Dimmer] Success!
[2014-05-16 22:13:29 - Dimmer] Starting activity com.example.dimmer.MainActivity on device SH17VT514235
[2014-05-16 22:13:29 - Dimmer] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.dimmer/.MainActivity }
[2014-05-16 22:13:29 - Dimmer] ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.dimmer/.MainActivity } from null (pid=15458, uid=2000) requires null
Since you've defined your package as "com.example.dimmer", you can remove package name and use just the name of Activity with dot in front:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".DevicesActivity"
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=".MainActivity" >
</activity>
</application>
Moreover, check your Run configuration settings in Eclipse. If your launching activity was set to MainActivity, and in manifest you make DevicesActivity as main, your app might not start when launching via Eclipse. Click arrow for RUN icon and choose "Run Configurations",
Then make sure you choose DevicesActivity as Launch:
Uninstall the app on your phone, and redownload it.
Make sure you implement setContentView in onCreate method.
In other way try clean the project Project > Clean and run it.
I am not sure but Now you can some step a head.
such as
1. delete Android.R (in above in your activity )
2. or replace package.R for example , com.example.name.R
3. check you res folder or sub-folder resources .
such as layout attribute right or not.
4. Delete gen and bin folder.
5. clean your project thus: project=>clean
6. restart your eclipse.
Remember that if your resource not found then show this type error.
Best of luck!
Click arrow for RUN icon and choose "Run Configurations"
Android Application =>select project
open Target tab
select Always prompt to divice
click run and select Divice online

Cannot use some Android emulators: Permission Denied

I have problems running the latest Android emulators like "Nexus 7, Android 4.1.2". The emulator can start, but I can't deploy on it (by Maven) which probably depends on this problem: When I switch on the phone to the Apps view, I get "Unfortunately, launcher has stopped" and LogCat gives me the following output:
01-02 14:30:26.313: W/ActivityManager(151): Permission denied:
checkComponentPermission() owningUid=1000 01-02 14:30:26.313:
W/BroadcastQueue(151): Permission Denial: broadcasting Intent {
act=android.appwidget.action.APPWIDGET_UPDATE_OPTIONS flg=0x10
cmp=com.android.settings/.widget.SettingsAppWidgetProvider (has
extras) } from android (pid=970, uid=10014) is not exported from uid
1000 due to receiver
com.android.settings/com.android.settings.widget.SettingsAppWidgetProvider
My AndroidManifest looks like this:
<uses-permission android:name="android.permission.INTERNET" />
<uses-sdk
android:minSdkVersion="5"
android:targetSdkVersion="7" />
<application
android:name="my.domain.appcontext.ApplicationContext"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:allowBackup="true">
<activity
android:name="my.domain.appcontext.activities.MainActivity"
android:screenOrientation="nosensor"
android:theme="#android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="my.domain.appcontext.activities.MainMenuDialogActivity"
android:excludeFromRecents="true"
android:theme="#style/Theme.Dialog" >
</activity>
<activity
android:name="my.domain.appcontext.activities.DistrictMenuDialogActivity"
android:excludeFromRecents="true"
android:theme="#style/Theme.Dialog" >
</activity>
<activity
android:name="my.domain.appcontext.activities.StreetMenuPreselectionDialogActivity"
android:excludeFromRecents="true"
android:theme="#style/Theme.Dialog" >
</activity>
<activity
android:name="my.domain.appcontext.activities.StreetMenuDialogActivity"
android:excludeFromRecents="true"
android:theme="#style/Theme.Dialog" >
</activity>
<uses-library android:name="com.google.android.maps"
android:required="true" />
</application>
Any ideas?
Are you trying to send the android.appwidget.action.APPWIDGET_UPDATE broadcast somewhere in your code? This is an Android OS broadcast, so you won't have permission to use it if you are...

Android app built in eclipse wont run on phone

I've built an app that runs fine on the emulators, and says that it installs ok on the phone. However, on trying to run it an error pops up saying 'Application is not installed on your phone'. So I tried running the app through eclipse on the phone and I got this error in the console:
[2012-05-01 12:00:02 - MAD Assignment] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.mad.assignment/.MainMenu }
[2012-05-01 12:00:02 - MAD Assignment] ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.mad.assignment/.MainMenu } from null (pid=8204, uid=2000) requires null
From looking for the solution elsewhere it sounds as though it could be a problem in the manifest file, so here is mine:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mad.assignment"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
>
<activity
android:name="MainMenu"
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=".Diary"></activity>
<activity android:name=".Info"></activity>
<activity android:name=".MapMenu"></activity>
<activity android:name=".RSSMenu"></activity>
<activity android:name=".RSSFeedView"></activity>
<activity android:name=".MainMenu"></activity>
<activity android:name=".RSSDetailed"></activity>
<activity android:name=".DiarySchedule"></activity>
<activity android:name=".DiaryAddEntry"></activity>
<activity android:name=".DiaryEditEntry"></activity>
<activity android:name=".DiaryDetailed"></activity>
<activity android:name=".RSSDetailed"></activity>
<uses-library android:name="com.google.android.maps"/>
<activity android:name=".MapMain"></activity>
<activity android:name=".RSSFeedView"></activity>
<activity android:name=".MapWhatsNearPreferences"></activity>
<activity android:name=".RoutePath"></activity>
</application>
Any ideas what this security exception is pointing to? Thanks!
The java.lang.SecurityException you are seeing is because you may enter two entries pointing to same activity. Remove the second one and you should be good to go.
You may be declared the activity 2 times in the manifest with different properties, like :
<activity android:name=".MainMenu"> </activity>
and
<activity android:name=".MainMenu" android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
You should remove the unwanted one from the manifest
Set android:debuggable="true" under application.
You have an activity named
<activity android:name=".MainMenu"></activity>
Which is the Intent'ed activity from the launcher. But the activity to which you gave permission is "Mainmenu". Remove it. Add the permission and etc to the ".Mainmenu" which is blank now.
ie,
The 'activity' group should be
<activity
android:name=".MainMenu"
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=".Diary"></activity>
<activity android:name=".Info"></activity>
<activity android:name=".MapMenu"></activity>
<activity android:name=".RSSMenu"></activity>
<activity android:name=".DiarySchedule"></activity>
<activity android:name=".DiaryAddEntry"></activity>
<activity android:name=".DiaryEditEntry"></activity>
<activity android:name=".DiaryDetailed"></activity>
<activity android:name=".RSSDetailed"></activity>
<uses-library android:name="com.google.android.maps"/>
<activity android:name=".MapMain"></activity>
<activity android:name=".RSSFeedView"></activity>
<activity android:name=".MapWhatsNearPreferences"></activity>
<activity android:name=".RoutePath"></activity>
And remove the duplicates as well. Why did you add so many duplicate 'activities' ?

java.lang.SecurityException: Permission Denial: starting Intent

I am a newbie to Android application development... When i try to run my application i am getting a security exception as Permission Denial... though i am able to open my application i am unable to proceed to any of the process... Application doesn't access the web service... Plz help me out...
The following is the exception message I receive,
[2012-01-11 11:02:09 - eCalc] ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.anb.eCalculator/.LoginActivity } from null (pid=-1, uid=-1) requires android.permission.INTERNET
enter code here
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.anb.eCalculator"
android:installLocation="internalOnly"
android:versionName="1.2.1" android:versionCode="10">
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<application android:label="#string/app_name"
android:theme="#android:style/Theme"
android:permission="android.permission.INTERNET"
android:icon="#drawable/ecalcicon" android:allowClearUserData="true">
<activity android:name=".LoginActivity"
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=".CalculationActivity"></activity>
<activity android:name="ResultActivity"></activity>
<activity android:name=".InformationActivity"></activity>
<activity android:name=".RegisterActivity"></activity>
<activity android:name=".SettingsActivity"></activity>
<activity android:name=".ResultDetailsActivity"></activity>
<activity android:name=".Disclaimer"></activity>
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-sdk android:targetSdkVersion="5"
android:minSdkVersion="5"
android:maxSdkVersion="12">
</uses-sdk>
<uses-permission android:name="android.permission.INTERNET" />
Add this above line in your manifest file after your <uses-sdk> line.
Add this permission to your manifest file.
<uses-permission android:name="android.permission.INTERNET" />
I fixed it .
Click on "Run" and "Edit configuration". Select the activity you want to launch.

Categories

Resources