gpt4 book ai didi

java - 如何解决此错误 VFY : unable to resolve virtual method

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:57:11 26 4
gpt4 key购买 nike

我正在使用 android studio 2.0,上次我将 jdk 7 升级到 jdk 8,我正在对文件 gradle 进行一些更改,但现在我收到此错误

E/InstantRun: Could not find slices in APK; aborting.
I/dalvikvm: Could not find method android.content.Context.getSystemService, referenced from method com.mstr.malik.elbalaapps.ControlPanel.access$super
W/dalvikvm: VFY: unable to resolve virtual method 435: Landroid/content/Context;.getSystemService (Ljava/lang/Class;)Ljava/lang/Object;
D/dalvikvm: VFY: replacing opcode 0x6f at 0x004b
I/dalvikvm: Could not find method android.app.Activity.stopLockTask, referenced from method com.mstr.malik.elbalaapps.ControlPanel.access$super
W/dalvikvm: VFY: unable to resolve virtual method 231: Landroid/app/Activity;.stopLockTask ()V
D/dalvikvm: VFY: replacing opcode 0x6f at 0x00b9
E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.mstr.malik.elbalaapps.ControlPanel.access$super
W/dalvikvm: VFY: unable to resolve check-cast 224 (Landroid/os/PersistableBundle;) in Lcom/mstr/malik/elbalaapps/ControlPanel;
D/dalvikvm: VFY: replacing opcode 0x1f at 0x00f1
I/dalvikvm: Could not find method android.content.Context.getColorStateList, referenced from method com.mstr.malik.elbalaapps.ControlPanel.access$super
W/dalvikvm: VFY: unable to resolve virtual method 417: Landroid/content/Context;.getColorStateList (I)Landroid/content/res/ColorStateList;
D/dalvikvm: VFY: replacing opcode 0x6f at 0x0101
I/dalvikvm: Could not find method android.app.Activity.onVisibleBehindCanceled, referenced from method com.mstr.malik.elbalaapps.ControlPanel.access$super
W/dalvikvm: VFY: unable to resolve virtual method 154: Landroid/app/Activity;.onVisibleBehindCanceled ()V
D/dalvikvm: VFY: replacing opcode 0x6f at 0x0111
I/dalvikvm: Could not find method android.app.Activity.onWindowStartingActionMode, referenced from method com.mstr.malik.elbalaapps.ControlPanel.access$super
W/dalvikvm: VFY: unable to resolve virtual method 158: Landroid/app/Activity;.onWindowStartingActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;
D/dalvikvm: VFY: replacing opcode 0x6f at 0x0137
E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.mstr.malik.elbalaapps.ControlPanel.access$super
W/dalvikvm: VFY: unable to resolve check-cast 224 (Landroid/os/PersistableBundle;) in Lcom/mstr/malik/elbalaapps/ControlPanel;
D/dalvikvm: VFY: replacing opcode 0x1f at 0x019a

这是gradle文件

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "24.0.0 rc3"

defaultConfig {
applicationId "com.mstr.malik.elbalaapps"
minSdkVersion 18
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
}

我该如何处理错误,我尝试将 compile compile 'com.android.support:appcompat-v7:23.3.0' 的版本更改为 compile 'com.android.support:appcompat-v7:23.0.0 '它也崩溃了,我该怎么做?提前致谢

最佳答案

如果您在运行时检查 Android 版本,您可以安全地忽略此警告。这只是意味着您引用了一种方法,该方法在您当前运行代码的平台上不可用。您只需要确保不在旧平台上使用更新的 API。通常,如果您在发布版本中做错了什么,lint 会警告您。只要牢记这一点,就无需担心。

就像这样一个运行时开关的例子:

if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// You can use here an API which was added in Lollipop.
}

关于java - 如何解决此错误 VFY : unable to resolve virtual method,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36874821/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com