RemoteServiceException: can't deliver broadcast - android

The app is bloked only in last release test (Play Store) with:
google Pixel 5
1080x2340
Android 11 (SDK 30)
8.192 MB
arm64-v8a
es_ES
Before, in compilation with android studio all is ok.
This is the crash in google play release test with GooglePixel:
10-11 05:34:40.895: D/AndroidRuntime(22146): Shutting down VM
10-11 05:34:40.895: D/AndroidRuntime(22146): --------- beginning of crash
10-11 05:34:40.895: E/AndroidRuntime(22146): FATAL EXCEPTION: main
10-11 05:34:40.895: E/AndroidRuntime(22146): Process: com.google.android.gms.persistent, PID: 22146
10-11 05:34:40.895: E/AndroidRuntime(22146): android.app.RemoteServiceException: can't deliver broadcast
10-11 05:34:40.895: E/AndroidRuntime(22146): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2005)
10-11 05:34:40.895: E/AndroidRuntime(22146): at android.os.Handler.dispatchMessage(Handler.java:106)
10-11 05:34:40.895: E/AndroidRuntime(22146): at android.os.Looper.loop(Looper.java:223)
10-11 05:34:40.895: E/AndroidRuntime(22146): at android.app.ActivityThread.main(ActivityThread.java:7664)
10-11 05:34:40.895: E/AndroidRuntime(22146): at java.lang.reflect.Method.invoke(Native Method)
10-11 05:34:40.895: E/AndroidRuntime(22146): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
10-11 05:34:40.895: E/AndroidRuntime(22146): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Can you help me? Some idea?

Related

NoClassDefFoundError: FingerprintManagerCompatApi23 after updating to API 23

I updated by gradle to API 23 as well as the dependencies but when I tried running my app I get a NoClassDefFoundError:
10-11 01:26:30.794 11323-11323/com.aufmschoolbliz.app E/AndroidRuntime: FATAL EXCEPTION: main
10-11 01:26:30.794 11323-11323/com.aufmschoolbliz.app E/AndroidRuntime: Process: com.aufmschoolbliz.app, PID: 11323
10-11 01:26:30.794 11323-11323/com.aufmschoolbliz.app E/AndroidRuntime: java.lang.NoClassDefFoundError: android.support.v4.hardware.fingerprint.FingerprintManagerCompatApi23$1
10-11 01:26:30.794 11323-11323/com.aufmschoolbliz.app E/AndroidRuntime: at java.lang.Class.classForName(Native Method)
10-11 01:26:30.794 11323-11323/com.aufmschoolbliz.app E/AndroidRuntime: at java.lang.Class.forName(Class.java:309)
10-11 01:26:30.794 11323-11323/com.aufmschoolbliz.app E/AndroidRuntime: at com.activeandroid.ReflectionUtils.getModelClasses(ReflectionUtils.java:83)
10-11 01:26:30.794 11323-11323/com.aufmschoolbliz.app E/AndroidRuntime: at com.activeandroid.DatabaseHelper.onCreate(DatabaseHelper.java:46)
10-11 01:26:30.794 11323-11323/com.aufmschoolbliz.app E/AndroidRuntime: at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:251)
10-11 01:26:30.794 11323-11323/com.aufmschoolbliz.app E/AndroidRuntime: at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:163)
10-11 01:26:30.794 11323-11323/com.aufmschoolbliz.app E/AndroidRuntime: at com.activeandroid.Registry.openDatabase(Registry.java:149)
10-11 01:26:30.794 11323-11323/com.aufmschoolbliz.app E/AndroidRuntime: at com.activeandroid.Registry.initialize(Registry.java:107)
10-11 01:26:30.794 11323-11323/com.aufmschoolbliz.app E/AndroidRuntime: at com.activeandroid.ActiveAndroid.initialize(ActiveAndroid.java:8)
10-11 01:26:30.794 11323-11323/com.aufmschoolbliz.app E/AndroidRuntime: at com.activeandroid.app.Application.onCreate(Application.java:9)
10-11 01:26:30.794 11323-11323/com.aufmschoolbliz.app E/AndroidRuntime: at com.aufmschoolbliz.app.SchoolBliz.onCreate(SchoolBliz.java:42)
10-11 01:26:30.794 11323-11323/com.aufmschoolbliz.app E/AndroidRuntime: at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012)
10-11 01:26:30.794 11323-11323/com.aufmschoolbliz.app E/AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553)
10-11 01:26:30.794 11323-11323/com.aufmschoolbliz.app E/AndroidRuntime: at android.app.ActivityThread.access$1500(ActivityThread.java:151)
10-11 01:26:30.794 11323-11323/com.aufmschoolbliz.app E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
10-11 01:26:30.794 11323-11323/com.aufmschoolbliz.app E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
10-11 01:26:30.794 11323-11323/com.aufmschoolbliz.app E/AndroidRuntime: at android.os.Looper.loop(Looper.java:135)
10-11 01:26:30.794 11323-11323/com.aufmschoolbliz.app E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5254)
10-11 01:26:30.794 11323-11323/com.aufmschoolbliz.app E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
10-11 01:26:30.794 11323-11323/com.aufmschoolbliz.app E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372)
10-11 01:26:30.794 11323-11323/com.aufmschoolbliz.app E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
10-11 01:26:30.794 11323-11323/com.aufmschoolbliz.app E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Grade file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 10
targetSdkVersion 23
versionCode 4
versionName "2.1.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':numberPickerSupport')
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:support-v4:23.0.1'
compile 'com.android.support:cardview-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.google.code.gson:gson:2.4'
compile 'com.loopj.android:android-async-http:1.4.9'
}
According to ianhanniballake, https://stackoverflow.com/a/32484445/2450000, it is because of the dependencies but I'm not using dynamic version number.
My dependencies is more clear
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.0'
compile files('libs/activeandroid-3.0.jar')
Done!The following is what I done to solve this.
1. Change all of the AppCompatActivity into Activity.
2.
compile 'com.android.support:support-v4:21.0.+'
compile 'com.android.support:appcompat-v7:21.0.+'
Change v7 from 23.1.0 to 21.0.+
3. Change project compiler version from 6.0(API23) to 5.0(API21)
My application run with ActivieAndroid again

