小编Jon*_*win的帖子

应用程序与本机代码崩溃

Crashed: .onlineradioapp|
0  gralloc.rk30board.so           0xb4a2d616 bool art::interpreter::DoCall<false, true>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)
1  gralloc.rk30board.so           0xb4a315c9 (Missing)
2  gralloc.rk30board.so           0xb48e2465 art::JValue art::interpreter::ExecuteGotoImpl<true, false>(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue)
3  gralloc.rk30board.so           0xb4a1349d artInterpreterToInterpreterBridge
4  gralloc.rk30board.so           0xb4a2d031 bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)
5  gralloc.rk30board.so           0xb48f2fef art::JValue art::interpreter::ExecuteGotoImpl<false, false>(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue)
6  gralloc.rk30board.so           0xb4a133dd artInterpreterToInterpreterBridge
7  gralloc.rk30board.so           0xb4a2d031 bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)
8  gralloc.rk30board.so           0xb48f2c1b art::JValue art::interpreter::ExecuteGotoImpl<false, false>(art::Thread*, art::DexFile::CodeItem …
Run Code Online (Sandbox Code Playgroud)

java-native-interface android android-ndk crashlytics .so

7
推荐指数
1
解决办法
500
查看次数

仅在27.0.2之后具有白屏的仿真器AVD

昨天我将模拟器更新到27.0.2,今天更新到27.0.3

https://developer.android.com/studio/releases/emulator.html

但是在27.0.2之后,任何版本的Android和Device的所有Emulator都会显示白屏.

我真的很绝望,我不知道怎么做.

白屏avd

白屏avd

更新今天

更新今天

macos android android-emulator

7
推荐指数
1
解决办法
613
查看次数

在Kotlin中使用@Parcelize Annotation的NoSuchMethodError

我目前正在尝试实验(这可能就是为什么它不起作用......)@Parcelize注释来生成Parcelable代码.大多数类型似乎工作正常,但我有问题Serializable抛出NoSuchMethodError:

   10-05 13:55:18.549 20808-20808/com.app E/AndroidRuntime: FATAL EXCEPTION: main
   Process: com.app, PID: 20808
   java.lang.NoSuchMethodError: No virtual method writeSerializable(Ljava/util/Date;)V in class Landroid/os/Parcel;
   or its super classes (declaration of 'android.os.Parcel' appears in /system/framework/framework.jar)
       at com.app.models.Job.writeToParcel(Job.kt)
       at android.os.Parcel.writeParcelable(Parcel.java:1496)
       at android.os.Parcel.writeValue(Parcel.java:1402)
       at android.os.Parcel.writeArrayMapInternal(Parcel.java:724)
       at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1408)
       at android.os.Bundle.writeToParcel(Bundle.java:1157)
       at android.os.Parcel.writeBundle(Parcel.java:764)
       at android.content.Intent.writeToParcel(Intent.java:8687)
       at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:3082)
       at android.app.Instrumentation.execStartActivity(Instrumentation.java:1518)
       at android.app.Activity.startActivityForResult(Activity.java:4225)
       at android.support.v4.app.BaseFragmentActivityApi16.startActivityForResult(BaseFragmentActivityApi16.java:54)
       at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:65)
       at android.app.Activity.startActivityForResult(Activity.java:4183)
       at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:711)
       at android.app.Activity.startActivity(Activity.java:4522)
       at android.app.Activity.startActivity(Activity.java:4490)
Run Code Online (Sandbox Code Playgroud)

我知道我可以通过将Date对象更改为字符串来解决这个问题,但不愿意.有没有其他人遇到这个问题,除了使用字符串之外,还可以提供一个可行的解决方法?

如果需要,这里是参考的实现:

