Android 7 does not allow to install the Demo APK. I am getting exception while installing the demo apk. Please advise, how to fix the problem. WIth Android 8, it works fine.
java.lang.NoClassDefFoundError: Failed resolution of: Ljava/nio/file/DirectoryStream$Filter;
at org.jumpmind.symmetric.android.AndroidSymmetricEngine.createStagingManager(AndroidSymmetricEngine.java:108)
at org.jumpmind.symmetric.AbstractSymmetricEngine.init(AbstractSymmetricEngine.java:348)
at org.jumpmind.symmetric.android.AndroidSymmetricEngine.<init>(AndroidSymmetricEngine.java:84)
at org.jumpmind.symmetric.android.SymmetricService.onStartCommand(SymmetricService.java:88)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3406)
at android.app.ActivityThread.-wrap21(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1648)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:165)
at android.app.ActivityThread.main(ActivityThread.java:6375)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802)
Caused by: java.lang.ClassNotFoundException: Didn't find class "java.nio.file.DirectoryStream$Filter" on path: DexPathList[[zip file "/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/base.apk", zip file "/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_dependencies_apk.apk", zip file "/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_0_apk.apk", zip file "/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_1_apk.apk", zip file "/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_2_apk.apk", zip file "/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_3_apk.apk", zip file "/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_4_apk.apk", zip file "/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_5_apk.apk", zip file "/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_6_apk.apk", zip file "/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_7_apk.apk", zip file "/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_8_apk.apk", zip file "/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/lib/arm64, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:74)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 13 more
Suppressed: java.io.IOException: No original dex files found for dex location /data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_0_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:373)
at dalvik.system.DexFile.<init>(DexFile.java:113)
at dalvik.system.DexFile.<init>(DexFile.java:78)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:366)
at dalvik.system.DexPathList.makeElements(DexPathList.java:327)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:263)
at dalvik.system.DexPathList.<init>(DexPathList.java:126)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:62)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
at com.android.internal.os.PathClassLoaderFactory.createClassLoader(PathClassLoaderFactory.java:43)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:58)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:522)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:555)
at android.app.ActivityThread.getTopLevelResources(ActivityThread.java:1942)
at android.app.LoadedApk.getResources(LoadedApk.java:773)
at android.app.ContextImpl.<init>(ContextImpl.java:2078)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2023)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5410)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1611)
... 6 more
Suppressed: java.io.IOException: No original dex files found for dex location /data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_3_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:373)
at dalvik.system.DexFile.<init>(DexFile.java:113)
at dalvik.system.DexFile.<init>(DexFile.java:78)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:366)
at dalvik.system.DexPathList.makeElements(DexPathList.java:327)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:263)
at dalvik.system.DexPathList.<init>(DexPathList.java:126)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:62)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
at com.android.internal.os.PathClassLoaderFactory.createClassLoader(PathClassLoaderFactory.java:43)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:58)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:522)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:555)
at android.app.ActivityThread.getTopLevelResources(ActivityThread.java:1942)
at android.app.LoadedApk.getResources(LoadedApk.java:773)
at android.app.ContextImpl.<init>(ContextImpl.java:2078)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2023)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5410)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1611)
... 6 more
Suppressed: java.io.IOException: No original dex files found for dex location /data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_5_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:373)
at dalvik.system.DexFile.<init>(DexFile.java:113)
at dalvik.system.DexFile.<init>(DexFile.java:78)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:366)
at dalvik.system.DexPathList.makeElements(DexPathList.java:327)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:263)
at dalvik.system.DexPathList.<init>(DexPathList.java:126)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:62)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
at com.android.internal.os.PathClassLoaderFactory.createClassLoader(PathClassLoaderFactory.java:43)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:58)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:522)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:555)
at android.app.ActivityThread.getTopLevelResources(ActivityThread.java:1942)
at android.app.LoadedApk.getResources(LoadedApk.java:773)
at android.app.ContextImpl.<init>(ContextImpl.java:2078)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2023)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5410)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1611)
... 6 more
Suppressed: java.io.IOException: No original dex files found for dex location /data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_7_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:373)
at dalvik.system.DexFile.<init>(DexFile.java:113)
at dalvik.system.DexFile.<init>(DexFile.java:78)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:366)
at dalvik.system.DexPathList.makeElements(DexPathList.java:327)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:263)
at dalvik.system.DexPathList.<init>(DexPathList.java:126)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:62)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
at com.android.internal.os.PathClassLoaderFactory.createClassLoader(PathClassLoaderFactory.java:43)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:58)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:522)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:555)
at android.app.ActivityThread.getTopLevelResources(ActivityThread.java:1942)
at android.app.LoadedApk.getResources(LoadedApk.java:773)
at android.app.ContextImpl.<init>(ContextImpl.java:2078)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2023)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5410)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1611)
... 6 more</init></init></init></init></init></init></init></init></init></init></init></init></init></init></init></init></init></init></init></init></init></init></init></init></init>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It's possible you could patch this with a small code change but I am not sure if this would work. You could replace AndroidSymmetricEngine.createStagingManager() with a stubbed out IStagingManager. You would also want to set:
stream.to.file.enabled=false
initial.load.use.extract.job.enabled=false
e.g.
@Override
protected IStagingManager createStagingManager() {
return new IStagingManager() {
public IStagedResource find(Object... path) {
return null;
}
public IStagedResource create(long memoryThresholdInBytes, Object... path) {
return null;
}
public long clean(long timeToLiveInMs) {
return 0;
}
public IStagedResource find(String path) {
return null;
}
public Collection<String> getResourceReferences() {
return null;
}
};
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I'm getting this error when loading the android demo app.
anyone know where to find this class ?
Marco,
That exception should be logged at DEBUG level, and can be ignored on Android. I recommend adjusting the logging to INFO level if you can.
Mark
Android 7 does not allow to install the Demo APK. I am getting exception while installing the demo apk. Please advise, how to fix the problem. WIth Android 8, it works fine.
java.lang.NoClassDefFoundError: Failed resolution of: Ljava/nio/file/DirectoryStream$Filter;
at org.jumpmind.symmetric.android.AndroidSymmetricEngine.createStagingManager(AndroidSymmetricEngine.java:108)
at org.jumpmind.symmetric.AbstractSymmetricEngine.init(AbstractSymmetricEngine.java:348)
at org.jumpmind.symmetric.android.AndroidSymmetricEngine.<init>(AndroidSymmetricEngine.java:84)
at org.jumpmind.symmetric.android.SymmetricService.onStartCommand(SymmetricService.java:88)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3406)
at android.app.ActivityThread.-wrap21(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1648)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:165)
at android.app.ActivityThread.main(ActivityThread.java:6375)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802)
Caused by: java.lang.ClassNotFoundException: Didn't find class "java.nio.file.DirectoryStream$Filter" on path: DexPathList[[zip file "/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/base.apk", zip file "/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_dependencies_apk.apk", zip file "/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_0_apk.apk", zip file "/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_1_apk.apk", zip file "/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_2_apk.apk", zip file "/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_3_apk.apk", zip file "/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_4_apk.apk", zip file "/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_5_apk.apk", zip file "/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_6_apk.apk", zip file "/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_7_apk.apk", zip file "/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_8_apk.apk", zip file "/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/lib/arm64, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:74)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 13 more
Suppressed: java.io.IOException: No original dex files found for dex location /data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_0_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:373)
at dalvik.system.DexFile.<init>(DexFile.java:113)
at dalvik.system.DexFile.<init>(DexFile.java:78)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:366)
at dalvik.system.DexPathList.makeElements(DexPathList.java:327)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:263)
at dalvik.system.DexPathList.<init>(DexPathList.java:126)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:62)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
at com.android.internal.os.PathClassLoaderFactory.createClassLoader(PathClassLoaderFactory.java:43)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:58)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:522)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:555)
at android.app.ActivityThread.getTopLevelResources(ActivityThread.java:1942)
at android.app.LoadedApk.getResources(LoadedApk.java:773)
at android.app.ContextImpl.<init>(ContextImpl.java:2078)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2023)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5410)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1611)
... 6 more
Suppressed: java.io.IOException: No original dex files found for dex location /data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_3_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:373)
at dalvik.system.DexFile.<init>(DexFile.java:113)
at dalvik.system.DexFile.<init>(DexFile.java:78)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:366)
at dalvik.system.DexPathList.makeElements(DexPathList.java:327)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:263)
at dalvik.system.DexPathList.<init>(DexPathList.java:126)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:62)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
at com.android.internal.os.PathClassLoaderFactory.createClassLoader(PathClassLoaderFactory.java:43)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:58)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:522)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:555)
at android.app.ActivityThread.getTopLevelResources(ActivityThread.java:1942)
at android.app.LoadedApk.getResources(LoadedApk.java:773)
at android.app.ContextImpl.<init>(ContextImpl.java:2078)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2023)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5410)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1611)
... 6 more
Suppressed: java.io.IOException: No original dex files found for dex location /data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_5_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:373)
at dalvik.system.DexFile.<init>(DexFile.java:113)
at dalvik.system.DexFile.<init>(DexFile.java:78)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:366)
at dalvik.system.DexPathList.makeElements(DexPathList.java:327)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:263)
at dalvik.system.DexPathList.<init>(DexPathList.java:126)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:62)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
at com.android.internal.os.PathClassLoaderFactory.createClassLoader(PathClassLoaderFactory.java:43)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:58)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:522)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:555)
at android.app.ActivityThread.getTopLevelResources(ActivityThread.java:1942)
at android.app.LoadedApk.getResources(LoadedApk.java:773)
at android.app.ContextImpl.<init>(ContextImpl.java:2078)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2023)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5410)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1611)
... 6 more
Suppressed: java.io.IOException: No original dex files found for dex location /data/app/org.jumpmind.symmetric.symmetricandroidclientdemo-1/split_lib_slice_7_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:373)
at dalvik.system.DexFile.<init>(DexFile.java:113)
at dalvik.system.DexFile.<init>(DexFile.java:78)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:366)
at dalvik.system.DexPathList.makeElements(DexPathList.java:327)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:263)
at dalvik.system.DexPathList.<init>(DexPathList.java:126)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:62)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
at com.android.internal.os.PathClassLoaderFactory.createClassLoader(PathClassLoaderFactory.java:43)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:58)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:522)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:555)
at android.app.ActivityThread.getTopLevelResources(ActivityThread.java:1942)
at android.app.LoadedApk.getResources(LoadedApk.java:773)
at android.app.ContextImpl.<init>(ContextImpl.java:2078)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2023)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5410)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1611)
... 6 more</init></init></init></init></init></init></init></init></init></init></init></init></init></init></init></init></init></init></init></init></init></init></init></init></init>
Red,
You are correct, the latest versions of SymmetricDS reference java.nio.file.DirectoryStream. which while part of Java 7, is not available on android until API 26 (Android 8). See:
https://developer.android.com/reference/java/nio/file/DirectoryStream
It's possible you could patch this with a small code change but I am not sure if this would work. You could replace AndroidSymmetricEngine.createStagingManager() with a stubbed out IStagingManager. You would also want to set:
stream.to.file.enabled=false
initial.load.use.extract.job.enabled=false
e.g.
@Override
protected IStagingManager createStagingManager() {
return new IStagingManager() {