0

//cannot install apk on my mobile, it throws me the following error when i push the app from adb

D/PackageParser( 1336): Scanning package: /system/app/Contacts.apk
I/PackageManager( 1336): /system/app/Contacts.apk changed; collecting certs
D/PackageManager( 1336): Scanning package com.android.contacts
D/PackageManager( 1336): Shared UserID android.uid.shared (uid=10002): packages=   [PackageSetting{405f1ad8 com.android.providers.applications/10002}, PackageSetting{405f1890 com.android.providers.contacts/10002}, PackageSetting{405efa20 com.android.contacts/10002}, PackageSetting{405f0ae0 com.android.providers.userdictionary/10002}]
I/dalvikvm( 1336): Zip is good, but no classes.dex inside, and no .odex file in the same directory
W/PackageManager( 1336): IOException reading apk: /system/app/Contacts.apk
W/PackageManager( 1336): java.io.IOException: /system/app/Contacts.apk
W/PackageManager( 1336):    at dalvik.system.DexFile.isDexOptNeeded(Native Method)
W/PackageManager( 1336):    at com.android.server.PackageManagerService.performDexOptLI(PackageManagerService.java:2880)
W/PackageManager( 1336):    at com.android.server.PackageManagerService.scanPackageLI(PackageManagerService.java:3424)
W/PackageManager( 1336):    at com.android.server.PackageManagerService.scanPackageLI(PackageManagerService.java:2809)
W/PackageManager( 1336):    at com.android.server.PackageManagerService.access$2100(PackageManagerService.java:143)
W/PackageManager( 1336):    at com.android.server.PackageManagerService$AppDirObserver.onEvent(PackageManagerService.java:4693)
W/PackageManager( 1336):    at android.os.FileObserver$ObserverThread.onEvent(FileObserver.java:125)
W/PackageManager( 1336):    at android.os.FileObserver$ObserverThread.observe(Native Method)
W/PackageManager( 1336):    at android.os.FileObserver$ObserverThread.run(FileObserver.java:88)

I am compiling using mmm /root/android/system/packages/apps/Contacts/

My doubt is when i recently rebooted my machine the output directory of the installed app is changed from OldPath : /root/android/system/out/target/product/vision/system/app to NewPath : /root/android/system/out/target/product/generic/system/app

all my other apps are present in the old path and when i install the contacts.apk from old path it installs properly and after i rebooted my machine and when i try to install from the new path where it is built, it gives me the following error. I don't understand what enviroment issue could that be? Could any one suggest me what can be done.

adb push Contacts.apk /system/app/Contacts.apk

srp
  • 521
  • 11
  • 22
  • This has nothing to do with C or layouts, removing tags. – m0skit0 Jul 02 '13 at 12:08
  • Wrong APK. How do you build your APK? – m0skit0 Jul 02 '13 at 12:09
  • I am building it in the ubuntu terminal window – srp Jul 02 '13 at 12:10
  • your APK might have only the RES folder, it misses the dex file. Build it again – cgalvao1993 Jul 02 '13 at 12:12
  • i tried building it and its still the same, but why is it building in a different path compared to old path – srp Jul 02 '13 at 12:15
  • Ok, but **HOW EXACTLY**. Post the commands. – m0skit0 Jul 02 '13 at 12:15
  • source build/envsetup.sh mmm /root/android/system/packages/apps/Contacts/ adb remount adb push Contacts.apk /system/app/Contacts.apk adb reboot – srp Jul 02 '13 at 12:19
  • @CássioGalvão you were right, classes.dex is missing in the apk, i tried building it as mentioned in the answer, it still misses the dex file. Could you please suggest how can i get the dex file into my apk. – srp Jul 02 '13 at 12:50
  • An built-in application packaged with the intent to be deployed as part of a system build is probably not correctly packaged to be deployed by itself onto a running system. – Chris Stratton Jul 02 '13 at 13:48

1 Answers1

2

You forgot to lunch before building. That's why it's building in out/target/product/generic instead of out/target/product/vision. It looks like your generic build is set up to build odexed apks, which is why there is no classes.dex inside the apk.

. build/envsetup.sh
lunch vision-userdebug # or -eng or -user
mmm packages/apps/Contacts
JesusFreke
  • 19,784
  • 5
  • 65
  • 68