-1

i'm now in trouble with add a prebuilt apk into system.img based the TaiWan mtk android phone platform, when i push this apk onto the device,after reboot phone,the apk can be installed succecessfully,but if I add this apk into alps/out/target/product/$prj/system/app or vendor/mediatek/$prj/artifacts/out/target/product/$prj/system/app,and produce a system.img,the apk can't be installed normally,the logcat say:

a.lang.RuntimeException: Unable to instantiate activity
ComponentInfo{com.sec.android.widgetapp.ap.hero.accuweather.widget/com.sec.android.widgetapp.ap.hero.accuweather.widget.WeatherClock}: 
java.lang.ClassNotFoundException: com.sec.android.widgetapp.ap.hero.accuweather.widget.WeatherClock.

can anybody tell me what's the problem is ?

dudebrobro
  • 1,287
  • 10
  • 17
fla888
  • 67
  • 1
  • 8
  • When I am trying to build my application as a part of image I am getting the following error : E/dalvikvm( 1334): Can't open dex cache '/data/dalvik-cache/ system@a...@test.apk@classes.dex': No such file or directory I/dalvikvm( 1334): Unable to open or create cache for /system/app/ test.apk (/data/dalvik-cache/system@a...@test.apk@classes.dex) E/Util( 1334): Class Not Found : java.lang.ClassNotFoundException: But when I push the apk manually to the device (into system/app), it works fine. I am wondering why is it so as both ways the apk is present at system/ app only. – fla888 Aug 07 '13 at 16:29

1 Answers1

1

When the package manager installs apps that are part of the system partition is different from installing apps on the data partition. It looks like you app is using libraries from somewhere else. Normally when you install on data a lib directory is created in the apps data directory and symlinked to /data/app-lib/. When apps are installed on system it's expected that any libraries they depend on are already part of the system.img in system/lib or vendor/lib. The libraries aren't copied in an effort to creating multiple copies of libraries that are already included in a shared location on the device. You may want to make a copy the apk and unzip it and look for any libraries that it includes and make sure that those are being placed in system/lib or system/framework. You could also find the libraries and create the symlink your self on the device you flashed to see if that resolves your problem.

Hope that helps some.

dudebrobro
  • 1,287
  • 10
  • 17
  • i want to know why i can't build the apk as part of the system.img or userdata.img,while push it manually will be installed normally,i can make sure that there are not any native libraries included in the apk, this apk have been put into both /data/app and /system/app,but no luck.at last ,i found if build usr build flavor,this apk can be built as part of system.img,why eng build have so stange problem ? – fla888 Aug 08 '13 at 01:08