Android InstantApp and sharedUserId - android

I would like to create an instant app for one application currently on the play store.
For that, I made dynamic feature modules with all necessary things for instant experience.
The major problem is that the field android:sharedUserId is defined on main module.
When testing my work, we get the following error on logcat :
android.content.pm.PackageParser$PackageParserException: /data/app/vmdl143761699.tmp/base.apk (at Binary XML file line #2): sharedUserId not allowed in ephemeral application
This means that an instant app cannot work with sharedUserId field...
When I remove this field, my instant app works very well, but I cannot install main application or update previous installation version, I obtain this error :
E/Finsky: [2] zdp.onReceive(15): Error -505 while installing xx.xx.xxx.xxx: INSTALL_FAILED_SHARED_USER_INCOMPATIBLE: Package xx.xxx.xxxx.xxx tried to change user null
Ok, Google specify that is not possible to delete this field without application reinstal... (https://developer.android.com/guide/topics/manifest/manifest-element#uid)
So I could not have an instant app as long as I have sharedUserId field and I cannot delete it...
Is there any solution for my problem ?

Related

App crashes on launch after renaming module in Android Studio

Here's what my modules look like
I changed my module name in Android Studio from app to wear, after I decided to add another module called mobile. I didn't see any issues until my app update got rejected from Play Store.
The Logcat is filled with this error :
E checkOperation
java.lang.SecurityException: Specified package com.wrejistry.voicerecorder under uid 10332 but it is really 10335
at com.android.server.appop.AppOpsService.verifyAndGetBypass(AppOpsService.java:3944)
at com.android.server.appop.AppOpsService.checkOperationUnchecked(AppOpsService.java:2928)
at com.android.server.appop.AppOpsService.checkOperationImpl(AppOpsService.java:2911)
at com.android.server.appop.AppOpsService.checkOperationInternal(AppOpsService.java:2898)
at com.android.server.appop.AppOpsService.checkOperation(AppOpsService.java:2889)
at com.android.internal.app.IAppOpsService$Stub.onTransact(IAppOpsService.java:425)
at android.os.Binder.execTransactInternal(Binder.java:1159)
at android.os.Binder.execTransact(Binder.java:1123)
Is it safe to add a new module for a phone app to my existing project? Did the error occur because I added a new module or is it because I renamed the "app" module to "wear". How do I prevent this issue and make sure the device recognizes my app signature the same as before I changed the module name.

Google AdMob TBannerAd LoadAd exception after upgrading to Delphi v10.2.3

My application was originally written using Delphi v10.2.2 and TBannerAd worked just fine.
Without any code changes and after upgrading Delphi to v10.2.3 (by installing over the existing v10.2.2 using the ISO without changing anything in the installation dialogs), calling TBannerAd's "LoadAd" method started triggering this exception:
Project myproject.apk raised exception class EJNIException with message
'java.lang.IllegalStateException: The meta-data tag in your app's
AndroidManifest.xml does not have the right value. Expected 4323000
but found 7095000. You must have the following declaration within the
< application > element: < meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" / >'.
I reviewed the AndroidManifest.xml file and indeed the "7095000" value is used, but I don't know why/how delphi uses this value. Rebuilding the project generates a new AndroidManifest.xml file with the "7095000" value, so I can't directly edit the XML file as a work-around.
What causes this? Is it some setting or SDK path that changed due to the upgrade? (I tried searching but couldn't find anything relevant)
Things I tried:
Completely uninstalling the application and running it again from Delphi (on a real device, a Galaxy note 4).
Under options, changing the NDK API location and C++ Builder NSK Library paths from "\platforms\android-14" to "\platforms\android-19".
Tokyo 10.2.3 has updated Google Play Services and its libraries.
Applications created with old version don't automatically update the libraries to new ones shipped with 10.2.3 release.
To update the libraries go to Project Manager -> Android -> Android SDK xxx -> Libraries and select "Revert System Files to Default" from the popup menu.
After reverting list of included libraries should be

WeChat API failing registration in app

I'm developing an application for the Chinese market which will allow our users to login using WeChat. We have applied for a mobile application on https://open.weixin.qq.com and it passed.
I used the example project of WeChat to see how it works, and got it working fine (WeChatSDK_sample_Android).
Then I tried using our received AppID and have failed since then. When we try to call the register action we see following error pop up in the logcat:
Server response error code:404, error:{"ret":-1, "msg":"invalid appkey"}
The Package Name in the manifest and the applicationId in our build.gradle file are exactly the same as the package name we put in the wechat form. We first picked the SHA256 signature, but since then also tried the SHA1 and MD5 signature to see if it works (both with and without ':', all in UPPERCASE).
I also tried the chinese application that was referenced multiple times that can be found here https://github.com/mike623/cordova-WeChat-meteor-sharing/blob/master/README.md
I'm completely out of thoughts what I can change now to see if it works.
Here is where I got the appId from (where the blue is now):
Do you have any idea what I can try, or what I did wrong?
Kr,
Thomas
I also encountered this problem before. It is caused by incorrect Wechat app signature. Because the signatures of debug and release version are different, so that's why Wechat return
Server response error code:404, error:{"ret":-1, "msg":"invalid appkey"}.
How to solve this problem?
Download generate signature tool which is provided by Wechat:
https://res.wx.qq.com/open/zh_CN/htmledition/res/dev/download/sdk/Gen_Signature_Android2.apk
Open the tool in your Android device or simulator, then enter the package name of your app into the tool and get signature:
At last, check the signature in step 2 with the signature you submitted in the Wechat Open API Platform. If they are different, pls change the signature or build a correct version APK.

Error when uploading apk to playstore, apk name not valid

I developed my very first android app but when i'm uploading to the Play Store I get the following error:
error
For those not speaking dutch," upload failed, the name of your apk has to be the following format 'com.example.myapp'. I'm guessing I didn't do this but I have no idea how to fix this. I'm using Android Studio 0.6.1
I did search the web but couldn't find a fix.
It is the name of the package of your app i.e bundle identifier. Also example cannot be used in it. For more info: Android - Package Name convention
change the package name
(com.example) is invalid.
use (com.xyz).
xyz means any thing u like but not example

changing the laucher2 package name android

I am trying to implement my own launcher (making some modifications to the launcher provided by google ). But since i cant remove the default launcher i renamed my package name and everything . Initially the package name was com.android.launcher2 . I changed every instance it to com.rohit.grid . Now if I run it i am getting this error 'Re-installation failed due to different application signatures' .Now the manifest file has some something called com.android.launcher in the permission tags & in the packge name . If i replace it with com.rohit.grid I will get errors in xml files about some resource being not resolved.
I tried cleanoing the project, fixing its properties & everything . But it dint help .
Somebody plz get me out of this problem .
Thanks in advance.
Regards,
Rohit
I think 'Re-installation failed due to different application signatures' means that the installer is trying to install an APK with the same name that an installed one, but the problem in this case is that the installed is signed with a different key than yours.
Instead of modifying your manifest try to rename the project and then reinstall.

Categories

Resources