@Parcelize
data class Job(val id: String, …
Run Code Online (Sandbox Code Playgroud)

android nosuchmethoderror parcelable kotlin kotlin-android-extensions

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

在远程服务器上运行/控制模拟器

我知道这不是一个适合SO的问题,但我没有其他地方可以问我希望在mods关闭这个问题之前我会得到一个答案!

所以我每天使用几个Android应用程序,这是非常耗时的.我想以某种方式自动化该过程.

我的想法是在服务器上安装某种模拟器,并通过某种编程语言对模拟器进行编程,以便在需要时在服务器上运行应用程序.

我是一个web开发者,我有工作PHP,nodejs,python,并不真正熟悉的移动空间,所以我想问问这里.

有什么解决方案可以做我想要的吗?我四处寻找并发现了Appium,但我不确定它是否能满足我的需求.

请注意,这些应用程序没有公共'api'供我使用.

此外,我只能通过'ssh terminal'远程访问服务器,因此具有'GUI'依赖性的解决方案对我不起作用.

mobile android appium

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

如何为Android开发人员切换动画?

我是一名设计师,并且对不同的方式感兴趣,我可以将动画移交给Android开发人员,并根据具体情况采取最佳方式.

1. JSON

我知道Lottie最适合动画微互动并创建动画插图,就像在入门页面上那样.对于设计人员来说,提供JSON文件很容易,因为它可以在AfterEffects中使用Bodymovin插件生成.开发人员只是获取文件并按原样使用它,不再为他做额外的努力.

2. Java或Kotlin

需要复杂交互的UI元素通常使用代码构建,如BubblePicker,因为它在这些气泡中具有可变内容,并且具有与其交互的不同条件.由于设计工具不能生成生产就绪的代码设计人员从诸如Principle之类的工具导出视频录制,因此可以在ProtoPie或其他工具中生成可点击的原型.设计师尝试不同的方式来展示动画的想法,但在这种情况下,所有的工作都留给了开发人员.

3. XML

不知道开发人员何时使用此类型,以及设计人员是否可以使用某些设计工具的导出来提供它.

开发人员用于创建动画的其他技术是什么?

设计师应该为考虑不同情况的开发人员提供什么类型的文件,原型?

animation android

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

Android Studio:找不到org.jacoco:org.jacoco.agent:org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated

我想添加JaCoCo到我AndroidSonar Qube报道。但是在运行命令时./gradlew jacocoTestReport,出现以下错误。

 Task :app:testAlphaReleaseUnitTest FAILED


 FAILURE: Build failed with an exception.
Run Code Online (Sandbox Code Playgroud)

出了什么问题

Could not resolve all files for configuration ':app:jacocoAgent'.
> Could not find org.jacoco:org.jacoco.agent:org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated.
  Searched in the following locations:
    - file:/Users/atif/Library/Android/sdk/extras/m2repository/org/jacoco/org.jacoco.agent/org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated/org.jacoco.agent-org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated.pom
    - file:/Users/atif/Library/Android/sdk/extras/m2repository/org/jacoco/org.jacoco.agent/org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated/org.jacoco.agent-org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated.421021a4
    - file:/Users/atif/Library/Android/sdk/extras/google/m2repository/org/jacoco/org.jacoco.agent/org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated/org.jacoco.agent-org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated.pom
    - file:/Users/atif/Library/Android/sdk/extras/google/m2repository/org/jacoco/org.jacoco.agent/org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated/org.jacoco.agent-org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated.421021a4
    - file:/Users/atif/Library/Android/sdk/extras/android/m2repository/org/jacoco/org.jacoco.agent/org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated/org.jacoco.agent-org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated.pom
    - file:/Users/atif/Library/Android/sdk/extras/android/m2repository/org/jacoco/org.jacoco.agent/org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated/org.jacoco.agent-org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated.421021a4
    - https://jcenter.bintray.com/org/jacoco/org.jacoco.agent/org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated/org.jacoco.agent-org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated.pom
    - https://jcenter.bintray.com/org/jacoco/org.jacoco.agent/org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated/org.jacoco.agent-org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated.421021a4
    - https://dl.google.com/dl/android/maven2/org/jacoco/org.jacoco.agent/org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated/org.jacoco.agent-org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated.pom
    - https://dl.google.com/dl/android/maven2/org/jacoco/org.jacoco.agent/org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated/org.jacoco.agent-org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated.421021a4
    - https://maven.fabric.io/public/org/jacoco/org.jacoco.agent/org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated/org.jacoco.agent-org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated.pom
    - https://maven.fabric.io/public/org/jacoco/org.jacoco.agent/org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated/org.jacoco.agent-org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated.421021a4
    - https://jcenter.bintray.com/org/jacoco/org.jacoco.agent/org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated/org.jacoco.agent-org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated.pom
    - https://jcenter.bintray.com/org/jacoco/org.jacoco.agent/org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated/org.jacoco.agent-org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated.421021a4
    - https://maven.fabric.io/public/org/jacoco/org.jacoco.agent/org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated/org.jacoco.agent-org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated.pom
    - https://maven.fabric.io/public/org/jacoco/org.jacoco.agent/org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated/org.jacoco.agent-org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated.421021a4
    - https://dl.google.com/dl/android/maven2/org/jacoco/org.jacoco.agent/org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated/org.jacoco.agent-org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated.pom
    - https://dl.google.com/dl/android/maven2/org/jacoco/org.jacoco.agent/org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated/org.jacoco.agent-org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated.421021a4
    - https://repo.maven.apache.org/maven2/org/jacoco/org.jacoco.agent/org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated/org.jacoco.agent-org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated.pom
    - https://repo.maven.apache.org/maven2/org/jacoco/org.jacoco.agent/org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated/org.jacoco.agent-org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated.421021a4 …
Run Code Online (Sandbox Code Playgroud)

android gradle jacoco sonarqube

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

将始终可见的聊天头的LayoutParams更改为不总是可见

我试图添加一个我通过服务生成的视图.我使用的代码基于Facebook Chatheads,无论应用程序状态如何,它们始终可见.它们也显示在其他任何东西上面:

在此输入图像描述 Android聊天头

我现在希望将聊天头限制在活动应用程序中.具体来说,每当我将Window.LayoutParams从TYPE_PHONE更改为TYPE_DRAWN_APPLICATION时,我正在处理Bad Token异常.

我的问题:我知道我需要将正确的窗口令牌传递给LayoutParams,但似乎无法弄清楚如何正确执行此操作.任何建议都将受到高度赞赏.

这是我的代码:

//主要活动

private void addNewBubble() {
        BubbleLayout bubbleView = (BubbleLayout)LayoutInflater.from(MainActivity.this).inflate(R.layout.bubble_layout, null);
        bubblesManager.addBubble(bubbleView, 60, 20);
}

// initializes Bubbles Manager
private void initializeBubblesManager() {
        bubblesManager = new BubblesManager.Builder(this)
                .setTrashLayout(R.layout.task_bubble_trash_layout)
                .setInitializationCallback(new OnInitializedCallback() {
                    @Override
                    public void onInitialized() {
                        addNewBubble(); // Called when addNewBubble is initialized and the bubble data is loaded. When used on devices running API 18 or below, this function is always called.

                    }
                })
                .build();
        bubblesManager.initialize();
    }

// initializes Bubbles Manager
        private …
Run Code Online (Sandbox Code Playgroud)

service layout android token android-layoutparams

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

如何在 kotlin (locale) 中更改语言

我有 2 个字符串文件“en”和“tr”。当我更改电话的语言字符串文件时会自动更改(我没有为此结果编写额外的代码,我不知道这是怎么发生的)。我想以编程方式更改字符串文件。我使用了这个代码。我收到 Toast 消息,但语言没有改变。为什么?我之前将这些代码用于另一个应用程序,该应用程序是用 java 而不是 Kotlin 编写的,并且这些代码工作正常。请不要说重复,因为我阅读了很多问题。我尝试了很多东西,直到现在 4 小时。

override fun onResume() {

        buttonDate()
        changeLanguage()
    super.onResume()
    }
fun changeLanguage(){
        val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(applicationContext)
        val language = sharedPreferences.getString("language","bak")
        Toast.makeText(applicationContext,language,Toast.LENGTH_SHORT).show()
        if(language=="English"){
            Toast.makeText(applicationContext,"English",Toast.LENGTH_SHORT).show()
            language("")
        }else if(language=="Turkish"){
            Toast.makeText(applicationContext,"Turkish",Toast.LENGTH_SHORT).show()
            language("tr")
        }
    }


    fun language(language: String){
        val locale = Locale(language)
        Locale.setDefault(locale)
        val resources = getResources()
        val configuration = resources.getConfiguration()
        configuration.locale = locale
        resources.updateConfiguration(configuration, resources.getDisplayMetrics())
    }
Run Code Online (Sandbox Code Playgroud)

android locale kotlin

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

请配置Android SDK Android Studio

我正在使用Flutter,并且收到消息“请配置Android SDK”,我在寻找其他答案,但它们不合适,我单击“配置”并获得下图 图片。您可以看到它询问我的位置,我检查了它们是否正确。如何正确配置SDK?

sdk android flutter

3
推荐指数
3
解决办法
1345
查看次数

如何从位图区域获取多边形形状

所以 - 这是我很少会问“我该怎么做”的问题之一,我实际上什么也没尝试,因为我不知道从哪里开始。

这是我的问题。

我有一张照片,我在绿色屏幕上键入了它,然后变成了一个蒙版,其中我有一些透明的像素,其余的像素是黑色的。假设这个黑色形状是照片主体的上胸部和头部。

我知道如何找到所有的黑色像素,我可以很容易地找出哪些黑色像素与透明像素相邻,这样我就可以轻松画出黑色形状的轮廓,但这就是我没有想法的地方……我该如何转换它将轮廓转换为可用作多边形的连续点数组?

svg android bitmap shape polygons

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

不再支持GCC-C ++ 17-Android Studio

我需要C++17在Android项目中使用兼容的源文件。我将.cpp文件添加到该src/main/cpp文件夹中。

构建之后,将出现以下错误:

Build command failed.
Error while executing process 
/Users/khasan/Library/Android/sdk/cmake/3.6.4111459/bin/cmake with 
arguments {-H/Users/khasan/Projects/myapplication/app -B/Users/khasan/Projects/myapplication/app/.externalNativeBuild/cmake/debug/ 
arm64-v8a -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-21 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/Users/khasan/Projects/myapplication/app/bu 
ild/intermediates/cmake/debug/obj/arm64-v8a -DCMAKE_BUILD_TYPE=Debug -DANDROID_NDK=/Users/khasan/Library/Android/sdk/ndk-bundle - 
DCMAKE_CXX_FLAGS=-std=c++17 -fexceptions -frtti - 
DCMAKE_TOOLCHAIN_FILE=/Users/khasan/Library/Android/sdk/ndk- 
bundle/build/cmake/android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=/Users/khasan/Library/Android/sdk/cmake/3.6.4111459/bin 
/ninja -GAndroid Gradle - Ninja -DBUILD_TESTING=OFF -DANDROID_TOOLCHAIN=gcc}
-- Configuring incomplete, errors occurred!

CMake Error at /Users/khasan/Library/Android/sdk/ndk-bundle/build/cmake/android.toolchain.cmake:169 (message):
GCC is no longer supported.  See https://android.googlesource.com/platform/ndk/+/master/docs/ClangMigration .md.
Call Stack (most recent call first):
  /Users/khasan/Library/Android/sdk/cmake/3.6.4111459/share/cmake- 3.6/Modules/CMakeDetermineSystem.cmake:98 (include)
   CMakeLists.txt


CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER …
Run Code Online (Sandbox Code Playgroud)

cmake android-ndk android-studio android-gradle-plugin c++17

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

如何将我的 dialogFragment 显示为圆角?

您好,我尝试使用圆角。这张图是 dialogFragment 的最后情况: https

正如您在图片中看到的,这并不是完全圆角。我看到了一些解决方案,但它是 java 代码。我无法将 java 代码完全转换为 kotlin。:) 这是我的代码:

主要活动:

package com.example.dialogfragment
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

    }


    fun showDialog(view: View) {

        var MyDialog = MyFragment()
        MyDialog.show(supportFragmentManager, "My Dialog")


    }
}
Run Code Online (Sandbox Code Playgroud)

My_dialog.xml:

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/radius"
    android:orientation="horizontal">


    <TextView
        android:id="@+id/tv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentStart="true"
        android:layout_alignParentTop="true"
        android:paddingLeft="20dp"
        android:paddingRight="20dp"
        android:text="Bu dialog penceresini be?endiniz mi?"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        tools:layout_editor_absoluteY="16dp" />

    <Button
        android:id="@+id/btnEvet"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" …
Run Code Online (Sandbox Code Playgroud)

android rounded-corners android-dialogfragment kotlin android-studio

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