java - 非常令人困惑的 Java.lang.RuntimeException: java.io.FileNotFoundException:
问题描述
我已从旧硬盘切换到固态硬盘,并且还升级了操作系统。我保存了我的项目的副本并下载了 Android Studio,并认为它会顺利运行。但我得到了一个
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
但就像我之前说的,构建是成功的
我尝试过不同的方法。我已经使缓存无效并重新启动但无济于事,我还尝试在互联网上搜索可能的 sulotions 但我找不到任何东西。
在我的 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'
任何和所有的帮助将不胜感激。
解决方案
使用此设置,它对我有用
Settings->Build->Instant Run 并“取消选择”启用即时运行。
推荐阅读
- linux - 如何通过使用 \n 字符分隔然后将命令输出行加入
- c++ - “类我的对象();” 不调用类的构造函数
- node.js - Discord.js 逻辑运算符不适用于我的参数
- python-3.x - 在 python 中执行 groupby 时出现 Key 错误。请解释什么是错的
- graph - Gremlin Cosmos DB - 如何从 FPS 游戏中构建事件?
- html - 无法下载多张照片
- android - 如何在 Android 应用程序中共享 csv 文件?
- python - 在 Azure Functions 中使用 Python 从 Microsoft Dataverse/CDS 下载文件数据类型文件
- angular - 为什么通过 [(ngModel)] 初始化的组件变量仍然具有空值?
- reactjs - 是的,验证预填充的字段