Closed Bug 976340 Opened 10 years ago Closed 8 years ago

Installation fails with java.io.FileNotFoundException when using Google Install and Verify option

Categories

(Firefox for Android Graveyard :: Web Apps (PWAs), defect, P1)

29 Branch
Other
Android
defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: krupa.mozbugs, Unassigned)

References

Details

(Keywords: reproducible, Whiteboard: [WebRuntime])

Attachments

(3 files)

Attached image screenshot 1
Android 4.0.4/ Firefox mobile (2014-02-24)

setup:
1) about:config
2) search for apk
3) Change browser.webapps.apkFactoryUrl to https://apk-controller.stage.mozaws.net/application.apk

steps to reproduce:
1. Load marketplace-dev.allizom.org on your firefox mobile nightly
2. Search for the app Ginger
3. Click the button to install
4. During install, select the option to Google option to Verify and install


observed behavior:
install fails with 'There was a problem parsing the packaged'. Note that choosing the Android verify and install option doesn't hit this issue.

logcat shows:
02-24 15:07:21.870 W/PackageParser( 3278): Exception reading /mnt/sdcard/Download/httpsgingerhqcomstaticmanifestwebapp.apk
02-24 15:07:21.870 W/PackageParser( 3278): java.io.FileNotFoundException: /mnt/sdcard/Download/httpsgingerhqcomstaticmanifestwebapp.apk: open failed: ENOENT (No such file or directory)
02-24 15:07:21.870 W/PackageParser( 3278): 	at libcore.io.IoBridge.open(IoBridge.java:406)
02-24 15:07:21.870 W/PackageParser( 3278): 	at java.io.RandomAccessFile.<init>(RandomAccessFile.java:118)
02-24 15:07:21.870 W/PackageParser( 3278): 	at java.io.RandomAccessFile.<init>(RandomAccessFile.java:150)
02-24 15:07:21.870 W/PackageParser( 3278): 	at java.util.zip.ZipFile.<init>(ZipFile.java:130)
02-24 15:07:21.870 W/PackageParser( 3278): 	at java.util.zip.ZipFile.<init>(ZipFile.java:145)
02-24 15:07:21.870 W/PackageParser( 3278): 	at java.util.jar.JarFile.<init>(JarFile.java:219)
02-24 15:07:21.870 W/PackageParser( 3278): 	at java.util.jar.JarFile.<init>(JarFile.java:204)
02-24 15:07:21.870 W/PackageParser( 3278): 	at android.content.pm.PackageParser.collectCertificates(PackageParser.java:504)
02-24 15:07:21.870 W/PackageParser( 3278): 	at android.content.pm.PackageManager.getPackageArchiveInfo(PackageManager.java:2154)
02-24 15:07:21.870 W/PackageParser( 3278): 	at com.google.android.vending.verifier.PackageVerificationService.getPackageInfo(PackageVerificationService.java:589)
02-24 15:07:21.870 W/PackageParser( 3278): 	at com.google.android.vending.verifier.PackageVerificationService.access$000(PackageVerificationService.java:59)
02-24 15:07:21.870 W/PackageParser( 3278): 	at com.google.android.vending.verifier.PackageVerificationService$WorkerTask.doInBackground(PackageVerificationService.java:294)
02-24 15:07:21.870 W/PackageParser( 3278): 	at com.google.android.vending.verifier.PackageVerificationService$WorkerTask.doInBackground(PackageVerificationService.java:264)
02-24 15:07:21.870 W/PackageParser( 3278): 	at android.os.AsyncTask$2.call(AsyncTask.java:264)
02-24 15:07:21.870 W/PackageParser( 3278): 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
02-24 15:07:21.870 W/PackageParser( 3278): 	at java.util.concurrent.FutureTask.run(FutureTask.java:137)
02-24 15:07:21.870 W/PackageParser( 3278): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
02-24 15:07:21.870 W/PackageParser( 3278): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
02-24 15:07:21.870 W/PackageParser( 3278): 	at java.lang.Thread.run(Thread.java:856)
02-24 15:07:21.870 W/PackageParser( 3278): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
02-24 15:07:21.870 W/PackageParser( 3278): 	at libcore.io.Posix.open(Native Method)
02-24 15:07:21.870 W/PackageParser( 3278): 	at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
02-24 15:07:21.870 W/PackageParser( 3278): 	at libcore.io.IoBridge.open(IoBridge.java:390)
02-24 15:07:21.870 W/PackageParser( 3278): 	... 18 more
02-24 15:07:21.875 I/power   ( 1978): *** acquire_dvfs_lock : lockType : 1  freq : 1200000 
02-24 15:07:21.875 I/ActivityManager( 1978): START {intent.toShortString} from pid 3278
02-24 15:07:21.875 D/PowerManagerService( 1978): acquireDVFSLockLocked : type : DVFS_MIN_LIMIT  frequency : 1200000  uid : 1000  pid : 1978  tag : ActivityManager
02-24 15:07:21.875 W/ActivityManager( 1978): mDVFSLock.acquire()
02-24 15:07:21.960 D/dalvikvm( 1978): GC_FOR_ALLOC freed 941K, 55% free 17680K/38919K, paused 81ms
02-24 15:07:21.980 E/DataRouter( 1818): usb connection is true 
02-24 15:07:21.980 E/DataRouter( 1818): DSR is ON. Don't send DTR ON.
02-24 15:07:21.985 D/GeckoHealthRec( 5144): Recording session end: P
02-24 15:07:21.995 D/ActivityManager( 1978): Trying to launch applicationName
02-24 15:07:22.005 W/PackageInstaller( 4050): Parse error when parsing manifest. Discontinuing installation
Attached file manifest.webapp
Not sure if it's manifest related but here's a copy from https://gingerhq.com/static/manifest.webapp
myk, any ideas why Android may be looking for /mnt/sdcard/Download/httpsgingerhqcomstaticmanifestwebapp.apk and not finding it?
Flags: needinfo?(myk)
Hmm, I don't get prompted to choose between Google and Android options for verifying and installing the APK on my test device.

