非常混乱的Java.lang.RuntimeException:Java.io.FileNotFoundException:
我已经从我的旧硬盘换成了ssd,还升级了操作系统。我保存了一份我的项目,下载了Android Studio,并认为它会顺利运行。但是我得到了一份工作非常混乱的Java.lang.RuntimeException:Java.io.FileNotFoundException:,java,android,android-studio,gradle,runtime-error,Java,Android,Android Studio,Gradle,Runtime Error,我已经从我的旧硬盘换成了ssd,还升级了操作系统。我保存了一份我的项目,下载了Android Studio,并认为它会顺利运行。但是我得到了一份工作 java.lang.RuntimeException: java.io.FileNotFoundException: C:\Users\Gotta\AndroidStudioProjects\BrandShopping\app\build \intermediates\istant_run_split_apk_resour
java.lang.RuntimeException: java.io.FileNotFoundException:
C:\Users\Gotta\AndroidStudioProjects\BrandShopping\app\build
\intermediates\istant_run_split_apk_resources\debug
\instantRunSplitApkResourcesDebug\out\slice_8\resources_ap
它还说:
Try:
Run with --stacktrace option to get the stack trace. Run with --info
or --debug option to get more log output. Run with --scan to get full
insights.
但当我尝试使用--scan时,它说“这个版本中使用了不推荐的Gradle功能,使它与Gradle 6.0不兼容。”
但当我尝试运行应用程序时,它会说:
* What went wrong:
Execution failed for task
':app:transformDexWithInstantRunSlicesApkForDebug'.
java.lang.RuntimeException: java.io.FileNotFoundException:
C:\Users\Gotta\AndroidStudioProjects\BrandShopping\app\build\
intermediates\instant_run_split_apk_resources\debug\
instantRunSplitApkResourcesDebug\out\slice_2\resources_ap
* Try:
Run with --stacktrace option to get the stack trace. Run with --info
or --debug option to get more log output. Run with --scan to get full
insights.
* Get more help at https://help.gradle.org
但正如我前面所说,构建是成功的
我试过不同的方法。我已经使缓存失效并重新启动,但没有任何效果,我还尝试在互联网上搜索可能的sulotion,但我找不到任何东西
在我的Gradle.project中:
// Top-level build file where you can add configuration options common
to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
在我的Gradle.app中:
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.0"
defaultConfig {
applicationId "com.brandshopping.brandshopping"
minSdkVersion 19
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-core:17.0.0'
implementation 'com.google.firebase:firebase-auth:18.0.0'
implementation 'com.google.firebase:firebase-database:18.0.0'
implementation 'com.google.gms:google-services:4.2.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.facebook.android:facebook-login:[5,6)'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
}
apply plugin: 'com.google.gms.google-services'
非常感谢您提供的任何帮助。只需从设置中取消选择即时运行,而不必构建并取消选择即时运行。使用此设置,它对我有效
设置->构建->即时运行并“取消选择”启用即时运行。转到设置->构建->即时运行并取消选择启用即时运行。如果它解决了您的问题。投赞成票。