App crashes on launch after renaming module in Android Studio - android

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.

Related

Application crashes in dynamic module

So i'm trying to implement dynamic module. I just have one fragment in the dynamic module i.e upon clicking on that fragment, it downloads the module and installs and then it is showed to the user. So far the application is downloading and installing the module. But it crashes upon loading the module. It throws following error
29-05-2022 20:05:02 : android.content.res.Resources$NotFoundException: Resource ID #0x7d020000
--------- Stack trace ---------
android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:237)
android.content.res.Resources.loadXmlResourceParser(Resources.java:2400)
android.content.res.Resources.getLayout(Resources.java:1252)
android.view.LayoutInflater.inflate(LayoutInflater.java:530)
com.healtharx.ondemand.OnDemandFragment.onCreateView(OnDemandFragment.kt:16)
androidx.fragment.app.Fragment.performCreateView(Fragment.java:2963)
androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:518)
androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282)
androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
If i run the application from android studio where it obviously downloads and installs all modules, the application runs fine. But when i upload the application to playstore for internal testing, it downloads and installs the module and throws the above error. What am i missing? Also if anyone can share good online resource which can help me implement dynamic module easily it would really be appreciated. Thanks

Android InstantApp and sharedUserId

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 ?

Android : crash because java class not found

My goal is to be able to make my Android TV Mi Box S (Oreo 8.1) transcode properly Dolby Digital+ (EAC3) sounds to Dolby Digital (AC3) and output it to, my AVR through SPDIF.
This transcodindg is possible with Kodi 18.1 applicition but is not proposed by other application or Android 8.1 settings. As Kodi is able to do it I reverse engineered Android stack. My conclusion are : - Android Oreo embeds any necessary codecs ans other stuff to do this transcoding but does not propose the settings to configure this - Android Pie proposes the wanted surround sound setting (output Dolby Digital on SPDIF)
So my goal is to backport Android TvSettings application from Pie to Oreo
I first tryed to generate TvSettings with Android Studio. I hacked the application resources but stopped when I understood that I would have to generate platfom dependacies (for instance SettingsLib.jar)
My second trial is to generate the entire Android platform. The build is complete and I can deploy TvSettings application on a x86 TV simulation BUT when I launched the TvSettings appplication I get this error :
--------- beginning of crash
2019-04-01 12:21:04.976 3987-3987/com.android.tv.settings
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.android.tv.settings, PID: 3987
java.lang.RuntimeException: Unable to get provider android.support.v4.content.FileProvider:
java.lang.ClassNotFoundException: Didn't find class
"android.support.v4.content.FileProvider" on path: DexPathList[[zip
file
"/data/app/com.android.tv.settings-2DkaCncwGQ874WP-kx3G4Q==/base.apk"],nativeLibraryDirectories=[/data/app/com.android.tv.settings-2DkaCncwGQ874WP-kx3G4Q==/lib/x86,
/system/lib, /vendor/lib]]
I searched this error on internet and it seems that it deals with multidex feature. This multidex feature is well documented for clean developped Android appliacation but nor reaally for applications extracted from Android platform and deployed with adb.
This problem is related to java libraries loading.
I found threads referring Android multidex feature but only for applications buils with Android Studio/Gradle and my app was build with Android platform
What can I do?
have you included fileProvider in your manifest?
Well there seems to be a root error during deployment of my TvSettings application. Here is its log :
E/dex2oat: Invalid version number in dex file header. File: base.apk
I read several pages and found this one very interesting : https://source.android.com/devices/tech/dalvik/configure
So, due to different optimizations, platform apps are not generated with the same file format that apps generated above platform API
My idea is to generate the whole platform including TvSettings app and to deploy TvSettings with adb. So the apk format may be wrong.
My next step is to add in TvSettings/Settings/Android.mk the flag below :
LOCAL_DEX_PREOPT := false

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

Modules do not start in Google App Engine Python on Development Server

Problem:
I am trying to create a simple app to try Modules in Google App Engine Python on Development Server(Development SDK 1.9.2). But I do not see the modules getting started at runtime(log messages specifying the ports on which they are started).
Logs when I start the app using the Launcher on the development server:
2014-04-13 02:40:47 Running command: "['C:\\Python27\\pythonw.exe', 'C:\\Program Files (x86)\\Google\\google_appengine\\dev_appserver.py', '--skip_sdk_update_check=yes', '--port=11080', '--admin_port=8003', u'C:\\gaurav\\coding\\python\\androidbackend1']"
INFO 2014-04-13 02:40:50,572 devappserver2.py:764] Skipping SDK update check.
INFO 2014-04-13 02:40:50,627 api_server.py:171] Starting API server at: http://localhost:59432
INFO 2014-04-13 02:40:50,631 dispatcher.py:182] Starting module "default" running at: http://localhost:11080
INFO 2014-04-13 02:40:50,634 admin_server.py:117] Starting admin server at: http://localhost:8003
INFO 2014-04-13 02:40:56,062 module.py:627] default: "GET / HTTP/1.1" 200 12
This Modules doc page at GAE for Python does not mention anything about development server. From another link, I figured out that on development server, all the modules are started at the beginning of app execution and they only differ in the port number of their URLs
Context:
I created a new app using the Google Launcher which generates a default "main.py" and "app.yaml". I then copied the "main.py" into a file named "modulem1.py", while retaining "main.py". I copied "app.yaml" into a file named "modulem1.yaml", while retaining the "app.yaml" file. I added the following line to "modulem1.yaml":
module: modulem1
I want to use Google Endpoints API to interact between the web app and Android app. So I need to use module for that and therefore I am trying a small web app with modules
I should be missing something obvious. Appreciate any help
If you are using the Google App Engine Launcher, then you will need to provide the full path to your second yaml file modulem1.yaml
Then once you start it, you can view the Logs and see that the modulem1 module has been launched at http://localhost:8080 and the default module has been launched at http://localhost:8081

Categories

Resources