android.permission.INSTALL_PACKAGES not granted

Put your problem here if it does not fit any of the other categories.

android.permission.INSTALL_PACKAGES not granted

Postby keiko11245 » Mon Apr 20, 2009 1:32 pm

hi all,
I'm trying to develop an installer of android application like AppManager (the .apk is on SD Card).
I use PackageManager to display informations about the apk. It works fine.

But when I try to install the apk, I have an exception :
Code: Select all
04-20 12:10:33.597: ERROR/CatalogueActivity(443): java.lang.SecurityException: Neither user 10027 nor current process has android.permission.INSTALL_PACKAGES.
04-20 12:10:33.597: ERROR/CatalogueActivity(443):     at android.os.Parcel.readException(Parcel.java:1238)
04-20 12:10:33.597: ERROR/CatalogueActivity(443):     at android.os.Parcel.readException(Parcel.java:1226)
04-20 12:10:33.597: ERROR/CatalogueActivity(443):     at android.content.pm.IPackageManager$Stub$Proxy.installPackage(IPackageManager.java:1599)
04-20 12:10:33.597: ERROR/CatalogueActivity(443):     at android.app.ApplicationContext$ApplicationPackageManager.installPackage(ApplicationContext.java:2179)
04-20 12:10:33.597: ERROR/CatalogueActivity(443):     at android.content.pm.PackageManager.installPackage(PackageManager.java:1291)
04-20 12:10:33.597: ERROR/CatalogueActivity(443):     at com.orange.catalogue.CatalogueActivity.onCreate(CatalogueActivity.java:46)
04-20 12:10:33.597: ERROR/CatalogueActivity(443):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1122)
04-20 12:10:33.597: ERROR/CatalogueActivity(443):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2104)
04-20 12:10:33.597: ERROR/CatalogueActivity(443):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2157)
04-20 12:10:33.597: ERROR/CatalogueActivity(443):     at android.app.ActivityThread.access$1800(ActivityThread.java:112)
04-20 12:10:33.597: ERROR/CatalogueActivity(443):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1581)
04-20 12:10:33.597: ERROR/CatalogueActivity(443):     at android.os.Handler.dispatchMessage(Handler.java:88)
04-20 12:10:33.597: ERROR/CatalogueActivity(443):     at android.os.Looper.loop(Looper.java:123)
04-20 12:10:33.597: ERROR/CatalogueActivity(443):     at android.app.ActivityThread.main(ActivityThread.java:3739)
04-20 12:10:33.597: ERROR/CatalogueActivity(443):     at java.lang.reflect.Method.invokeNative(Native Method)
04-20 12:10:33.597: ERROR/CatalogueActivity(443):     at java.lang.reflect.Method.invoke(Method.java:515)
04-20 12:10:33.597: ERROR/CatalogueActivity(443):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
04-20 12:10:33.597: ERROR/CatalogueActivity(443):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
04-20 12:10:33.597: ERROR/CatalogueActivity(443):     at dalvik.system.NativeStart.main(Native Method)


But in my AndroidManifest.xml I have :

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  3.      package="com.orange.catalogue"
  4.      android:versionCode="1"
  5.      android:versionName="1.0.0">
  6.     <application android:icon="@drawable/icon" android:label="@string/app_name">
  7.         <activity android:name=".CatalogueActivity"
  8.                  android:label="@string/app_name">
  9.             <intent-filter>
  10.                 <action android:name="android.intent.action.MAIN" />
  11.                 <category android:name="android.intent.category.LAUNCHER" />
  12.             </intent-filter>
  13.         </activity>
  14.     </application>    
  15.     <uses-permission android:name="android.permission.INSTALL_PACKAGES" />
  16. </manifest>
Parsed in 0.003 seconds, using GeSHi 1.0.8.4


In the logcat, I have a warning :
Code: Select all
04-20 12:10:29.407: DEBUG/PackageManager(53): New package installed in /data/app/com.orange.catalogue.apk
04-20 12:10:29.407: WARN/PackageManager(53): Not granting permission android.permission.INSTALL_PACKAGES to package com.orange.catalogue (protectionLevel=2 flags=0x44)


I think this is my problem but I don't know how to solve it.

What am I suppose to do with my installer to have the INSTALL_PACKAGES permission??

I must sign it before install?

I read in a forum that I just have to copy my installer in /system/app. But this forder is read-only.

Thanks for any reply
keiko11245
Freshman
Freshman
 
Posts: 7
Joined: Tue Mar 10, 2009 11:49 am

Top

Re: android.permission.INSTALL_PACKAGES not granted

Postby flyer » Mon Oct 19, 2009 4:06 am

hi
i get the same problem ~ :o

