小编rob*_*o06的帖子

使用chrisjenx时的InflateException CalligraphyLayoutInflater,android.view.InflateException

嗨所以在我们的项目中我们使用书法库,它没有任何问题,但现在在我添加的其中一个活动中,它与以下堆栈跟踪一起崩溃:

01-23 02:25:32.178 3654-3654/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example, PID: 3654
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example/com.example.activities.MultipleActivity}: android.view.InflateException: Binary XML file line #98: Error inflating class com.example.components.WLayout
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
    at android.app.ActivityThread.access$800(ActivityThread.java:135)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:136)
    at android.app.ActivityThread.main(ActivityThread.java:5017)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
    at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #98: Error inflating class com.example.components.WLayout
    at android.view.LayoutInflater.createView(LayoutInflater.java:621)
    at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.createCustomViewInternal(CalligraphyLayoutInflater.java:211)
    at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.access$000(CalligraphyLayoutInflater.java:20)
    at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater$PrivateWrapperFactory2.onCreateView(CalligraphyLayoutInflater.java:302)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:690)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:756)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:759) …
Run Code Online (Sandbox Code Playgroud)

android android-layout android-inflate calligraphy

6
推荐指数
1
解决办法
1561
查看次数

Bash脚本错误地计数了自己的实例

我创建了一个bash脚本,该脚本计算了自身启动的实例。

在这里(在此示例中,我显示的是实例,而不是用进行计数wc -l):

#!/bin/bash
nb=`ps -aux | grep count_itself.sh`
echo "$nb"
sleep 20
Run Code Online (Sandbox Code Playgroud)

(当然,我的脚本名为count_itself.sh

执行它后,我希望它返回两行,但返回三行:

root@myserver:/# ./count_itself.sh
root    16225   0.0 0.0 12400   1176 pts/0  S+  11:46   0:00    /bin/bash ./count_itself.sh
root    16226   0.0 0.0 12408   564 pts/0   S+  11:46   0:00    /bin/bash ./count_itself.sh
root    16228   0.0 0.0 11740   932 pts/0   S+  11:46   0:00    grep count_itself.sh
Run Code Online (Sandbox Code Playgroud)

&标志(即在后台执行)并手动执行该ps -aux位时,它返回两个,这是我想要的:

root@myserver:/# ./count_itself.sh &
[1] 16233
root@myserver:/# ps -aux | grep count_itself.sh
root     16233  0.0  0.0 …
Run Code Online (Sandbox Code Playgroud)

linux bash grep ps

4
推荐指数
1
解决办法
148
查看次数

告诉作曲家使用哪个PHP版本

我有两个运行php7.0和5.6的项目.现在php cli的默认版本是7.0.我需要在项目5.6上运行composer-update,但是作曲家正在阅读php7.0,所以它会抛出一个错误,因为有些功能只在5.6中兼容.有没有办法告诉作曲家在composer-install和composer-update期间使用哪个版本而不更改默认的php-cli?

php linux composer-php

2
推荐指数
1
解决办法
2912
查看次数