Obsolete
Status Update
Comments
yb...@google.com <yb...@google.com> #2
Android Studio is actually 0.8.11
mm...@commonsware.com <mm...@commonsware.com> #3
The stack trace seems to say you are running with several definitions of one annotation. This seems to often be caused by including 2 different versions of the same library in an instrumentation apk and its tested application apk. Could you please check it's not your case here? If it's your case, you should fix that.
Looking at dx about this report, it seems that DX may fail to check a duplicate class definition when running multidex, I've recorded a bug about this point.
That said, it does not look like we could be in the DX lack of check case here, because mainDexClasses is keeping all the annotations in the main dex (and dx seems to correctly identify the duplicate definition when the 2 definitions are added to the same dex). (Can you confirm that you're using mainDexClasses to create your main dex list?)
I'm assigning back to you xav in case you want to add some check in the SDK.
Looking at dx about this report, it seems that DX may fail to check a duplicate class definition when running multidex, I've recorded a bug about this point.
That said, it does not look like we could be in the DX lack of check case here, because mainDexClasses is keeping all the annotations in the main dex (and dx seems to correctly identify the duplicate definition when the 2 definitions are added to the same dex). (Can you confirm that you're using mainDexClasses to create your main dex list?)
I'm assigning back to you xav in case you want to add some check in the SDK.
se...@gmail.com <se...@gmail.com> #4
The error is not reproducible in other machines, so it's probably a local config problem. We'll try the mainDexClasses approach.
cr...@shou.tv <cr...@shou.tv> #5
[Comment deleted]
bo...@gmail.com <bo...@gmail.com> #6
We're still looking into it. We're *not* using mainDexClasses because it wasn't documented or included on the SDK, and the only blog file that references it (written on Monday) mentions libraries to be preDexed, which isn't available while --multi-dex, and removing --multi-dex doesn't allow our app to build due to the 64k method limit.
xm...@gmail.com <xm...@gmail.com> #7
The error is localized to my computer and only in 4/10 builds, so whenever I want something and it doesn't work I have to edit a file, rebuild and hope for the best.
ra...@gmail.com <ra...@gmail.com> #8
We've run into the same issue as well. Right before the AndroidRuntime error, you should see dalvikvm error saying which class resolved by unexpected DEX (the orm-lite class). I suspect that has a nested static enum or classes? If you add that class in your multidex.keep file, does it fix your problem? Could you paste the dalvikvm log line you are seeing?
[Deleted User] <[Deleted User]> #9
10-29 18:26:26.140 31690-31690/com.myapp.app W/dalvikvm﹕ Class resolved by unexpected DEX: Lcom/myapp/model/MyClass;(0x427a7898):0x596d1000 ref [Lcom/j256/ormlite/field/DataType;] Lcom/j256/ormlite/field/DataType;(0x427a7898):0x5910f000
10-29 18:26:26.140 31690-31690/com.myapp.app W/dalvikvm﹕ (Lcom/myapp/model/MyClass; had used a different Lcom/j256/ormlite/field/DataType; during pre-verification)
10-29 18:26:26.140 31690-31690/com.myapp.app W/dalvikvm﹕ Failed processing annotation value
10-29 18:26:26.140 31690-31690/com.myapp.app W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41d28700)
I'll try and add that class to the multidex.keep
10-29 18:26:26.140 31690-31690/
10-29 18:26:26.140 31690-31690/
10-29 18:26:26.140 31690-31690/
I'll try and add that class to the multidex.keep
sl...@gmail.com <sl...@gmail.com> #10
[Comment deleted]
yb...@google.com <yb...@google.com> #11
After several attempts with mainDexClasses this is as far as I got
sudo ./mainDexClasses --output multidex.keep /Users/myuser/my_workspace/myapp/app/build/intermediates/dex/dev/debug;/Users/myuser/my_workspace/myapp/app/libs/android-support-multidex.jar;/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar;/Users/myuser/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.2.4/95705b2e89a4101f2a82af6b303945755d7f93ab/jackson-core-2.2.4.jar;/Users/myuser/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.2.4/9de62c96bb3e17eb909c107f2759c73650b5a8f1/jackson-annotations-2.2.4.jar;/Users/myuser/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.2.4/906cf5deb56ec1fb3ecbeceb08a1734ce9fed664/jackson-databind-2.2.4.jar
Password:
Error: The input doesn't contain any classes. Did you specify the proper '-injars' options?
-bash: /Users/myuser/my_workspace/myapp/app/libs/android-support-multidex.jar: cannot execute binary file
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 1: PK: command not found
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 2: xj?C: command not found
K-*??ϳR0?3??r,J??,K-?V?+????RKRSt?*?ules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 3:wj?C?I5?x?META-INF/MANIFEST.MF?M??LK-.?
?3R: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 3: ?R?x??J3sJ???E???%??P?]??l?fz?f?@{: command not found
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 5: r2?K?V: command not found
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 6: sj?Ccom/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 7: sj?C: command not found
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 8: tj?Ccom/j256/ormlite/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 9: sj?Ccom/j256/ormlite/core/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 10: tj?Ccom/j256/ormlite/dao/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 11: tj?Ccom/j256/ormlite/db/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 12: tj?Ccom/j256/ormlite/field/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 13: tj?Ccom/j256/ormlite/field/types/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 14: tj?Ccom/j256/ormlite/logger/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 15: tj?Ccom/j256/ormlite/misc/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 16: tj?Ccom/j256/ormlite/stmt/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 17: tj?Ccom/j256/ormlite/stmt/mapped/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 18: tj?Ccom/j256/ormlite/stmt/query/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 19: tj?Ccom/j256/ormlite/support/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 20: tj?Ccom/j256/ormlite/table/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 21:sj?C?0??L!com/j256/ormlite/core/LICENSE.txtURMs?: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 24: syntax error near unexpected token `)'
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 24: `"?@?h/Ѯ??)???????j?
p??ah5EbH???Ь.a_S???c"' {`M??d??c????N?[n????
-bash: /Users/myuser/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.2.4/95705b2e89a4101f2a82af6b303945755d7f93ab/jackson-core-2.2.4.jar: cannot execute binary file
-bash: /Users/myuser/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.2.4/9de62c96bb3e17eb909c107f2759c73650b5a8f1/jackson-annotations-2.2.4.jar: cannot execute binary file
-bash: /Users/myuser/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.2.4/906cf5deb56ec1fb3ecbeceb08a1734ce9fed664/jackson-databind-2.2.4.jar: cannot execute binary file
The output file is empty.
sudo ./mainDexClasses --output multidex.keep /Users/myuser/my_workspace/myapp/app/build/intermediates/dex/dev/debug;/Users/myuser/my_workspace/myapp/app/libs/android-support-multidex.jar;/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar;/Users/myuser/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.2.4/95705b2e89a4101f2a82af6b303945755d7f93ab/jackson-core-2.2.4.jar;/Users/myuser/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.2.4/9de62c96bb3e17eb909c107f2759c73650b5a8f1/jackson-annotations-2.2.4.jar;/Users/myuser/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.2.4/906cf5deb56ec1fb3ecbeceb08a1734ce9fed664/jackson-databind-2.2.4.jar
Password:
Error: The input doesn't contain any classes. Did you specify the proper '-injars' options?
-bash: /Users/myuser/my_workspace/myapp/app/libs/android-support-multidex.jar: cannot execute binary file
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 1: PK: command not found
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 2: xj?C: command not found
K-*??ϳR0?3??r,J??,K-?V?+????RKRSt?*?ules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 3:wj?C?I5?x?META-INF/MANIFEST.MF?M??LK-.?
?3R: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 3: ?R?x??J3sJ???E???%??P?]??l?fz?f?@{: command not found
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 5: r2?K?V: command not found
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 6: sj?Ccom/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 7: sj?C: command not found
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 8: tj?Ccom/j256/ormlite/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 9: sj?Ccom/j256/ormlite/core/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 10: tj?Ccom/j256/ormlite/dao/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 11: tj?Ccom/j256/ormlite/db/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 12: tj?Ccom/j256/ormlite/field/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 13: tj?Ccom/j256/ormlite/field/types/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 14: tj?Ccom/j256/ormlite/logger/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 15: tj?Ccom/j256/ormlite/misc/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 16: tj?Ccom/j256/ormlite/stmt/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 17: tj?Ccom/j256/ormlite/stmt/mapped/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 18: tj?Ccom/j256/ormlite/stmt/query/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 19: tj?Ccom/j256/ormlite/support/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 20: tj?Ccom/j256/ormlite/table/PK: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 21:sj?C?0??L!com/j256/ormlite/core/LICENSE.txtURMs?: No such file or directory
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 24: syntax error near unexpected token `)'
/Users/myuser/.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar: line 24: `"?@?h/Ѯ??)???????j?
p??ah5EbH???Ь.a_S???c"' {`M??d??c????N?[n????
-bash: /Users/myuser/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.2.4/95705b2e89a4101f2a82af6b303945755d7f93ab/jackson-core-2.2.4.jar: cannot execute binary file
-bash: /Users/myuser/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.2.4/9de62c96bb3e17eb909c107f2759c73650b5a8f1/jackson-annotations-2.2.4.jar: cannot execute binary file
-bash: /Users/myuser/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.2.4/906cf5deb56ec1fb3ecbeceb08a1734ce9fed664/jackson-databind-2.2.4.jar: cannot execute binary file
The output file is empty.
Description
Version used: Room alpha9-1, Paging alpha1
Devices/Android versions reproduced on: Nexus 6P (Android 7.1.1)
Given a DAO method returning a LivePagedListProvider:
@Query("SELECT * FROM cities ORDER BY population DESC")
LivePagedListProvider<?, City> pagedByPopulation();
and given that we configure the PagedList to have a significant prefetch distance:
LivePagedListProvider<?, City> provider=store.pagedByPopulation();
PagedList.Config config=new PagedList.Config.Builder()
.setPageSize(50)
.setPrefetchDistance(100)
.build();
testPaging(provider.create(null, config));
A background thread gets created by something (Paging, I assume) for some purpose (prefetch, I assume), and that thread will crash if the database is closed, resulting in the following exception:
Process: com.commonsware.android.citypop.paging, PID: 30170
java.lang.IllegalStateException: Cannot perform this operation because the connection pool has been closed.
at android.database.sqlite.SQLiteConnectionPool.throwIfClosedLocked(SQLiteConnectionPool.java:962)
at android.database.sqlite.SQLiteConnectionPool.waitForConnection(SQLiteConnectionPool.java:599)
at android.database.sqlite.SQLiteConnectionPool.acquireConnection(SQLiteConnectionPool.java:348)
at android.database.sqlite.SQLiteSession.acquireConnection(SQLiteSession.java:894)
at android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:834)
at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:62)
at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:143)
at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:132)
at com.commonsware.android.citypop.Store_Impl$2$1.convertRows(Store_Impl.java:97)
at android.arch.persistence.room.paging.LimitOffsetDataSource.loadRange(LimitOffsetDataSource.java:104)
at android.arch.paging.TiledDataSource.loadRangeWrapper(TiledDataSource.java:117)
at android.arch.paging.TiledPagedList$2.run(TiledPagedList.java:141)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
The problem is that we have no way to know that this thread exists or when it is done with the work. Calling detach() on the PagedList is insufficient. Removing observers on the LiveData<PagedList> is also insufficient.
A prefetch distance of 0 does not trigger the crash. Similarly, not setting a prefetch distance does not trigger the crash.
Admittedly, lots of apps will never close their database. However, for testing, if nothing else, it would be useful to have some means of closing the database that does not trigger this crash.
Attached is a sample project. Running the instrumentation tests should trigger this crash.
Thanks!