did you solve it.
flyer
Freshman
Freshman
 
Posts: 8
Joined: Mon Jan 14, 2008 7:07 am

Postby poson » Mon Dec 14, 2009 4:18 am

Hi keiko11245,flyer:

I hava also got the same problem.
It troubled me some days.But I still cann't solve it.

It always says:
12-10 11:15:34.976: ERROR/AndroidRuntime(327): java.lang.SecurityException: Neither user 10058 nor current process has android.permission.INSTALL_PACKAGES.

I hava added the permission in my AndroidManifest.xml file.

I have no idea about this problem.
I'm very happy to meet you in the net.
Wish you can gave me some mind!
Thanks!
poson
Freshman
Freshman
 
Posts: 7
Joined: Thu Dec 10, 2009 4:50 am

Postby flyer » Mon Dec 14, 2009 3:23 pm

i did't find a good way to solve my problem.
maybe this is a bug or this api is only for system call (like some hidden apis )

sdk 2.0 has removed this api
flyer
Freshman
Freshman
 
Posts: 8
Joined: Mon Jan 14, 2008 7:07 am

Try this

Postby pranav09 » Tue Dec 15, 2009 12:26 pm

Hi

Now you try the <uses-permission android:name="android.permission.INSTALL_PACKAGES" /> before the application tag is start in the AndroidManifest.xml. i tried and it worked well.

OK!!
User avatar
pranav09
Senior Developer
Senior Developer
 
Posts: 128
Joined: Mon Jan 19, 2009 12:01 pm
Location: Ahmedabad, India

Re: Try this

Postby flyer » Tue Dec 15, 2009 1:45 pm

pranav09 wrote:Hi

Now you try the <uses-permission android:name="android.permission.INSTALL_PACKAGES" /> before the application tag is start in the AndroidManifest.xml. i tried and it worked well.

OK!!



i did a test ,but it also failed :(
which platform version you use . i do my test under sdk1.5

i paste my manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.alex.android.mapdemo"
android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="android.permission.INSTALL_PACKAGES"></uses-permission>
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".MapDemoActivity"
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>
<uses-sdk android:minSdkVersion="3" />
</manifest>
flyer
Freshman
Freshman
 
Posts: 8
Joined: Mon Jan 14, 2008 7:07 am

Top

Re: Try this

Postby poson » Wed Dec 16, 2009 2:36 am

pranav09 wrote:Hi

Now you try the <uses-permission android:name="android.permission.INSTALL_PACKAGES" /> before the application tag is start in the AndroidManifest.xml. i tried and it worked well.

OK!!


Hi,pranav09
I also tried it as you saied.It still didn't work well. The exception it shows are same to the old.
How did u try it done?
Could you gave me more help?

Thanks!
poson
Freshman
Freshman
 
Posts: 7
Joined: Thu Dec 10, 2009 4:50 am

Postby poson » Thu Dec 17, 2009 2:00 pm

Hi flyer,
Very glad to discuss the problem with you!

I have a little progress.
I did:
Code: Select all
private void startInstallAppTest() {
String apkpath = Environment.getExternalStorageDirectory()
   + "/HelloWord1.apk";
Log.e(tag, "apkfile --------->" + apkpath);
Uri packageUri = Uri.fromFile(new File(apkpath));
//set permissions
PermissionInfo p = new PermissionInfo();
pm.addPermission(p);//error
PackageInstallObserver observer = new PackageInstallObserver();
pm.installPackage(packageUri, observer, 1);
}


my Manifest.xml file :
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  2.         package="android.installer.test" android:versionCode="1"
  3.         android:versionName="1.0">
  4.         <uses-permission android:name="android.permission.INSTALL_PACKAGES" />
  5.         <uses-permission android:name="android.permission.DELETE_PACKAGES" />
  6.         <uses-permission android:name="android.permission.CLEAR_APP_CACHE" />
  7.         <uses-permission android:name="android.permission.ACCESS_DOWNLOAD_MANAGER" />
  8.         <uses-permission android:name="android.permission.INTERNET" />
  9.         <uses-permission android:name="android.permission.READ_OWNER_DATA" />
  10.         <application android:icon="@drawable/icon" android:label="@string/app_name">
  11.                 <activity android:name=".AndroidInstallTest" android:label="@string/app_name">
  12.                         <intent-filter>
  13.                                 <action android:name="android.intent.action.MAIN" />
  14.                                 <category android:name="android.intent.category.LAUNCHER" />
  15.                         </intent-filter>
  16.                 </activity>
  17.         </application>
  18.         <permission-tree android:icon="@drawable/icon"
  19.                 android:label="@string/test" android:name="android.installer.test" />
  20.         <uses-sdk android:minSdkVersion="3" />
  21. </manifest>
  22.  
  23.  
Parsed in 0.004 seconds, using GeSHi 1.0.8.4



Now it says:
Code: Select all
E/AndroidInstallTest( 6113): apkfile --------->/sdcard/HelloWord1.apk

D/AndroidRuntime( 6113): Shutting down VM

W/dalvikvm( 6113): threadid=3: thread exiting with uncaught exception (group=0x40017e68)

E/AndroidRuntime( 6113): Uncaught handler: thread main exiting due to uncaught exception

D/dalvikvm( 6113): GC freed 6795 objects / 380856 bytes in 54ms


E/AndroidRuntime( 6113): java.lang.SecurityException: Label must be specified in permission


E/AndroidRuntime( 6113):    at android.os.Parcel.readException(Parcel.java:1234)

E/AndroidRuntime( 6113):    at android.os.Parcel.readException(Parcel.java:1222)

E/AndroidRuntime( 6113):    at android.content.pm.IPackageManager$Stub$Proxy.addPermission(IPackageManager.java:1169)

E/AndroidRuntime( 6113):    at android.app.ApplicationContext$ApplicationPackageManager.addPermission(ApplicationContext.java:1644)

[b]E/AndroidRuntime( 6113):    at android.installer.test.AndroidInstallTest.startInstallAppTest(AndroidInstallTest.java:125)[/b]

E/AndroidRuntime( 6113):    at android.installer.test.AndroidInstallTest.surebuttonDo(AndroidInstallTest.java:77)

E/AndroidRuntime( 6113):    at android.installer.test.AndroidInstallTest.access$0(AndroidInstallTest.java:74)

E/AndroidRuntime( 6113):    at android.installer.test.AndroidInstallTest$1.onClick(AndroidInstallTest.java:63)

E/AndroidRuntime( 6113):    at android.view.View.performClick(View.java:2134)

E/AndroidRuntime( 6113):    at android.view.View.onTouchEvent(View.java:3712)

E/AndroidRuntime( 6113):    at android.widget.TextView.onTouchEvent(TextView.java:5372)

E/AndroidRuntime( 6113):    at android.view.View.dispatchTouchEvent(View.java:3277)

E/AndroidRuntime( 6113):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:860)

