Can't succesfully use Shinobi for Android developing on Linux/Mac


#1

Hi,

I’m having a serious yet weird problem. I’m developing an application with Shinobi on my win8.1 machine and it all works fine.

Whenever my colleagues (Ubuntu and MacOS X) check it out and run it, or if I build the apk with Jenkins (Ubuntu), whenever we get to the screen with the chart, the application crashes with the following error:

E/AndroidRuntime(1145): FATAL EXCEPTION: main
E/AndroidRuntime(1145): Process: com.myapp.dev, PID: 1145
E/AndroidRuntime(1145): android.view.InflateException: Binary XML file line #59: Error inflating class com.shinobicontrols.charts.ChartView
E/AndroidRuntime(1145): at android.view.LayoutInflater.createView(LayoutInflater.java:620)
E/AndroidRuntime(1145): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
E/AndroidRuntime(1145): at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
E/AndroidRuntime(1145): at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
E/AndroidRuntime(1145): at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
E/AndroidRuntime(1145): at android.view.LayoutInflater.inflate(LayoutInflater.java:462)
E/AndroidRuntime(1145): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
E/AndroidRuntime(1145): at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
E/AndroidRuntime(1145): at com.myapp.dev.detail.ChartDetail.<init>(ChartDetail.java:56)
E/AndroidRuntime(1145): at android.os.Handler.handleCallback(Handler.java:733)
E/AndroidRuntime(1145): at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime(1145): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(1145): at android.app.ActivityThread.main(ActivityThread.java:5001)
E/AndroidRuntime(1145): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(1145): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(1145): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
E/AndroidRuntime(1145): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
E/AndroidRuntime(1145): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(1145): Caused by: java.lang.reflect.InvocationTargetException
E/AndroidRuntime(1145): at java.lang.reflect.Constructor.constructNative(Native Method)
E/AndroidRuntime(1145): at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
E/AndroidRuntime(1145): at android.view.LayoutInflater.createView(LayoutInflater.java:594)
E/AndroidRuntime(1145): ... 18 more
E/AndroidRuntime(1145): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load shinobicharts-android from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.myapp.dev-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.myapp.dev-2, /vendor/lib, /system/lib]]]: findLibrary returned null
E/AndroidRuntime(1145): at java.lang.Runtime.loadLibrary(Runtime.java:358)
E/AndroidRuntime(1145): at java.lang.System.loadLibrary(System.java:526)
E/AndroidRuntime(1145): at com.shinobicontrols.charts.AnimationManager.<clinit>(SourceFile:7)
E/AndroidRuntime(1145): at com.shinobicontrols.charts.y.<init>(SourceFile:34)
E/AndroidRuntime(1145): at com.shinobicontrols.charts.bu.<init>(SourceFile:20)
E/AndroidRuntime(1145): at com.shinobicontrols.charts.a.a(SourceFile:28)
E/AndroidRuntime(1145): at com.shinobicontrols.charts.x.n(SourceFile:150)
E/AndroidRuntime(1145): at com.shinobicontrols.charts.x.a(SourceFile:137)
E/AndroidRuntime(1145): at com.shinobicontrols.charts.w.c(SourceFile:166)
E/AndroidRuntime(1145): at com.shinobicontrols.charts.w.<init>(SourceFile:110)
E/AndroidRuntime(1145): at com.shinobicontrols.charts.cb.<init>(SourceFile:18)
E/AndroidRuntime(1145): at com.shinobicontrols.charts.ChartView.a(SourceFile:87)
E/AndroidRuntime(1145): at com.shinobicontrols.charts.ChartViewBase.<init>(SourceFile:16)
E/AndroidRuntime(1145): at com.shinobicontrols.charts.ChartView.<init>(SourceFile:82)
E/AndroidRuntime(1145): at com.shinobicontrols.charts.ChartView.<init>(SourceFile:61)
E/AndroidRuntime(1145): ... 21 more

Shinobi is imported as a project, in this scenario. If instead we copy everything from libs/ and values/ into our project, we get the following:

E/AndroidRuntime(4594): android.view.InflateException: Binary XML file line #204: Error inflating class com.shinobicontrols.charts.ChartView
E/AndroidRuntime(4594): at android.view.LayoutInflater.createView(LayoutInflater.java:620)
E/AndroidRuntime(4594): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
E/AndroidRuntime(4594): at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
E/AndroidRuntime(4594): at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
E/AndroidRuntime(4594): at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
E/AndroidRuntime(4594): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
E/AndroidRuntime(4594): at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
E/AndroidRuntime(4594): at com.myapp.dev.detail.ChartDetail.<init>(ChartDetail.java:56)
E/AndroidRuntime(4594): at android.os.Handler.handleCallback(Handler.java:733)
E/AndroidRuntime(4594): at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime(4594): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(4594): at android.app.ActivityThread.main(ActivityThread.java:5001)
E/AndroidRuntime(4594): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(4594): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(4594): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
E/AndroidRuntime(4594): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
E/AndroidRuntime(4594): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(4594): Caused by: java.lang.reflect.InvocationTargetException
E/AndroidRuntime(4594): at java.lang.reflect.Constructor.constructNative(Native Method)
E/AndroidRuntime(4594): at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
E/AndroidRuntime(4594): at android.view.LayoutInflater.createView(LayoutInflater.java:594)
E/AndroidRuntime(4594): ... 17 more
E/AndroidRuntime(4594): Caused by: java.lang.NoClassDefFoundError: com.shinobicontrols.charts.R$styleable
E/AndroidRuntime(4594): at com.shinobicontrols.charts.cu.a(SourceFile:850)
E/AndroidRuntime(4594): at com.shinobicontrols.charts.cu.a(SourceFile:126)
E/AndroidRuntime(4594): at com.shinobicontrols.charts.w.<init>(SourceFile:102)
E/AndroidRuntime(4594): at com.shinobicontrols.charts.cb.<init>(SourceFile:18)
E/AndroidRuntime(4594): at com.shinobicontrols.charts.ChartView.a(SourceFile:87)
E/AndroidRuntime(4594): at com.shinobicontrols.charts.ChartViewBase.<init>(SourceFile:16)
E/AndroidRuntime(4594): at com.shinobicontrols.charts.ChartView.<init>(SourceFile:82)
E/AndroidRuntime(4594): at com.shinobicontrols.charts.ChartView.<init>(SourceFile:61)

So, my two questions are: “why does this happen?” and “why does it work only on windows?”.


#2

Hi.

We have already resolved this issue directly via our CRM system but I thought I would post a summary for anyone else who maybe browsing, who is experiencing the same issue:

In this case the problem was with the .so files not being present. SVN was ignoring the .so files - manually adding and committing each file resolved this issue. Without the .so files the charts cannot draw as these form part of the Open GL implementation.

It’s worth making sure that your version control system is configured to include .so files.

It’s also worth noting that the R files have to be generated from the XML resources supplied in the download bundle. This is why our library needs to be imported as an Android Library project. The second error reported here usually occurs when the R files have not been built. A simple clean in Eclipse usually resolves this issue.

Thanks.

Kai.