Krupa: do you have any suggestions for how to configure a device to display that prompt?


(In reply to Kumar McMillan [:kumar] (needinfo for quickness) from comment #2)
> myk, any ideas why Android may be looking for
> /mnt/sdcard/Download/httpsgingerhqcomstaticmanifestwebapp.apk and not
> finding it?

Not really, but the client deletes the APK after trying to install it, so perhaps it's deleting it too early in this case?
Flags: needinfo?(myk) → needinfo?(krupa.mozbugs)
(In reply to Myk Melez [:myk] [@mykmelez] from comment #3)
> Hmm, I don't get prompted to choose between Google and Android options for
> verifying and installing the APK on my test device.
> 
> Krupa: do you have any suggestions for how to configure a device to display
> that prompt?

On your android device, Search for Google Settings and then select the option to Verify apps.
Flags: needinfo?(krupa.mozbugs)
I hit this bug even after choosing the default Android Package installer.

03-12 13:46:04.220 W/PackageParser(24723): Unable to read AndroidManifest.xml of /mnt/sdcard/Download/httpsmarketplacefirefoxcomreviewersthehauntedmansion1527566minimanifesttokene45222bb3014497092de321963bc9379.apk
03-12 13:46:04.220 W/PackageParser(24723): java.io.FileNotFoundException: AndroidManifest.xml
03-12 13:46:04.220 W/PackageParser(24723): 	at android.content.res.AssetManager.openXmlAssetNative(Native Method)
03-12 13:46:04.220 W/PackageParser(24723): 	at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:487)
03-12 13:46:04.220 W/PackageParser(24723): 	at android.content.res.AssetManager.openXmlResourceParser(AssetManager.java:455)
03-12 13:46:04.220 W/PackageParser(24723): 	at android.content.pm.PackageParser.parsePackage(PackageParser.java:427)
03-12 13:46:04.220 W/PackageParser(24723): 	at com.android.packageinstaller.PackageUtil.getPackageInfo(PackageUtil.java:74)
03-12 13:46:04.220 W/PackageParser(24723): 	at com.android.packageinstaller.PackageInstallerActivity.onCreate(PackageInstallerActivity.java:277)
03-12 13:46:04.220 W/PackageParser(24723): 	at android.app.Activity.performCreate(Activity.java:4465)
03-12 13:46:04.220 W/PackageParser(24723): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1052)
03-12 13:46:04.220 W/PackageParser(24723): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1932)
03-12 13:46:04.220 W/PackageParser(24723): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1993)
03-12 13:46:04.220 W/PackageParser(24723): 	at android.app.ActivityThread.access$600(ActivityThread.java:127)
03-12 13:46:04.220 W/PackageParser(24723): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1159)
03-12 13:46:04.220 W/PackageParser(24723): 	at android.os.Handler.dispatchMessage(Handler.java:99)
03-12 13:46:04.220 W/PackageParser(24723): 	at android.os.Looper.loop(Looper.java:137)
03-12 13:46:04.220 W/PackageParser(24723): 	at android.app.ActivityThread.main(ActivityThread.java:4507)
03-12 13:46:04.220 W/PackageParser(24723): 	at java.lang.reflect.Method.invokeNative(Native Method)
03-12 13:46:04.220 W/PackageParser(24723): 	at java.lang.reflect.Method.invoke(Method.java:511)
03-12 13:46:04.220 W/PackageParser(24723): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
03-12 13:46:04.220 W/PackageParser(24723): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
03-12 13:46:04.220 W/PackageParser(24723): 	at dalvik.system.NativeStart.main(Native Method)
Component: Consumer Pages → Web Apps
Product: Marketplace → Firefox for Android
QA Contact: aaron.train
Version: 1.5 → Firefox 29
I have that setting as default and am not seeing this. I suspect it's because I am using the default system installer and not Google's. I don't remember which system app I need to clear defaults to re-invoke the choice to use Google's new installer. Anyone know?
Opening up the application info for 'Package Installer', clear defaults is greyed out so I don't know how to bring forth any opportunity to present the option to switch package installers again.
I wonder if this is specific to the version of Android.  Krupa tested on 4.0.4, which still has a good deal of marketshare <http://en.wikipedia.org/wiki/Android_%28operating_system%29#Platform_usage>, so this could affect a significant number of users.