Android: WindowManagerGlobal.closeAll() ArrayIndexOutOfBoundsException

While the Android app is working normally on most devices, for some people this error occurs on Galaxy S4:
java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
at android.view.WindowManagerGlobal.closeAll(WindowManagerGlobal.java:325)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3589)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3755)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1287)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5293)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
Does anyone know how to deal with this?

Android Spinner crashes on tapping

I have a spinner that populates list of options properly at first. Then when I switch the activity and come back and tap the spinner the app crashes (see log below).
spinner1 = (Spinner) view.findViewById(R.id.fldWithSpinner1);
ArrayAdapter<?> aa = new ArrayAdapter<Object>(LocationsUI.this,
android.R.layout.simple_spinner_item,
availableLocations);
aa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner1.setAdapter(aa);
Everytime when I switch to LocationsUI the spinner is created. The spinner works ok only at the first time LocationsUI is displayed, after that every time when I tap on the spinner after the LocationsUI is re-displayed, it would crash:
10-11 22:35:20.060: E/AndroidRuntime(30904): FATAL EXCEPTION: main
10-11 22:35:20.060: E/AndroidRuntime(30904): android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy#407f6d50 is not valid; is your activity running?
10-11 22:35:20.060: E/AndroidRuntime(30904): at android.view.ViewRoot.setView(ViewRoot.java:538)
10-11 22:35:20.060: E/AndroidRuntime(30904): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:203)
10-11 22:35:20.060: E/AndroidRuntime(30904): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:117)
10-11 22:35:20.060: E/AndroidRuntime(30904): at android.view.Window$LocalWindowManager.addView(Window.java:424)
10-11 22:35:20.060: E/AndroidRuntime(30904): at android.app.Dialog.show(Dialog.java:241)
10-11 22:35:20.060: E/AndroidRuntime(30904): at android.app.AlertDialog$Builder.show(AlertDialog.java:823)
10-11 22:35:20.060: E/AndroidRuntime(30904): at android.widget.Spinner.performClick(Spinner.java:261)
10-11 22:35:20.060: E/AndroidRuntime(30904): at android.view.View$PerformClick.run(View.java:9249)
10-11 22:35:20.060: E/AndroidRuntime(30904): at android.os.Handler.handleCallback(Handler.java:587)
10-11 22:35:20.060: E/AndroidRuntime(30904): at android.os.Handler.dispatchMessage(Handler.java:92)
10-11 22:35:20.060: E/AndroidRuntime(30904): at android.os.Looper.loop(Looper.java:130)
10-11 22:35:20.060: E/AndroidRuntime(30904): at android.app.ActivityThread.main(ActivityThread.java:3691)
10-11 22:35:20.060: E/AndroidRuntime(30904): at java.lang.reflect.Method.invokeNative(Native Method)
10-11 22:35:20.060: E/AndroidRuntime(30904): at java.lang.reflect.Method.invoke(Method.java:507)
10-11 22:35:20.060: E/AndroidRuntime(30904): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
10-11 22:35:20.060: E/AndroidRuntime(30904): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
10-11 22:35:20.060: E/AndroidRuntime(30904): at dalvik.system.NativeStart.main(Native Method)
10-11 22:35:20.080: E/InputDispatcher(139): channel '40abf270 com.sw.android/com.sw.MyLocAppActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x8
10-11 22:35:20.080: E/InputDispatcher(139): channel '40abf270 com.sw.android/com.sw.MyLocAppActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
Can you please show me the right direction to fix this issue?
As your Logcat says : android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy#407f6d50 is not valid; is your activity running?
This can occur when you are showing the dialog for a context that no longer exists. Here is the link which can explain you what you doing wrong exactly : http://dimitar.me/android-displaying-dialogs-from-background-threads/
and here is the code that helps you from the same link :
private Handler myHandler = new Handler() {
#Override
public void handleMessage(Message msg) {
switch (msg.what) {
case DISPLAY_DLG:
if (!isFinishing()) {
showDialog(MY_DIALOG);
}
break;
}
}
};

