AndroidStudio failed to install
程序员文章站
2024-03-13 09:56:51
...
生成的apk不能在as上面运行,真机调试也不行
起初是因为发现了报错 ERROR: No value has been specified for property ‘manifestOutputDirectory’ 于是就去百度找答案,最后用了这篇文章No value has been specified for property 'manifestOutputDirectory 报错解决办法;按照解决方案在build.gradle文件的android中增加如下配置
android.applicationVariants.all { variant ->
variant.outputs.all {
variant.getPackageApplication().outputDirectory = new File(project.rootDir.absolutePath + "/build/outputs/apk/release")
outputFileName = "${project.name}_${defaultConfig.versionName}_${variant.buildType.name}.apk"
}
}
我的AndroidStudio 版本是3.4.1
因为版本更新,这样的写法已经不管用了,还是会报相同的错误,并且这个时候项目已经不能运行了,查看logcat真是很爆炸,对于我这样的新手来说根本看不出来哪里有问题,
在文章的评论下面告知的方法是可行有效的
苗条的胖子: 最终是通过更改androidStudio的设置,In Android Studio: File > Settings > Experimental > Gradle -> uncheck “Only sync the active variant” checkbox.解决的
然后把之前添加的代码删除就可以正常运行了。
下一篇: 详谈Java8新特性泛型的类型推导
推荐阅读
-
Job failed with org.apache.spark.SparkException: Job aborted due to stage failure
-
INSTALL_FAILED_ABORTED
-
AndroidStudio failed to install
-
install_driver(mysql) failed: Attempt to reload DBD/mysql.pm aborted.
-
adb 安装提示INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install com.ss.android.trill without first
-
记录activeMQ [doReconnect,1100] - Failed to connect to after: 10 attempt(s) continuing to retr
-
Clion 报错 Cannot save file ... [Failed to reload]
-
install_driver(SQLite) failed: Can't locate DBD/SQLite.pm
-
Eclipse 出现Failed to load JavaHL Library解决方法
-
docker(6) install RabbitMQ