Exception prompt
When both Eclipse and Android studio are in use, I have encountered an exception with the following specific error message:
ava.lang.SecurityException:Permission denial:starting Intent {act=android. Intent. Action. MAINCat=[android. Intent. Category. LAUNCHER] Flg=0x10000000cmp=com. XXX. XXX/. Activity. Splashactivity} from Null (pid=00000, uid=0000) not exported from UID00000Activitymanager:At Android. OS. Parcel. Readexception(Parcel. Java:1425)Activitymanager:At Android. OS. Parcel. Readexception(Parcel. Java:1379)Activitymanager:At Android. App. Activitymanagerproxy. Startactivityasuser(activitymanagernative. Java:1965)Activitymanager:Atcom. Android. Commands. Am. Am. Runstart(Am. Java:494)Activitymanager:Atcom. Android. Commands. Am. Am. Run(Am. Java:109)Activitymanager:Atcom. Android. Commands. Am. Am. Main(Am. Java: the)Activitymanager:Atcom. Android. Internal. OS. Runtimeinit. Nativefinishinit(Native Method)Activitymanager:Atcom. Android. Internal. OS. Runtimeinit. Main(Runtimeinit. Java:235)Activitymanager:At Dalvik. System. Nativestart. Main(Native Method)
Cause of error
According to the exception prompt and search, this error is caused by the start page splashactivity, Then I checked the splashactivity code and the Androidmanifest.xml, but did not find the error, and later I found that the same project was working in Android studio, but this exception was reported in Eclipse, So I focused on the Eclipse IDE's splashactivity and Androidmanifest.xml, which only found that there was a difference, and the startup page setting in my project's androridmanifest.xml was this:
<activityandroid:name=". Activity. Splashactivity "android:configchanges=" Orientation|keyboardhidden|screensize "Android : Label="@string/app_name"android:screenorientation="Portrait"android: Windowsoftinputmode="Statehidden|adjustpan" > <intent-filter> <action android:name="Android.intent.action.MAIN" />-<category android:name="Android.intent.category.LAUNCHER" /> </intent-filter> </activity>
After the < action android:name= "Android.intent.action.MAIN"/> a suffix like "–>", it is because of such a suffix, When my project was compiled in Eclipse, the < action android:name= "Android.intent.action.MAIN"/> was written off, and then my app was out of use, However, in Android Studio, the latter part of the comment symbol is ignored by the IDE, can be compiled normally.
This may be the case I gave < action android:name= "Android.intent.action.MAIN"/> comment once, but the cancellation is only manually removed the upper part of the comment symbol, Forget the bottom half.
Finally, I delete the "–>" in androidmanifest.xml to compile normally in eclipse, it seems that the same project group is better to use the same IDE, otherwise, because of the differences between Android studio and Eclipse IDE, Some unexpected errors may occur. Of course, I definitely recommend Android Studio!
Reference links
Http://www.verydemo.com/demo_c131_i71738.html
"Android" Java.lang.SecurityException:Permission denial:starting Intent App startup failure exception