Async task returning data after ORMLite database has been closed from screen rotation

I receive this error
10-11 13:58:46.713: E/AndroidRuntime(29407): FATAL EXCEPTION: AsyncTask #2
10-11 13:58:46.713: E/AndroidRuntime(29407): java.lang.RuntimeException: An error occured while executing doInBackground()
10-11 13:58:46.713: E/AndroidRuntime(29407): at android.os.AsyncTask$3.done(AsyncTask.java:299)
10-11 13:58:46.713: E/AndroidRuntime(29407): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
10-11 13:58:46.713: E/AndroidRuntime(29407): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
10-11 13:58:46.713: E/AndroidRuntime(29407): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
10-11 13:58:46.713: E/AndroidRuntime(29407): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
10-11 13:58:46.713: E/AndroidRuntime(29407): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
10-11 13:58:46.713: E/AndroidRuntime(29407): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
10-11 13:58:46.713: E/AndroidRuntime(29407): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
10-11 13:58:46.713: E/AndroidRuntime(29407): at java.lang.Thread.run(Thread.java:856)
10-11 13:58:46.713: E/AndroidRuntime(29407): Caused by: java.lang.IllegalStateException: attempt to re-open an already-closed object: SQLiteDatabase: /data/data/com.philly.philly/databases/PhillyORM.db
10-11 13:58:46.713: E/AndroidRuntime(29407): at android.database.sqlite.SQLiteClosable.acquireReference(SQLiteClosable.java:55)
10-11 13:58:46.713: E/AndroidRuntime(29407): at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1310)
10-11 13:58:46.713: E/AndroidRuntime(29407): at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1253)
10-11 13:58:46.713: E/AndroidRuntime(29407): at com.j256.ormlite.android.AndroidCompiledStatement.getCursor(AndroidCompiledStatement.java:154)
10-11 13:58:46.713: E/AndroidRuntime(29407): at com.j256.ormlite.android.AndroidCompiledStatement.runQuery(AndroidCompiledStatement.java:57)
10-11 13:58:46.713: E/AndroidRuntime(29407): at com.j256.ormlite.stmt.SelectIterator.<init>(SelectIterator.java:55)
10-11 13:58:46.713: E/AndroidRuntime(29407): at com.j256.ormlite.stmt.StatementExecutor.buildIterator(StatementExecutor.java:206)
10-11 13:58:46.713: E/AndroidRuntime(29407): at com.j256.ormlite.stmt.StatementExecutor.query(StatementExecutor.java:155)
10-11 13:58:46.713: E/AndroidRuntime(29407): at com.j256.ormlite.dao.BaseDaoImpl.query(BaseDaoImpl.java:261)
10-11 13:58:46.713: E/AndroidRuntime(29407): at com.j256.ormlite.stmt.QueryBuilder.query(QueryBuilder.java:262)
10-11 13:58:46.713: E/AndroidRuntime(29407): at com.j256.ormlite.stmt.Where.query(Where.java:482)
10-11 13:58:46.713: E/AndroidRuntime(29407): at com.j256.ormlite.dao.BaseDaoImpl.queryForEq(BaseDaoImpl.java:241)
10-11 13:58:46.713: E/AndroidRuntime(29407): at com.philly.philly.Repository.saveOrUpdateKontext(Repository.java:180)
10-11 13:58:46.713: E/AndroidRuntime(29407): at com.philly.philly.PostListActivity$LoadPostsTask.doInBackground(PostListActivity.java:161)
10-11 13:58:46.713: E/AndroidRuntime(29407): at com.philly.philly.PostListActivity$LoadPostsTask.doInBackground(PostListActivity.java:1)
10-11 13:58:46.713: E/AndroidRuntime(29407): at android.os.AsyncTask$2.call(AsyncTask.java:287)
10-11 13:58:46.713: E/AndroidRuntime(29407): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
10-11 13:58:46.713: E/AndroidRuntime(29407): ... 5 more
I believe the key part being 10-11 13:58:46.713: E/AndroidRuntime(29407): Caused by: java.lang.IllegalStateException: attempt to re-open an already-closed object: SQLiteDatabase: /data/data/com.philly.philly/databases/PhillyORM.db
This occurs when I rotate my screen while an async task is retrieving data from the remote server.
What I am assuming is happening is that the request is coming back and attempting to write to the database but the activity which started the task has been destroyed and restarted.
If you need to see my code I will add it but I thought the source of this problem might actually be pretty clear just from the error messages and my description.
I'm just looking for how to properly handle screen rotations when retrieving remote data and writing to a local database using ORMLite. Maybe I should be using a service instead of async task?
Thanks in advance.
Your activity is probably closing the DB on rotation.
My suggestion is to use an AsyncTaskLoader and it will take care of the rotation by itself. http://developer.android.com/guide/components/loaders.html
Also a tip I've learned from experience is to have a singleton DB object that will only be opened once through the whole life of your application... and when the application dies, the object is closed automatically.
You are better off using a service to take care of database. When you rotate the screen current layout with all components is destroyed and new one is build using new orientation layout (which will have other components). Also you have the option to block the rotation of screen if you don't really use it.

