I'm building Android from source. I'm using all applications already in generic.mk and product.mk within the build folder. I'm also adding some prebuilt APKs following the Prebuilt cookbook on the Open Source website.
One example is Facebook. I extracted the Facebook.apk from the Marketplace. If I install this app through 'adb install' it works ok. But when I build with this apk added into the build, it doesn't work. I've done the samething for Twitter and it worked fine.
This is a piece of the logcat:
W/PackageManager( 89): Exception reading apk: /system/app/AndroidFacebook.apk
W/PackageManager( 89): java.io.IOException: /system/app/AndroidFacebook.apk
W/PackageManager( 89): at dalvik.system.DexFile.isDexOptNeeded(Native Method)
W/PackageManager( 89): at com.android.server.PackageManagerService.performDexOptLI(PackageManagerService.java:2153)
W/PackageManager( 89): at com.android.server.PackageManagerService.performDexOpt(PackageManagerService.java:2139)
W/PackageManager( 89): at com.android.server.am.ActivityManagerService.ensurePackageDexOpt(ActivityManagerService.java:1750)
W/PackageManager( 89): at com.android.server.am.ActivityManagerService.generateApplicationProvidersLocked(ActivityManagerService.java:7818)
W/PackageManager( 89): at com.android.server.am.ActivityManagerService.attachApplicationLocked(ActivityManagerService.java:5513)
W/PackageManager( 89): at com.android.server.am.ActivityManagerService.attachApplication(ActivityManagerService.java:5673)
W/PackageManager( 89): at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:311)
W/PackageManager( 89): at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:1552)
W/PackageManager( 89): at android.os.Binder.execTransact(Binder.java:287)
W/PackageManager( 89): at dalvik.system.NativeStart.run(Native Method)
Any idea why the app doesn't work when I add a prebuilt APK into the build but it works ok when I install via adb?
Thanks in advance,
Tiago
> --
> You received this message because you are subscribed to the Google Groups "android-platform" group.
> To post to this group, send email to android-...@googlegroups.com.
> To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
>
>
--
--Pavan Savoy
I solved the problem. When I install an APK via adb, the process extracts the libraries from the APK and copy it to some folder which is visible by the application itself.
The problem was when I add an APK through the prebuilt process, the .so library needed by the app was not being extracted (actually there is no "installation process", it is just copying files across) .
What I've done was finding through the logcat what .so was extracted for the particular APK during adb installation. Then I pull the file out from the handset and add into the Android.mk like:
include $(CLEAR_VARS)
LOCAL_MODULE := lib.so
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)
LOCAL_SRC_FILES := libs/$(LOCAL_MODULE)
OVERRIDE_BUILT_MODULE_PATH := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)
include $(BUILD_PREBUILT)
That library is now going into a shared place and the application starts correctly. I had to do that for 3 or 4 APK I've been built as preloaded app.
I wouldn't change any file within the build directory as it can be overwritten in a future release and you are going to have lots of headaches in a future. Keep your changes within vendor directory as per Google's documentation on the PDK website.
Regards,
Tiago
When I installed those apks via adb I found their libraries in /data/data/<packagename>/lib folder.
This looks a place where the apk shares libraries to itself. That would be OK if the library goes to that place during a prebuilt, which is not the case. The library just doesn't come out of the apk.
So, adding the extracted library into the shared libraries folder worked (and, yes, I think that is a bit dirty way to do this... :-) ).
I'm new to the Android build system, so that was the way it was solved for the moment. But, it would be good to know what would be the best practice in this case. It is difficult to find more information about the Android Build System apart from what the PDK site has.
Best regards,
Tiago
>>>> To unsubscribe from this group, send email to android-...@googlegroups.com.
>>>> For more options, visit this group athttp://groups.google.com/group/android-platform?hl=en.
>>
>>> --
>>> --Pavan Savoy- Zitierten Text ausblenden -
>>
>> - Zitierten Text anzeigen -
>
> --
> You received this message because you are subscribed to the Google Groups "android-platform" group.
> To post to this group, send email to android-...@googlegroups.com.
> To unsubscribe from this group, send email to android-...@googlegroups.com.