Closed jidma closed 7 years ago
I tried adding this to bugvm.xml:
<skipRuntimeLib>false</skipRuntimeLib>
<cacerts>full</cacerts>
but it didn't help.
I also tried setting BUGVM_HOME
with no better luck:
$ echo $BUGVM_HOME
/Users/me/.m2/repository/com/bugvm/bugvm-dist/1.2.3-SNAPSHOT/unpacked/bugvm-1.2.3-SNAPSHOT/
$ find $BUGVM_HOME
/Users/user/.m2/repository/com/bugvm/bugvm-dist/1.2.3-SNAPSHOT/unpacked/bugvm-1.2.3-SNAPSHOT/
/Users/user/.m2/repository/com/bugvm/bugvm-dist/1.2.3-SNAPSHOT/unpacked/bugvm-1.2.3-SNAPSHOT//bin
/Users/user/.m2/repository/com/bugvm/bugvm-dist/1.2.3-SNAPSHOT/unpacked/bugvm-1.2.3-SNAPSHOT//bin/bugvm
/Users/user/.m2/repository/com/bugvm/bugvm-dist/1.2.3-SNAPSHOT/unpacked/bugvm-1.2.3-SNAPSHOT//bin/bugvm-device
/Users/user/.m2/repository/com/bugvm/bugvm-dist/1.2.3-SNAPSHOT/unpacked/bugvm-1.2.3-SNAPSHOT//bin/bugvm-sim
/Users/user/.m2/repository/com/bugvm/bugvm-dist/1.2.3-SNAPSHOT/unpacked/bugvm-1.2.3-SNAPSHOT//lib
/Users/user/.m2/repository/com/bugvm/bugvm-dist/1.2.3-SNAPSHOT/unpacked/bugvm-1.2.3-SNAPSHOT//lib/bugvm-apple.jar
/Users/user/.m2/repository/com/bugvm/bugvm-dist/1.2.3-SNAPSHOT/unpacked/bugvm-1.2.3-SNAPSHOT//lib/bugvm-cacerts.jar
/Users/user/.m2/repository/com/bugvm/bugvm-dist/1.2.3-SNAPSHOT/unpacked/bugvm-1.2.3-SNAPSHOT//lib/bugvm-compiler.jar
/Users/user/.m2/repository/com/bugvm/bugvm-dist/1.2.3-SNAPSHOT/unpacked/bugvm-1.2.3-SNAPSHOT//lib/bugvm-rt.jar
/Users/user/.m2/repository/com/bugvm/bugvm-dist/1.2.3-SNAPSHOT/unpacked/bugvm-1.2.3-SNAPSHOT//lib/vm
/Users/user/.m2/repository/com/bugvm/bugvm-dist/1.2.3-SNAPSHOT/unpacked/bugvm-1.2.3-SNAPSHOT//lib/vm/ios
..etc..
There are at least two possible issues I see.
SNAPSHOT was not published correctly to maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }: solution for this -> I did publish 1.2.3-SNAPSHOT again, It should be ok now. Also you could build and publish locally to your /Users/user/.m2/repository with ./gradlew install
or ./gradlew publishToMavenLocal
For project dependencies, you will need
dependencies {
compile "com.bugvm:bugvm-apple:${bugVMVersion}"
compile "com.bugvm:bugvm-rt:${bugVMVersion}"
compile "my.project:XX-Core:1.0.0"
}
bugvm-dist
should not be used as dependencies, it will be used internally by bugvm-gradle
plugin.
Thanks for the reply.
I cleaned my local repository from all bugvm files with version 1.2.3-SNAPSHOT
.
I cleared the previously set environnement variable.
I fixed the dependencies in the build.gradle
.
I launched:
./gradlew clean build launchIPhoneSimulator -d -s
and got this error this time:
Caused by: java.io.IOException: Cannot run program "/Users/user/.m2/repository/com/bugvm/bugvm-dist/1.2.3-SNAPSHOT/unpacked/bugvm-1.2.3-SNAPSHOT/bin/bugvm-sim" (in directory "."): error=2, No such file or directory
here are the contents of my repository at this location:
/Users/user/.m2/repository/com/bugvm/bugvm-dist/1.2.3-SNAPSHOT/unpacked/bugvm-1.2.3-SNAPSHOT/bin$ ls -ltr
total 184
-rwxr-xr-x 1 user staff 380 Nov 18 22:08 bugvm
-rwxr-xr-x 1 user staff 14160 Dec 13 10:17 idevicesyslog
-rwxr-xr-x 1 user staff 38380 Dec 13 10:17 ideviceinstaller
-rwxr-xr-x 1 user staff 19796 Dec 13 10:17 idevicedebug
-rwxr-xr-x 1 user staff 9316 Dec 13 18:27 idevice_id
am I missing something else?
Thank you again.
I reverted back to 1.2.2-SNAPSHOT and went back to square one: bugvm-sim
is found this time but I have the bugvm-rt.jar missing from the boot/lib directory.
Previous 1.2.*.SNAPSHOT
in maven repo seem to be broken due to my incorrect publishing.
Let's focus on 1.2.3-SNAPSHOT
.
Caused by: java.io.IOException: Cannot run program "/Users/user/.m2/repository/com/bugvm/bugvm-dist/1.2.3-SNAPSHOT/unpacked/bugvm-1.2.3-SNAPSHOT/bin/bugvm-sim" (in directory "."): error=2, No such file or directory
Indeed, bugvm-sim
has been removed in 1.2.3-SNAPSHOT
as its functions are merged into bugvm-compiler.jar
. As a result, 1.2.3-SNAPSHOT
should not have any references to bugvm-sim
. I am wondering how you get the error message in the first place.
here's the whole console output if that could help
I cleaned my maven repository before hand. The files has been re-downloaded.
Nevermind, I just retried using launchIOSDevice
and back to launchIPhoneSimulator
task and it compiled fine. It must have something to do with gradle cache or something.
But i still have the same error:
PathClassLoader: can't find '/private/var/containers/Bundle/Application/3FFBECB9-E614-4222-9B23-DB6017ABF227/MyApp.app/lib/boot/bugvm-rt.jar'
PathClassLoader: can't find '/private/var/containers/Bundle/Application/3FFBECB9-E614-4222-9B23-DB6017ABF227/MyApp.app/lib/boot/bugvm-cacerts.jar'
just before a retrofit.OkHttpCall
:
STACK : com.squareup.okhttp.OkHttpClient.getDefaultSSLSocketFactory @ -1
STACK : com.squareup.okhttp.OkHttpClient.copyWithDefaults @ -1
STACK : com.squareup.okhttp.Call.<init> @ -1
STACK : com.squareup.okhttp.OkHttpClient.newCall @ -1
STACK : retrofit.OkHttpCall.createRawCall @ -1
STACK : retrofit.OkHttpCall.enqueue @ -1
IDEA plugin 1.1.19-SNAPSHOT do generate lib/boot/bugvm-rt.jar. Can you please confirm it work?
Download and install idea plugin to either BugVM Studio 1.1.10-SNAPSHOT or Android Studio 2.2.3.
https://github.com/bugvm/bugvm/releases/download/bugvm-1.1.19-SNAPSHOT/bugvm-idea-1.1.19-SNAPSHOT-plugin-dist.jar
Set BugVM Version in your build.gradle
bugVMVersion = "1.1.19-SNAPSHOT"
Compile and launch using IDE.
IDEA plugin outputs to build-bugvm
I wrote the bellow text as I was proceeding step by step, didn't know whether it would work or not while typing
/SampleBugVMApp/build-bugvm$ find . -name *.jar ./tmp/sim-iphone6/ios/x86_64/Main.app/lib/boot/bugvm-rt.jar ./tmp/sim-iphone6/ios/x86_64/Main.app/lib/bugvm-apple.jar ./tmp/sim-iphone6/ios/x86_64/Main.app/lib/bugvm-cacerts.jar ./tmp/sim-iphone6/ios/x86_64/Main.app/lib/bugvm-compiler.jar ./tmp/sim-iphone6/ios/x86_64/Main.app/lib/classes0.jar
Cool. Please use IDEA plugin 1.1.19-SNAPSHOT for a while. I will come back later when I have more time and continue to investigate gradle plugin further.
Thank you.
Please let me know if you need a minimal working project on 1.1.19 that doesn't work on 1.2.3.
That's very nice of you. I appreciate it.
Here's a minimal project :
Everything is fine. Device log:
Dec 16 21:08:55 MacBook-Pro-de-Majid Main[46440]: before service
Dec 16 21:08:55 MacBook-Pro-de-Majid Main[46440]: -->getClient
Dec 16 21:08:55 MacBook-Pro-de-Majid Main[46440]: Loading class 'java.util.logging.ConsoleHandler' failed
Dec 16 21:08:55 MacBook-Pro-de-Majid Main[46440]: java.lang.ClassNotFoundException: java.util.logging.ConsoleHandler
Dec 16 21:08:55 MacBook-Pro-de-Majid Main[46440]: builder
Dec 16 21:08:55 MacBook-Pro-de-Majid Main[46440]: gson
Dec 16 21:08:55 MacBook-Pro-de-Majid Main[46440]: client
Dec 16 21:08:55 MacBook-Pro-de-Majid Main[46440]: <--getClient
Dec 16 21:08:55 MacBook-Pro-de-Majid Main[46440]: after service
Dec 16 21:08:55 MacBook-Pro-de-Majid Main[46440]: after call
Dec 16 21:08:56 MacBook-Pro-de-Majid Main[46440]: on response retrofit.Response@17df5900
./gradlew clean build launchIPhoneSimulator -d -s
After clicking on the "click me" button, it gives the following log:
Dec 16 22:25:40 MacBook-Pro-de-Majid Main[46645]: before service
Dec 16 22:25:40 MacBook-Pro-de-Majid Main[46645]: -->getClient
Dec 16 22:25:40 MacBook-Pro-de-Majid Main[46645]: PathClassLoader: can't find '/Users/majidlaissi/Library/Developer/CoreSimulator/Devices/9B17EF2E-B57E-4745-988F-91722E86F13D/data/Containers/Bundle/Application/25F8BF3F-9776-49E8-B2FD-6E0D85E2413E/Main.app/lib/boot/bugvm-rt.jar'
Dec 16 22:25:40 MacBook-Pro-de-Majid Main[46645]: PathClassLoader: can't find '/Users/majidlaissi/Library/Developer/CoreSimulator/Devices/9B17EF2E-B57E-4745-988F-91722E86F13D/data/Containers/Bundle/Application/25F8BF3F-9776-49E8-B2FD-6E0D85E2413E/Main.app/lib/boot/bugvm-cacerts.jar'
Dec 16 22:25:40 MacBook-Pro-de-Majid Main[46645]: builder
Dec 16 22:25:40 MacBook-Pro-de-Majid Main[46645]: gson
Dec 16 22:25:40 MacBook-Pro-de-Majid Main[46645]: client
Dec 16 22:25:40 MacBook-Pro-de-Majid Main[46645]: <--getClient
Dec 16 22:25:40 MacBook-Pro-de-Majid Main[46645]: after service
Dec 16 22:25:40 MacBook-Pro-de-Majid Main[46645]: after call
Dec 16 22:25:40 MacBook-Pro-de-Majid Main[46645]: java.io.FileNotFoundException: /Users/majidlaissi/Library/Developer/CoreSimulator/Devices/9B17EF2E-B57E-4745-988F-91722E86F13D/data/Containers/Bundle/Application/25F8BF3F-9776-49E8-B2FD-6E0D85E2413E/Main.app/lib/logging.properties: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java)
at java.io.FileInputStream.<init>(FileInputStream.java)
at java.io.FileInputStream.<init>(FileInputStream.java)
at java.util.logging.LogManager.readConfiguration(LogManager.java)
at java.util.logging.LogManager.<clinit>(LogManager.java)
at java.util.logging.Logger.getLogger(Logger.java)
at com.squareup.okhttp.internal.Internal.<clinit>(Internal.java)
at com.squareup.okhttp.OkHttpClient.<clinit>(OkHttpClient.java)
at com.mycompany.myapp.MyViewController.getClient(MyViewController.java)
at com.mycompany.myapp.MyViewController.access$200(MyViewController.java)
at com.mycompany.myapp.MyViewController$1.onTouchUpInside(MyViewController.java)
at com.bugvm.apple.uikit.UIControl$ListenerWrapper.handleTouchEvent(UIControl.java)
at com.bugvm.apple.uikit.UIControl$ListenerWrapper.$cb$handleTouchEvent(UIControl.java)
at com.bugvm.apple.uikit.UIApplication.main(Native Method)
at com.bugvm.apple.uikit.UIApplication.main(UIApplication.java)
at com.mycompany.myapp.Main.main(Main.java)Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory) at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java)
... 16 more
PathClassLoader: can't find '/Users/majidlaissi/Library/Developer/CoreSimulator/Devices/9B17EF2E-B57E-4745-988F-91722E86F13D/data/Containers/Bundle/Application/25F8BF3F-9776-49E8-B2FD-6E0D85E2413E/Main.app/lib/boot/bugvm-rt.jar'
Dec 16 22:25:40 MacBook-Pro-de-Majid Main[46645]: PathClassLoader: can't find '/Users/majidlaissi/Library/Developer/CoreSimulator/Devices/9B17EF2E-B57E-4745-988F-91722E86F13D/data/Containers/Bundle/Application/25F8BF3F-9776-49E8-B2FD-6E0D85E2413E/Main.app/lib/boot/bugvm-cacerts.jar'
Dec 16 22:25:40 MacBook-Pro-de-Majid Main[46645]: on failure java.lang.AssertionError
reproduced the issues.
now the issue has been resolved with 1.2.3-SNAPSHOT.
After launching with gradle plugin 1.2.3
./gradlew build launchIPhoneSimulator
, I have the following error in my device / simulator log:Same problem with
launchIOSDevice
.Here is the content of my project after the build:
My project's build.gradle:
Any idea how to get the compiler to put the
rt
andcacert
libraries inlib/boot
, or why is it looking for them there in the first place?Thank you
PS1: the application starts correctly, and the cacert files are needed only when it tries to connect to the internet for the first time
com.squareup.okhttp.OkHttpClient.getDefaultSSLSocketFactory
.PS2: the same code used to work fine in previous bugvm versions (1.1.4) and in previous iOS version (9).