Closed paulproteus closed 4 years ago
Underlying issue:
I was relying on java.nio.file.Files.newBufferedReader , which per https://developer.android.com/reference/java/nio/file/Files#newBufferedReader(java.nio.file.Path) is available starting in API level 26.
I'm legitimately confused as to why minSdkVersion didn't catch this (???), but OK.
minSdkVersion
Testing done:
Created API 23 x86_64 Android Virtual Device
Rebuilt the app with this template
Validated that it launches twice, and successfully prints things about cache miss & hit respectively
First run:
06-09 20:32:35.547 3295 3295 D MainActivity: onCreate() start 06-09 20:32:35.556 3295 3295 D MainActivity: onCreate(): captured stdout/stderr 06-09 20:32:35.645 3295 3295 D MainActivity: Unpacking Python stdlib due to cache miss on stdlib/pythonhome.45634126ed5191759396ff4c15e92d8a7f2b18bf474d8e741ae6f1d10733de92.x86_64.zip 06-09 20:32:36.202 3295 3295 D MainActivity: Unpacking rubicon-java to /data/user/0/org.ash_eesh.helloworld/files/python/rubicon-java 06-09 20:32:36.208 3295 3295 D MainActivity: Unpacking Python assets to base dir /data/user/0/org.ash_eesh.helloworld/files/python/user_code 06-09 20:32:38.056 3295 3295 D MainActivity: unpackPython() complete 06-09 20:32:38.056 3295 3295 D MainActivity: setPythonEnvVars() start 06-09 20:32:38.056 3295 3295 V MainActivity: pythonHome=/data/user/0/org.ash_eesh.helloworld/files/python/stdlib 06-09 20:32:38.057 3295 3295 D MainActivity: setPythonEnvVars() complete 06-09 20:32:38.548 3295 3295 D MainActivity: Python.init() complete 06-09 20:32:38.548 3295 3295 D MainActivity: Python.run() start 06-09 20:32:39.415 3295 3295 D MainActivity: Python.run() end 06-09 20:32:39.416 3295 3295 D MainActivity: startPython() end 06-09 20:32:39.416 3295 3295 D MainActivity: user code onCreate() start 06-09 20:32:39.417 3295 3295 D MainActivity: user code onCreate() complete 06-09 20:32:39.417 3295 3295 D MainActivity: onCreate() complete 06-09 20:32:39.418 3295 3295 D MainActivity: onStart() start 06-09 20:32:39.419 3295 3295 D MainActivity: onStart() complete 06-09 20:32:39.419 3295 3295 D MainActivity: onResume() start 06-09 20:32:39.419 3295 3295 D MainActivity: onResume() complete
Second run
06-09 20:33:13.785 3330 3330 D MainActivity: onCreate() start 06-09 20:33:13.794 3330 3330 D MainActivity: onCreate(): captured stdout/stderr 06-09 20:33:13.906 3330 3330 D MainActivity: Skipping unpack of Python stdlib due to cache hit on stdlib/pythonhome.45634126ed5191759396ff4c15e92d8a7f2b18bf474d8e741ae6f1d10733de92.x86_64.zip 06-09 20:33:13.906 3330 3330 D MainActivity: Unpacking rubicon-java to /data/user/0/org.ash_eesh.helloworld/files/python/rubicon-java 06-09 20:33:13.959 3330 3330 D MainActivity: Unpacking Python assets to base dir /data/user/0/org.ash_eesh.helloworld/files/python/user_code 06-09 20:33:16.123 3330 3330 D MainActivity: unpackPython() complete 06-09 20:33:16.123 3330 3330 D MainActivity: setPythonEnvVars() start 06-09 20:33:16.123 3330 3330 V MainActivity: pythonHome=/data/user/0/org.ash_eesh.helloworld/files/python/stdlib 06-09 20:33:16.123 3330 3330 D MainActivity: setPythonEnvVars() complete 06-09 20:33:16.632 3330 3330 D MainActivity: Python.init() complete 06-09 20:33:16.632 3330 3330 D MainActivity: Python.run() start 06-09 20:33:17.571 3330 3330 D MainActivity: Python.run() end 06-09 20:33:17.571 3330 3330 D MainActivity: startPython() end 06-09 20:33:17.571 3330 3330 D MainActivity: user code onCreate() start 06-09 20:33:17.571 3330 3330 D MainActivity: user code onCreate() complete 06-09 20:33:17.571 3330 3330 D MainActivity: onCreate() complete 06-09 20:33:17.572 3330 3330 D MainActivity: onStart() start 06-09 20:33:17.572 3330 3330 D MainActivity: onStart() complete 06-09 20:33:17.572 3330 3330 D MainActivity: onResume() start 06-09 20:33:17.573 3330 3330 D MainActivity: onResume() complete
(If you think this is slow, note that my computer is doing other stuff, too. Just trying to highlight the Skipping unpack the second time.)
Skipping unpack
Underlying issue:
I was relying on java.nio.file.Files.newBufferedReader , which per https://developer.android.com/reference/java/nio/file/Files#newBufferedReader(java.nio.file.Path) is available starting in API level 26.
I'm legitimately confused as to why
minSdkVersion
didn't catch this (???), but OK.Testing done:
Created API 23 x86_64 Android Virtual Device
Rebuilt the app with this template
Validated that it launches twice, and successfully prints things about cache miss & hit respectively
First run:
Second run
(If you think this is slow, note that my computer is doing other stuff, too. Just trying to highlight the
Skipping unpack
the second time.)