Re: Adding prebuilt APK fails

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Adding prebuilt APK fails

毛Türkçe
What about 64 bit build?  Do I have to put both x86 & x86_64 binaries to the image, if so how to write the makefile?

在 2010年6月21日星期一 UTC+8下午11:35:23,Tiago Vieira写道:
Hi all

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

On 8 Jun 2010, at 14:16, FrankG wrote:

> Hello Nga,


>
> I don't know. I simply saw that the other vendor extensions APKs from
> app/mydroid/vendor also put into <a href="http://generic.mk" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgeneric.mk\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGlzqnX-QnIzpjZJfijIKPFwlvamQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgeneric.mk\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGlzqnX-QnIzpjZJfijIKPFwlvamQ&#39;;return true;">generic.mk.
>
> Good luck !
>
> Frank
>
>
> On 8 Jun., 14:08, nguyenvuthiennga <[hidden email]> wrote:
>> Hi Frank,
>>
>> Actually, I added the entry in vendor/aosp/products/<a href="http://aosp_core.mk" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Faosp_core.mk\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFdwxsUDQHa954t-Hzg58xz3a0f4w&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Faosp_core.mk\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFdwxsUDQHa954t-Hzg58xz3a0f4w&#39;;return true;">aosp_core.mk
>>
>> I did the same with my applications and it works.
>>
>> Is there difference between mk files in build/target/product and
>> vendor/aosp/products?
>>
>> Nga
>>
>> On Jun 8, 11:21 am, Pavan Savoy <[hidden email]> wrote:
>>
>>
>>
>>> Wonder why the "mm" command installs the .apk but not the top level
>>> make -j2 command.
>>> Is there a vendor specific file - where I can mention the same ? i.e
>>> list of apps to be installed like the build/target/product/<a href="http://core.mk" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fcore.mk\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEFGvbatyFSgs7mdws9Bm8C0QSqRg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fcore.mk\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEFGvbatyFSgs7mdws9Bm8C0QSqRg&#39;;return true;">core.mk ?
>>
>>> On Tue, Jun 8, 2010 at 1:29 PM, FrankG <[hidden email]> wrote:
>>>> I assume that in your case it is the missing entry
>>>> in app/mydroid/build/target/product/<a href="http://generic.mk" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgeneric.mk\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGlzqnX-QnIzpjZJfijIKPFwlvamQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgeneric.mk\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGlzqnX-QnIzpjZJfijIKPFwlvamQ&#39;;return true;">generic.mk
>>
>>>> Good luck !
>>
>>>>  Frank
>>
>>>> On 8 Jun., 09:47, nguyenvuthiennga <[hidden email]> wrote:
>>>>> Hi,
>>
>>>>> I also tried to add pre-built apk. I follows the instructions from
>>>>> this link
>>
>>>>> <a href="http://source.android.com/porting/build_cookbook.html" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://source.android.com/porting/build_cookbook.html&#39;;return true;" onclick="this.href=&#39;http://source.android.com/porting/build_cookbook.html&#39;;return true;">http://source.android.com/porting/build_cookbook.html
>>
>>>>> Compiling gives no error but I don't see my package in installed-
>>>>> files.txt as well as in the launcher.
>>
>>>>> Does anyone have a hint?
>>
>>>>> Thanks in advance,
>>
>>>>> Nga
>>
>>>>> On Jun 7, 9:59 am, FrankG <[hidden email]> wrote:
>>
>>>>>> Hi Tiago,
>>
>>>>>> I don't know the Prebuilt cookbook ( can you give me a pointer ?),
>>>>>> so I have no idea how you Build-File looks like.
>>
>>>>>> Nevertheless I have good success with kind of Android.mk File :
>>
>>>>>> LOCAL_MODULE := <YourAppName>
>>>>>> LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
>>>>>> LOCAL_MODULE_CLASS := APPS
>>>>>> LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
>>
>>>>>> include $(BUILD_PREBUILT)
>>
>>>>>> The special thing is IMHO the "include $(BUILD_PREBUILT)".
>>
>>>>>> Good luck !
>>
>>>>>>   Frank
>>
>>>>>> On 4 Jun., 21:19, Tiago Vieira <[hidden email]> wrote:
>>
>>>>>>> Hi everyone, it's my first email to this group.
>>
>>>>>>> I'm building Android from source. I'm using all applications already in <a href="http://generic.mk" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgeneric.mk\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGlzqnX-QnIzpjZJfijIKPFwlvamQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgeneric.mk\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGlzqnX-QnIzpjZJfijIKPFwlvamQ&#39;;return true;">generic.mk and <a href="http://product.mk" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fproduct.mk\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFmF-JNFSc7OpAlMcDs3fP_lO7q5Q&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fproduct.mk\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFmF-JNFSc7OpAlMcDs3fP_lO7q5Q&#39;;return true;">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(PackageManagerServ ice.java:2153)
>>>>>>> W/PackageManager(   89):        at com.android.server.PackageManagerService.performDexOpt(PackageManagerServic e.java:2139)
>>>>>>> W/PackageManager(   89):        at com.android.server.am.ActivityManagerService.ensurePackageDexOpt(ActivityMa nagerService.java:1750)
>>>>>>> W/PackageManager(   89):        at com.android.server.am.ActivityManagerService.generateApplicationProvidersLo cked(ActivityManagerService.java:7818)
>>>>>>> W/PackageManager(   89):        at com.android.server.am.ActivityManagerService.attachApplicationLocked(Activi tyManagerService.java:5513)
>>>>>>> W/PackageManager(   89):        at com.android.server.am.ActivityManagerService.attachApplication(ActivityMana gerService.java:5673)
>>>>>>> W/PackageManager(   89):        at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:311 )
>>>>>>> W/PackageManager(   89):        at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerServ ice.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- 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="qvjlVEPwt2QJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">android-...@googlegroups.com.
>>>> To unsubscribe from this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="qvjlVEPwt2QJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">android-...@googlegroups.com.
>>>> For more options, visit this group athttp://<a href="http://groups.google.com/group/android-platform?hl=en" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://groups.google.com/group/android-platform?hl\x3den&#39;;return true;" onclick="this.href=&#39;http://groups.google.com/group/android-platform?hl\x3den&#39;;return true;">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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="qvjlVEPwt2QJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">android-...@googlegroups.com.
> To unsubscribe from this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="qvjlVEPwt2QJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">android-...@googlegroups.com.
> For more options, visit this group at <a href="http://groups.google.com/group/android-platform?hl=en" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://groups.google.com/group/android-platform?hl\x3den&#39;;return true;" onclick="this.href=&#39;http://groups.google.com/group/android-platform?hl\x3den&#39;;return true;">http://groups.google.com/group/android-platform?hl=en.
>

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-platform/1a0d74b6-75e9-4350-83cd-6a327aac6e00o%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Adding prebuilt APK fails