E/AndroidRuntime( 6113):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:860)

E/AndroidRuntime( 6113):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:860)

E/AndroidRuntime( 6113):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:860)

E/AndroidRuntime( 6113):    at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1628)

E/AndroidRuntime( 6113):    at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1105)

E/AndroidRuntime( 6113):    at android.app.Activity.dispatchTouchEvent(Activity.java:1955)

E/AndroidRuntime( 6113):    at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1612)

E/AndroidRuntime( 6113):    at android.view.ViewRoot.handleMessage(ViewRoot.java:1486)

E/AndroidRuntime( 6113):    at android.os.Handler.dispatchMessage(Handler.java:99)

E/AndroidRuntime( 6113):    at android.os.Looper.loop(Looper.java:123)

E/AndroidRuntime( 6113):    at android.app.ActivityThread.main(ActivityThread.java:3818)

E/AndroidRuntime( 6113):    at java.lang.reflect.Method.invokeNative(Native Method)

E/AndroidRuntime( 6113):    at java.lang.reflect.Method.invoke(Method.java:521)

E/AndroidRuntime( 6113):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745)

E/AndroidRuntime( 6113):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:503)

E/AndroidRuntime( 6113):    at dalvik.system.NativeStart.main(Native Method)


How to solve this problem?

The error is at line :
PermissionInfo p = new PermissionInfo();
pm.addPermission(p);
or
<permission-tree android:icon="@drawable/icon"
android:label="@string/test" android:name="android.installer.test" />

Could you have a look at it ? And maybe you'll find something new !
Thanks!
poson
Freshman
Freshman
 
Posts: 7
Joined: Thu Dec 10, 2009 4:50 am

Postby Kacper86 » Tue Feb 16, 2010 9:41 am

it's a kind of permission that your application won't get until your phone is roooted.
Kacper86
Freshman
Freshman
 
Posts: 3
Joined: Wed Sep 09, 2009 12:30 pm

Re: android.permission.INSTALL_PACKAGES not granted

Postby helancy » Wed Oct 26, 2011 2:59 am

Manufacturers with american football shirts right now try and complete a assortment of liverpool football shirt to the admirers which look like very much like the main ac milan shirt how the people dress in in the grass, and you will nonetheless find a little designs to the &
helancy
Junior Developer
Junior Developer
 
Posts: 12
Joined: Wed Oct 26, 2011 2:41 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 20 guests