Open a PDF from URL

I am a novice at android development. I have to show a PDF from a URL.
This is my current code but I'm not able to show the PDF file:
public class TestActivity extends Activity
{
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
System.setProperty("http.proxyHost","192.168.0.2");
System.setProperty("http.proxyPort","8080");
showPdf();
}
private void showPdf()
{
WebView webview = new WebView(this);
setContentView(webview);
webview.getSettings().setJavaScriptEnabled(true);
Log.v("....hello....","");
webview.loadUrl("http://docs.google.com/gview?embedded=true&url=http://myurl.com/demo.pdf");
}
}
Logcat:
10-11 14:50:49.586: ERROR/AndroidRuntime(537): FATAL EXCEPTION: main
10-11 14:50:49.586: ERROR/AndroidRuntime(537): android.app.SuperNotCalledException: Activity {com.vidushi.Test/com.vidushi.Test.TestActivity} did not call through to super.onCreate()
10-11 14:50:49.586: ERROR/AndroidRuntime(537): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2629)
10-11 14:50:49.586: ERROR/AndroidRuntime(537): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
10-11 14:50:49.586: ERROR/AndroidRuntime(537): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
10-11 14:50:49.586: ERROR/AndroidRuntime(537): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
10-11 14:50:49.586: ERROR/AndroidRuntime(537): at android.os.Handler.dispatchMessage(Handler.java:99)
10-11 14:50:49.586: ERROR/AndroidRuntime(537): at android.os.Looper.loop(Looper.java:123)
10-11 14:50:49.586: ERROR/AndroidRuntime(537): at android.app.ActivityThread.main(ActivityThread.java:4627)
10-11 14:50:49.586: ERROR/AndroidRuntime(537): at java.lang.reflect.Method.invokeNative(Native Method)
10-11 14:50:49.586: ERROR/AndroidRuntime(537): at java.lang.reflect.Method.invoke(Method.java:521)
10-11 14:50:49.586: ERROR/AndroidRuntime(537): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
10-11 14:50:49.586: ERROR/AndroidRuntime(537): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
10-11 14:50:49.586: ERROR/AndroidRuntime(537): at dalvik.system.NativeStart.main(Native Method)
Its working fine here. Still let me suggest you to test whether you have added INTERNET permission in AndroidManifest.xml file or not:
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
Update:
The link you want to open is: http://litofinter.es.milfoil.arvixe.com/PDF/Book6.pdf
Now its also working fine here:

Categories

Resources