semw-2
Hi @Tiago Vieira
You said you added app successfully with required libraries. I have extracted required libraries and trying to add to OS but its not working. Can you tell me that did you made seprate android.mk file for required libraries of apk and where did you placed those libraries, apk and make files before starting build ?
I want to know these things:
Android.mk file code for apk and its placement ?
Apk placement/location
If separate Android.mk is used for libraries then its location and code ?
Location/placement of libraries before compiling ROM.
On Thursday, July 16, 2020 at 8:05:52 PM UTC+5 [hidden email] wrote:
What about 64 bit build?  Do I have to put both x86 & x86_64 binaries to the image, if so how to write the makefile?

在 2010年6月21日星期一 UTC+8下午11:35:23,Tiago Vieira写道:
Hi all

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

On 8 Jun 2010, at 14:16, FrankG wrote:

> Hello Nga,


>
> I don't know. I simply saw that the other vendor extensions APKs from
> app/mydroid/vendor also put into generic.mk.
>
> Good luck !
>
> Frank
>
>
> On 8 Jun., 14:08, nguyenvuthiennga <[hidden email]> wrote:
>> Hi Frank,
>>
>> Actually, I added the entry in vendor/aosp/products/aosp_core.mk
>>
>> I did the same with my applications and it works.
>>
>> Is there difference between mk files in build/target/product and
>> vendor/aosp/products?
>>
>> Nga
>>
>> On Jun 8, 11:21 am, Pavan Savoy <[hidden email]> wrote:
>>
>>
>>
>>> Wonder why the "mm" command installs the .apk but not the top level
>>> make -j2 command.
>>> Is there a vendor specific file - where I can mention the same ? i.e
>>> list of apps to be installed like the build/target/product/core.mk ?
>>
>>> On Tue, Jun 8, 2010 at 1:29 PM, FrankG <[hidden email]> wrote:
>>>> I assume that in your case it is the missing entry
>>>> in app/mydroid/build/target/product/generic.mk
>>
>>>> Good luck !
>>
>>>>  Frank
>>
>>>> On 8 Jun., 09:47, nguyenvuthiennga <[hidden email]> wrote:
>>>>> Hi,
>>
>>>>> I also tried to add pre-built apk. I follows the instructions from
>>>>> this link
>>
>>>>> http://source.android.com/porting/build_cookbook.html
>>
>>>>> Compiling gives no error but I don't see my package in installed-
>>>>> files.txt as well as in the launcher.
>>
>>>>> Does anyone have a hint?
>>
>>>>> Thanks in advance,
>>
>>>>> Nga
>>
>>>>> On Jun 7, 9:59 am, FrankG <[hidden email]> wrote:
>>
>>>>>> Hi Tiago,
>>
>>>>>> I don't know the Prebuilt cookbook ( can you give me a pointer ?),
>>>>>> so I have no idea how you Build-File looks like.
>>
>>>>>> Nevertheless I have good success with kind of Android.mk File :
>>
>>>>>> LOCAL_MODULE := <YourAppName>
>>>>>> LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
>>>>>> LOCAL_MODULE_CLASS := APPS
>>>>>> LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
>>
>>>>>> include $(BUILD_PREBUILT)
>>
>>>>>> The special thing is IMHO the "include $(BUILD_PREBUILT)".
>>
>>>>>> Good luck !
>>
>>>>>>   Frank
>>
>>>>>> On 4 Jun., 21:19, Tiago Vieira <[hidden email]> wrote:
>>
>>>>>>> Hi everyone, it's my first email to this group.
>>
>>>>>>> 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(PackageManagerServ ice.java:2153)
>>>>>>> W/PackageManager(   89):        at com.android.server.PackageManagerService.performDexOpt(PackageManagerServic e.java:2139)
>>>>>>> W/PackageManager(   89):        at com.android.server.am.ActivityManagerService.ensurePackageDexOpt(ActivityMa nagerService.java:1750)
>>>>>>> W/PackageManager(   89):        at com.android.server.am.ActivityManagerService.generateApplicationProvidersLo cked(ActivityManagerService.java:7818)
>>>>>>> W/PackageManager(   89):        at com.android.server.am.ActivityManagerService.attachApplicationLocked(Activi tyManagerService.java:5513)
>>>>>>> W/PackageManager(   89):        at com.android.server.am.ActivityManagerService.attachApplication(ActivityMana gerService.java:5673)
>>>>>>> W/PackageManager(   89):        at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:311 )
>>>>>>> W/PackageManager(   89):        at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerServ ice.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- 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 [hidden email].

>>>> To unsubscribe from this group, send email to [hidden email].


>>>> 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 [hidden email].

> To unsubscribe from this group, send email to [hidden email].


> For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
>

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-platform/92040da8-3722-4aa7-a1ed-eb09bbd6ec33n%40googlegroups.com.