A developer reported that an app downloaded from AppGallery could not be installed.
After checking the message to find out more details about the error, I discovered that the error message was actually "Conflicting provider (Error code: -13)", indicating that ContentProvider of the downloaded app conflicted with that of an existing app. The system also provided a description of the error and recommended a solution.
Generally, if a provider conflict occurs when you install an app, it is probably because an existing app has the same ContentProvider. ContentProvider is one of the four Android elements, although it very rarely used. The ContentProvider feature interacts and shares data between processes, which determines that it must be globally unique. Once an app has registered a ContentProvider on the phone, the app installed later cannot use the same ContentProvider. Otherwise, installation will fail.
As expected, installation failed when we found the same ContentProvider settings in the AndroidManifest.xml file after checking the two conflicting apps.
In this case, you can modify the ContentProvider information and install the app again to resolve the problem.
Related
The following link gives a brief description about package installation process in android.
java,dzone,com/articles/depth-android-package-manager
I'm curious to know how the UID of an app is determined during its installation based on set the permissions present in its manifest file.
Also there is the platform.xml (in /frameworks/base/data/etc directory for 4.0 ICS Source code)file which contains list of permissions with gid associated with them. The description says
The following tags are associating low-level group IDs with permission names. By specifying such a mapping, you are saying that any application process granted the given permission will also be running with the given group ID attached to its process, so it can perform any filesystem (read, write, execute) operations allowed for that group.
In a similar way there is a list of high level permissions assigned to specific uid's as well.
My question is when an app is installed with permissions X,Y, Z how does its access specified is it from the mapping from this platform.xml
Also everytime the app is run does the mapping take place at every instant (that doesn't seem right from the initial design of android where the app permissions cannot be changed unless there is an update). So if that is the case where does it store saying this app should run with such and such access or such and such uid.
I hope I made my question clear, let me know if you need more information. I'm just trying to learn more on how the internals of the Android OS work.
Thanks
BackgroundI had recently planned on integrating the Crash SDK to my app. However, my app was developed through Eclipse and the integration process was different from that in Android Studio.
By referring to the official materials, I downloaded the tool package and used it to generate an Eclipse project package.
However, when the build.bat file in the aar2eclipse/aar directory was executed according to the procedures in the document, an error was reported in the command line. The error information was as follows:
FAILURE: Build failed with an exception.
* What went wrong:
Task ' assembleRelease ' not found in root project ' aar '.
Problem Reoccurring1. I first thought that the problem might be caused by my company's intranet. But when I connected to the Internet, the problem remained unsolved.
2. Then I guessed that it might have something to do with the Android development environment.
I borrowed a colleague's PC to execute the build.bat file, and it that did the trick. Therefore, I was able to conclude that the problem was caused by incorrect configurations in the Android development environment. I compared the configurations on the two PCs and found that the environment variables were different. ANDROID_HOME was missing from the environment variables on my PC.
CauseHuawei's Eclipse tool package is unable to run properly and reports an error without the ANDROID_HOME variable.
Solution: Right-click This PC and choose Properties from the shortcut menu. In the displayed dialog box, click the Advanced System Settings tab and then click Environment Variables. In the System Variables dialog box, create a new ANDROID_HOME parameter.
Set the value to the installation path of the local Android SDK, and the problem will be resolved, as shown below.
Reference:
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-get-started#h2-1587519820720
Symptom
I made a request to verify the purchase token by referring to the official materials, but error message "{responseCode 8 , responseMessage ERROR_INVALID_PAYMENTTOKEN}" was returned. The URL of the request API was {rootUrl}/applications/purchases/tokens/verify.
Analysis & SolutionThe official materials provide the following solutions:
1. Error code 8 indicates that a user failed to consume or confirm a product because the user does not own the product. Consume or confirm the product only after it is successfully purchased; otherwise, this error may occur. If the consumption or confirmation is indeed performed for a purchased product but this error still occurs, please ensure that the parameters passed by the corresponding APIs are correct.
Result codes
2. Check whether the {rootUrl}/applications/purchases/tokens/verify URL in the API is correct. The value of rootUrl varies depending on the site. Theoretically, if a URL is of a non-AppTouch site, all sites can be selected and Huawei server performs inter-site routing. However, when a non-AppTouch token requests an AppTouch site URL, this result code will be reported.
Reference
You may have encountered app installation failures during app development. Lets take a look at some of the most often reported errors on Huawei devices, what they mean and how you as a developer can fix them!
The app package is invalid, incomplete, or incompatible with the operating system (result code: -2).
Cause analysis: An invalid package is uploaded for a third-party app.
Solution: Upload a valid app package.
Insufficient storage space (result code: -4).
Cause analysis: The storage space is insufficient for installing an app.
Solution: Open Optimizer and tap Cleanup to free up some storage space on your phone.
An app with the same package name has already been installed on the device (result code: -5).
Cause analysis: The app cannot be installed as the package name already exists.
Solution: Change the package name to a new one.
Incompatible update (result code: -7).
Cause analysis: The package name of the later version is the same as that of the earlier version currently installed, but their signatures are different.
Solution: Change the signature of the later version to that of the earlier one.
Incompatible app that supports ShareUid (result code: -8).
Cause analysis: The installation failed because the signature of the to-be-installed app that supports ShareUid is different from that of the installed app that supports ShareUid.
Solution: Ensure that the signature is the same as that of the installed app that supports ShareUid.
The shared library is lost (result code: -9).
Cause analysis: The Google Maps library that the app depends on does not exist. As a result, the app installation failed.
Solution: It is recommended that you integrate HMS Core into your app to avoid such dependency issues.
An element name of the to-be-installed app is the same as that of an installed app (result code: -13).
Cause analysis: The ContentProvider defined in the app is the same as that of an installed app.
Perform the following steps to find the conflict:
View logs and check the installation failure callback information.
Run the adb command to obtain all ContentProvider definitions on the device, and find the app that caused the conflict. adb shell dumpsys package providers >d:/temp/provider.txt Solution:Uninstall the conflicting app or resolve the conflict.
The app is incompatible with the CPU of the device (result code: -113 or -16).
Cause analysis: Adaptations for specific CPU versions were not performed when the app was packaged.
Solution: Adapt the app for the CPU version of the device in question.
App verification timed out (result code: -21), and app verification failed (result code: -22).
Cause analysis: When the app was being automatically verified by Google Play, the network connection timed out. Usually, the preceding process is not triggered unless Google Play has been updated by the user or by a downloaded app, which leads to verification timeout.
Solution: On the device, go to Settings > Apps > Google Play Services and tap DISABLE on the App info page, or go to Settings > Apps > Google Play Services Updater and tap Uninstall updates in the upper right corner. Then click FORCE STOP (if available) to deactivate the app if it is still displayed in the app list.
On the device, ensure that Google Play Protect is disabled.
The app package failed to be installed because a later version has been installed (result code: -25).
Cause analysis: Android devices allow for the creation of multiple user accounts. A non-owner account may have downloaded and installed a later version of the app in PrivateSpace for testing purposes. If so, the installation will fail.
Solution: Check whether a later version of the app is installed in PrivateSpace by a non-owner account. If so, uninstall the app and install it again.
Parsing failed (result code: -102).
Cause analysis: An error occurred when generating the package, causing parsing to fail.
Solution: Contact the technical support of the corresponding channel to check logs to locate the download path, download the APK again using a browser, and then install the APK in ADB mode to check whether the error occurs again.
The app package does not contain any certificates (result code: -103).
Cause analysis: The app package is for Early Access targeting specific users and does not contain any certificates.
Solution: Add a certificate to the app package.
Unknown error (result code: -111).
Cause analysis: The device is a TD Tech dual-system policing terminal and is customized to limit app installation.
Solution: Instruct users to contact TD Tech for assistance.
Hello, I'm looking for a way to use Google Automotive Services in my custom ROM.
My aim is to develop an application using privilage/system permissions (android.car.permission.CAR_INFO, android.permission.SYSTEM_ALERT_WINDOW, etc.) and Google API, but I can't see a way to install it on the official emulator.
For a start - I've downloaded 12.1 sources, built an SDK image and created an emulator. Then I've downloaded AAOS 12.1 emulator image with a Play Store.
Side note: I'd like to do the same with AAOS 13, but there is no official AAOS 13 emulator image with GAS so far.
Then I've found all apk packages present in the emulator system img file and absent in my image, sign them all with my platform key and install with adb install with "-g" switch.
The emulator starts but it just pretends to work.
Google Maps starts, but it can't read the GPS signal (I'm in the middle of the ocean )
I still see "The device isn't Play Protect certified" message, even when registered at https://www.google.com/android/uncertified/.
When trying to log into a Google Account, I can see "addAccount(com.google): java.lang.SecurityException: Cannot delegate to Service with different signature." exception thrown.
There are a lot of security-related errors in logs:
GooglePlayServices not available due to error 9
com.google.android.carassistant requires Google Play services, but their signature is invalid
java.lang.SecurityException: UID 10157 is not associated with a first party app!
File error accessing recents directory,
Tried to access the API:ViewConfiguration which needs to have proper configuration from a non-UI Context:[email protected]
Package com.android.car.activityresolver is not installed for any user, java.lang.UnsatisfiedLinkError: dlopen failed: library "/system/lib64/libbluetooth_jni.so" needed or dlopened by "/apex/com.android.art/lib64/libnativeloader.so" is not accessible for the namespace "classloader-namespace"
java.lang.SecurityException: Caller com.google.android.gms needs to hold android.permission.SCHEDULE_EXACT_ALARM to set exact alarms.
and a lot more....
Side note: I've tried an another way - to install my app as a system one in the official emulator, but repacking those super images beat me .
What else should I do? Is there an easy way, like Open GApps for Automotive or how can I create my own GApps package?