小编Ric*_*hez的帖子

附加调试器有时会导致应用程序崩溃

我正在开发一个Android应用程序,有时在将调试器附加到正在运行的应用程序时,一段时间后会导致它崩溃.堆栈跟踪如下.我应该提一下,我正在手机中运行N预览.

A/art: art/runtime/runtime.cc:403] Runtime aborting...
A/art: art/runtime/runtime.cc:403] Aborting thread:
A/art: art/runtime/runtime.cc:403] "Jit thread pool worker thread 0" prio=5 tid=2 WaitingForDebuggerSend (still starting up)
A/art: art/runtime/runtime.cc:403]   | group="" sCount=0 dsCount=0 obj=0x0 self=0x6fc6479a00
A/art: art/runtime/runtime.cc:403]   | sysTid=18309 nice=9 cgrp=default sched=0/0 handle=0x6fcd607450
A/art: art/runtime/runtime.cc:403]   | state=R schedstat=( 4712207454 2665438173 3474 ) utm=390 stm=80 core=5 HZ=100
A/art: art/runtime/runtime.cc:403]   | stack=0x6fcd509000-0x6fcd50b000 stackSize=1021KB
A/art: art/runtime/runtime.cc:403]   | held mutexes= "abort lock"
A/art: art/runtime/runtime.cc:403]   native: #00 pc 0000000000479ebc  /system/lib64/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+220)
A/art: art/runtime/runtime.cc:403]   native: #01 pc 0000000000479eb8  /system/lib64/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+216) …
Run Code Online (Sandbox Code Playgroud)

debugging android

20
推荐指数
1
解决办法
4747
查看次数

TextView具有lineSpacing时的ImageSpan.ALIGN_BASELINE

我想将我ImageSpan的文本基线对齐,但我还需要在行之间添加一些间距.
问题是,当我添加行间距时,ImageSpan它不会与文本的基线对齐,而是与文本的基线对齐baseline+lineSpacing,因此它看起来比它应该低.

这有解决方法吗?

编辑:进一步说明:

  1. 没有 它的样子lineSpacing(箭头是ImageSpan).它与基线正确对齐.
    在此输入图像描述

  2. 如果我添加,它看起来如何 android:lineSpacingMulitiplier="1.2"
    在此输入图像描述

编辑2代码:
XML:

<com.kushtrim.example.views.CustomTypefaceTextView
    android:id="@+id/descId"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:lines="3"
    android:gravity="center_vertical"
    android:layout_marginLeft="@dimen/_45"
    android:layout_marginTop="@dimen/_6"
    android:layout_marginBottom="@dimen/_20"
    app:font_type="merriweather_regular"
    android:textSize="@dimen/f40"
    android:lineSpacingMultiplier="1.2"
    android:textColor="@color/black"
    android:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
    android:ellipsize="end" />
Run Code Online (Sandbox Code Playgroud)

