小编jev*_*ely的帖子

在我的项目中使用jar时出错

我使用Java 1.8来创建我的jar.

我可以在Java项目中使用它,但在Android项目中,我有以下错误:

Error:Error converting bytecode to dex:
Cause: Dex cannot parse version 52 byte code.
This is caused by library dependencies that have been compiled using Java 8 or above.
If you are using the 'java' gradle plugin in a library submodule add 
targetCompatibility = '1.7'
sourceCompatibility = '1.7'
to that submodule's build.gradle file.
Error:1 error; aborting
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'E:\Android-tool\JAVA\jdk1.8.0_77\bin\java.exe'' finished with non-zero exit value 1
Information:BUILD …
Run Code Online (Sandbox Code Playgroud)

java android

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

如何检查 AccessibilityService

我想检查我的 AccessibilityService ,但我的代码有错误,下面是我的代码

public static boolean isAccessibilityOn(Context context) {
        int accessibilityEnable = 0;
        try {
            accessibilityEnable = Settings.Secure.getInt(context.getContentResolver(),
                    Settings.Secure.ACCESSIBILITY_ENABLED);
        } catch (Settings.SettingNotFoundException e) {
            e.printStackTrace();
        }

        if (accessibilityEnable == 1) {
            String services = Settings.Secure.getString(context.getContentResolver(),
                    Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES);
            if (services != null) {
                return services.toLowerCase().contains(context.getPackageName().toLowerCase());
            }
        }

        return false;
    }
Run Code Online (Sandbox Code Playgroud)

这是我的错误

android.provider.Settings$SettingNotFoundException: accessibility_enabled
Run Code Online (Sandbox Code Playgroud)

我在 api22 中运行我的演示

java android

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

标签 统计

android ×2

java ×2