Get Error In New App Version: No Such Table - android

I read a lot of related posts, but I didn't get the solution.
I use the ActiveAndroid library for the database and released my program, but I having trouble in updating the new version.
In the new version of the application, a table is added to the database. Therefore, the database must be updated.
(I made the changes and increased the database version ).
manifest file:
<meta-data
android:name="AA_DB_NAME"
android:value="KashanTakhfifi" />
<meta-data
android:name="AA_DB_VERSION"
android:value="2" />
<meta-data
android:name="AA_MODELS"
android:value="DBTableModel.TableNotificationModel, DBTableModel.TableGuideModel" />
But when the new app is install or update,The program will be crash.
because happen error: no such table(which means the database is not updated).
I read in the other posts : the app should be removed and reinstalled.
But I've released the app and this problem is not logical for users.
If I want to delete this library, I will have to make a lot of changes to my code...
What is the solution for me.

Related

GooglePlayServicesIncorrectManifestValueException when checking if play services are available

We are using GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context) to check for google services before showing a map. Even though the device has access to play services, the method is throwing an exception when being called. The exception is GooglePlayServicesIncorrectManifestValueException with the message:
“The meta-data tag in your app's AndroidManifest.xml does not have the right value.
Expected 12451000 but found 4323000. 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" />”
In the manifest I’ve declared:
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
If I go into the play services version, I get:
<integer name="google_play_services_version">12451000</integer>
Which comes from
jetified-play-services-basement-18.1.0/res/values/values.xml
I’ve tried most solutions in other stack overflow posts to no avail. These are all the things I’ve tried and none of them work:
Change tag order in manifest (https://stackoverflow.com/a/37810158/8575762). This has no effect, and also it makes no sense that it should have one.
Make sure we are not providing our own hardcoded version (https://stackoverflow.com/a/63791222/8575762)
Remove the <meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" /> tag from the manifest.
Update firebase libraries to latest BOM version (30.5.0)
Remove firebase libraries completely.
Update play services dependencies to latest version(auth, auth-api-phone, vision, wallet, location, safetynet)
Update google services plugin to latest version (4.3.13)
Add tools:node="replace" (also tried other manifest options like node:replace, etc) to the metadata tag & hardcode the version value
If I inspect the AndroidManifest on the built apk (debug), the value of the meta-data tag is the following:
<meta-data
android:name="com.google.android.gms.version"
android:value="#ref/0x7f0b000f" />”.
It’s important to note that this behavior is not 100% consistent. Usually I’ll do a fresh install and the first time I launch the app the isGooglePlayServicesAvailable method returns without crashing. If I restart the app it no longer works.
This seems like a bug in the services implementation library to me, but it feels like something too simple to be failing like that.
Any help would be appreciated, thanks in advance.

Cannot Find the Reported APM Logs on the Huawei Devices

When the Huawei APM SDK is integrated, there was no app performance data on the App performance management page. I wanted to locate the problem based on the Logcat logs on the device.
However, I'm not sure where these logs are kept or if I have to enable them in some way?
I checked the APM documentation and found out how to access the logs:
Open the AndroidManifest.xml file of the app, and add the meta-data element to the application.
<application>
<meta-data
android:name="apms_debug_log_enabled"
android:value=" true" />
</application>
After the APM debug log function is enabled, you can use the Logcat log filter function com.huawei.agc.apms or apms to view the logs.

How to resolve errors produced by deleting google_maps_api.xml?

I am using this library for displaying directions: https://github.com/akexorcist/Android-GoogleDirectionLibrary/blob/master/app/src/main/java/com/akexorcist/googledirection/sample/SimpleDirectionActivity.java. Previously I created a google maps activity, and the google_maps_api.xml was generated. I deleted this file because I don't believe I need it anymore, but now I get an error in my manifest file saying
"No resources found that match the given name(at 'value' with value '#string/google_maps_key') Can I simply delete the meta data tage seen below or is there a better option to clean things up?
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/google_maps_key" />

SugarORM error or missing database

I have tried to get an Android Project working with SugarORM. However, I am running into the following error:
Caused by: android.database.sqlite.SQLiteException: no such table: DOCUMENT (code 1): , while compiling: INSERT OR REPLACE INTO DOCUMENT(ID,CREATED) VALUES (?,?)
#################################################################
Error Code : 1 (SQLITE_ERROR)
Caused By : SQL(query) error or missing database.
(no such table: DOCUMENT (code 1): , while compiling: INSERT OR REPLACE INTO DOCUMENT(ID,CREATED) VALUES (?,?))
#################################################################
In my AndroidManifest I have defined the android:name="com.orm.SugarApp" in my application - Tag and included
<meta-data android:name="DATABASE" android:value="idea.db" />
<meta-data android:name="VERSION" android:value="1" />
also as child tags. I have removed
<meta-data android:name="QUERY_LOG" android:value="true" />
<meta-data android:name="DOMAIN_PACKAGE_NAME" android:value="com.example" />
from the example as they don't change anything (and others had success in removing them). I have tried to Query the db first (with findById) to "force table creation" as explained in this post. Furthermore, I have tried doing something like
SugarDb sugarDb = new SugarDb(getApplicationContext()); new
File(sugarDb.getDB().getPath())
as described here.But this runs in an error as well. Furthermore I have disabled the InstantRun-Feature as described in a few posts and here (Sugar ORM No such table exception).
Can anybody point me the right direction how to get rid of the "error or missing database"-error?
Are you sure <meta-data android:name="DOMAIN_PACKAGE_NAME" android:value="com.example" /> doesn't change anything? Your link supporting that doesn't seem to go to the correct place. Regardless, follow the examples until the issue is fixed, then worry about what can be trimmed away!
You shouldn't need to be looking at the database file, not really sure why that's included.
Does your Document class extends SugarRecord? Without that, the table won't be created.
In general I think you should try running through the "Getting Started" again from scratch, without making any modifications to the code on the way.
i had the same problem and in my case, it turned out that sugar orm version 1.4 had issues. Just update your gradle dependency to compile 'com.github.satyan:sugar:1.5' This solved my problem
If you use ProGuard you must edit proguard-rules.pro
Add this line to end.
My SugarRecords ( models ) in models folder.
-keep class com.username.appname.models.** { *; }
And disable Instant Run function in Android Studio.
I wrote a tutorial for SugarORM installation here

Android Play Store Error -505

When uploading an APK to the Android Developer Console, everything goes normal, but there are a certain subset of users on android 5.0 and up that are unable to install or upgrade the APK. These users see a Google Play Store error 505.
There are several different resources that tell you that the 505 error is a conflict of permission. Starting in Android Lollipop, you are no longer able to have duplicate custom permissions with the same name https://developer.android.com/about/versions/android-5.0-changes.html#custom_permissions. If you check stackoverflow for this error you'll find multiple reports of people offering this as a solution. While this can sometimes be the cause of this error there are several other reasons that this, and other conflicts can happen.
1. More than one app defines the same permission
If two completely different apps define the same permission e.g if you have a user and a manager app, and both of them have something along the lines of:
<permission
android:name="same.package.name.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
2. Same app signed by different keys
You have the same app, but signed by different keys. For example if you had a release version and a debug version, you'll hit a conflict because the system sees this as two different apps requesting the same permission.
3. Conflicting authorities
But there is an entirely different situation that can occur, which is less obvious. The 505 error can also occur with conflicting authorities. If two different apps declare the same provider, such as
<provider
android:name=".provider.YourProvider"
android:authorities="com.roqbot.client.YourProvider"
android:exported="false" />
This can also provide a conflict.
The last, and hardest conflict to spot, is one that can happen with Google Play Services 8.1 and up. If you do not define an application id in your build.gradle file like this:
defaultConfig {
applicationId "com.example.my.app"
}
it is possible that it will auto-generate a provider that can conflict with other apps. To check this, go into your your build>intermediates>manifests>full>release>AndroidManifest.xml and look for
<provider
android:name="com.google.android.gms.measurement.AppMeasurementContentProvider"
android:authorities="com.google.android.gms.google_measurement_service"
android:exported="false" />
Here the authority name will conflict with other apps. If you add the applicationId to the default config, it will change this authority to
<provider
android:name="com.google.android.gms.measurement.AppMeasurementContentProvider"
android:authorities="com.example.my.app.google_measurement_service"
android:exported="false" />
This is very subtle and appears to be a bug starting in google play services 8.1. The issue can be seen discussed here. https://code.google.com/p/android/issues/detail?id=189079&can=1&q=error%20505&sort=-opened&colspec=ID%20Status%20Priority%20Owner%20Summary%20Stars%20Reporter%20Opened
The point to remember is that it may be several things, and the only thing you can verify for sure with a 505 error is that there is a conflict of some sort, and that it may or may not necessarily be a custom permission conflict.
If you are using the Facebook SDK and following the official sample code, you might also encounter the issue. In my case, I was using a same content provider name on 2 different app's manifest.
<provider
android:authorities="com.facebook.app.FacebookContentProvider123"
android:name="com.facebook.FacebookContentProvider"
android:exported="true" />
I forgot to change the default name com.facebook.app.FacebookContentProvider123. Finally fixed it by adding a dynamic applicationId as provider name.
<provider
android:authorities="com.facebook.app.FacebookContentProvider.${applicationId}"
android:name="com.facebook.FacebookContentProvider"
android:exported="true" />
Name Of The Error: Error 505
Problem: This is an unusual error code which is encountered during the updation or installation of the application from Google Play store. It shows up an error message stating “Unknown error code during Application installs 505”.
Following reasons are responsible for this error.
• It is mostly seen when you try to install an outdated version of the app.
• Error 505 can be caused due to the incompatibility of the app with your Android OS version.
• It can also arise due to cache conflict or data crash of the app.
• Error 505 may also arise due to Google Account Sync Problem.
Solution:
• At first restart your Android device, because this step usually works in getting rid off of any type of error. If it didn’t work and then try these simple steps.
• Clear Cache and Data of Google Play Store, Google Service Framework and Download Manager. To do this First of all go to Settings >> then Apps >> select All >> then Google Play Store and Clear cache and Clear data. Also Clear cache and Clear data for Google Services.

Categories

Resources