其他相关方法:

    private Spannable getContentText(ContactRaport contactRaport) {
    DateTime dateTime = new DateTime(contactRaport.contactDate);

    String datePart = dateTime.getDayOfMonth() + " " + dateTime.monthOfYear().getAsShortText(new Locale("nl")) + "; ";
    String completeText = datePart + contactRaport.note;

    Typeface font1 = Typeface.createFromAsset(context.getAssets(), "MyFont1.ttf"); …
Run Code Online (Sandbox Code Playgroud)

android textview imagespan

8
推荐指数
1
解决办法
1785
查看次数

(a | b)*与a*| b*相同吗?

(a|b)*一样的a*|b*吗?换句话说,(a|b)*接受字符串是as和bs的组合吗?

regex regex-alternation

7
推荐指数
2
解决办法
3118
查看次数

如何解密用Laravel中的Crypt加密的Java(Android)文本?

我需要解密从服务器收到的一些数据,并且制作API的程序员将我引导到此Encrypter类,以查看他用于加密的内容.

现在基于该类,我发现使用的算法是AES128 CBC,我收到的字符串是Base64编码的,包含其他数据,而不仅仅是密文.

即,如果我收到以下字符串:

eyJpdiI6InJsSzRlU3pDZTBBUVNwMzdXMjVcL0tBPT0iLCJ2YWx1ZSI6Ik5JOENsSVVWaWk2RGNhNlwvWjJNeG94UzVkclwvMGJOREQreWUyS1UzclRMND0iLCJtYWMiOiJhZTZkYjNkNGM2ZTliNmU0ZTc0MTRiNDBmMzFlZTJhNTczZWIxMjk4N2YwMjlhODA1NTIyMDEzODljNDY2OTk2In0
Run Code Online (Sandbox Code Playgroud)

在base64解码后我得到:

{"iv":"rlK4eSzCe0AQSp37W25\/KA==","value":"NI8ClIUVii6Dca6\/Z2MxoxS5dr\/0bNDD+ye2KU3rTL4=","mac":"ae6db3d4c6e9b6e4e7414b40f31ee2a573eb12987f029a80552201389c466996"}
Run Code Online (Sandbox Code Playgroud)

基于line 99Encrypter类(iv = base64_decode($payload['iv']);),I执行另一解码的base64上ivvalue,并得到了一个iv长度为16的那些我作为参数下面的函数传递的:

    public static String decrypt(String iv, String encryptedData) throws Exception {
    byte[] keyValue = "zy2dEd1pKG5i3WuWbvOBolFQR84AYbvN".getBytes();
    Key key = new SecretKeySpec(keyValue, "AES");        
    Cipher c = Cipher.getInstance("AES/CBC/PKCS7Padding");
    c.init(Cipher.DECRYPT_MODE, key, new IvParameterSpec(iv.getBytes()));
    byte[] decordedValue = Base64.decode(encryptedData.getBytes(), Base64.DEFAULT);
    byte[] decValue = c.doFinal(decordedValue);
    return new String(decValue);
}
Run Code Online (Sandbox Code Playgroud)

但是我收到以下错误:

10-06 19:13:33.601 12895-12895/? W/System.err: java.security.InvalidAlgorithmParameterException: expected IV length of 16
10-06 19:13:33.601 12895-12895/? …
Run Code Online (Sandbox Code Playgroud)

php java encryption android cryptography

5
推荐指数
1
解决办法
1929
查看次数

当其中一个模块使用Multidex时,在两个模块的运行配置之间切换而不使用Clean

在我的Android Studio项目中,我有几个模块,其中只有两个是应用程序模块(让我们称之为AB),其他模块是库模块,有些模块由AB使用.
对于模块A,启用multidex,而对于B,则不启用.

我遇到的问题是,当从一个配置(运行按钮旁边的下拉列表)切换,并运行另一个配置时,我总是会遇到一些错误.使其工作的唯一方法是完整的项目清洁.

当从A切换到B而没有干净时,我收到以下错误:

    UNEXPECTED TOP-LEVEL EXCEPTION:
java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:215)
    at java.util.zip.ZipFile.<init>(ZipFile.java:145)
    at java.util.zip.ZipFile.<init>(ZipFile.java:159)
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
    at com.android.dx.command.dexer.Main.processOne(Main.java:672)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:574)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
    at com.android.dx.command.dexer.Main.run(Main.java:277)
    at com.android.dx.command.dexer.Main.main(Main.java:245)
    at com.android.dx.command.Main.main(Main.java:106)
8 errors; aborting (all are similar to the one above, so I omitted them)
Error:Execution failed for task ':Bapp'.
> com.android.ide.common.process.ProcessException: …
Run Code Online (Sandbox Code Playgroud)

android android-studio android-multidex

5
推荐指数
1
解决办法
118
查看次数

在主线程中的断点处停止时,几秒钟后 ANR 崩溃(AOSP - RK3288 框)

我有一个 RK3288 盒子,我正在为它开发一个应用程序。

我遇到了一个让我很头疼的问题。我无法调试任何东西。
每次我附加调试器时,当我遇到主线程上的断点时,我的应用程序会在几秒钟后崩溃。以下是发生这种情况时的 logcat:

05-02 20:52:39.734 459-534/system_process I/InputDispatcher: Application is not responding: Window{3026b626 u0 com.kushtrim.playground/com.kushtrim.playground.MainActivity}.  It has been 5001.8ms since event, 5001.6ms since wait started.  Reason: Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago.  Wait queue length: 17.  Wait queue head age: 5505.1ms.
05-02 20:52:39.794 459-534/system_process I/WindowManagerService: Input event dispatching timed out sending to com.kushtrim.playground/com.kushtrim.playground.MainActivity.  Reason: Waiting to send non-key event because …
Run Code Online (Sandbox Code Playgroud)

debugging android android-source android-anr-dialog

5
推荐指数
2
解决办法
5438
查看次数