aaronmt: which version of Android are you using to test?  I've been testing on 4.3, which didn't give me the option to choose the other installer.
Flags: needinfo?(aaron.train)
Priority: -- → P1
Whiteboard: [WebRuntime]
Attached image screenshot.png
This is not Android platform specific.

The Google APK verification support was introduced with a somewhat recent update a while ago to Google Search (make sure you have that application updated on your testing device).

On my Samsung Galaxy SII (Android 4.1.2) device, after updating Google Search, I now see the Google Settings application is installed.

To see the 'complete action via' dialog,

Force Stop & Clear Defaults on:

* Package Installer
* Google Search

Upon attempt to install an APK now from Marketplace one will see what is shown in the attached screenshot.

Using the verify and install option:

D/Finsky  ( 7244): [613] PackageVerificationService.getPackageInfo: Error while calculating sha256 for file=file:///storage/sdcard0/Download/httpbear7555testmanifestcommanifestwebapp.apk, error=java.io.FileNotFoundException: /storage/sdcard0/Download/httpbear7555testmanifestcommanifestwebapp.apk: open failed: ENOENT (No such file or directory)
Flags: needinfo?(aaron.train)
Keywords: reproducible
Per bug 1235869, we're going to disable the Android web runtime, so we won't fix this bug in it.

(This is part of a bulk resolution of bugs in the Firefox for Android::Web Apps component, from which I attempted to exclude bugs that are not specific to the runtime, but it's possible that I included one accidentally.  If so, I'm sorry, and please reopen the bug!)
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: