这篇文章主要围绕AndroidStudio运行时出现错误:InstantRunrequires''Tools|Android|EnableADBintegration''tob...展开,旨在为您提供
这篇文章主要围绕AndroidStudio 运行时出现错误:Instant Run requires ''Tools | Android | Enable ADB integration'' to b...展开,旨在为您提供一份详细的参考资料。我们将全面介绍AndroidStudio 运行时出现错误:Instant Run requires ''Tools | Android | Enable ADB integration'' to b...,同时也会为您带来Android Studio 3.0:canary 6:启动活动中的android.content.res.Resources $NotFoundException、Android studio gradle失败并出现错误:无法获取资源'https://jcenter.bintray.com/…/"、Android Studio 启动时出现 unable to access android sdk add-on list、Android Studio 启动模拟机时关于 “Intel HAXM is required to run this AVD,VT-x is disabled in BIOS” 问题的实用方法。
本文目录一览:- AndroidStudio 运行时出现错误:Instant Run requires ''Tools | Android | Enable ADB integration'' to b...
- Android Studio 3.0:canary 6:启动活动中的android.content.res.Resources $NotFoundException
- Android studio gradle失败并出现错误:无法获取资源'https://jcenter.bintray.com/…/"
- Android Studio 启动时出现 unable to access android sdk add-on list
- Android Studio 启动模拟机时关于 “Intel HAXM is required to run this AVD,VT-x is disabled in BIOS” 问题
AndroidStudio 运行时出现错误:Instant Run requires ''Tools | Android | Enable ADB integration'' to b...
本来想调出 MMDS,没想到报出这个错误:
最后发现原来是自己选 Android Device Monitor 不小心把 Enable ADB Integration 前面的√去掉了。点击工具栏中的 Tools,选中 Android,最后点击 Enable ADB Integration,使其前面出现✔号就 OK 了,
原因:
这个是由于 Android Studio2.0 新版本中的 Instant Run (即时运行)引起的,什么是即时运行呢?
Instant Run in Android Studio 2.0 allows you to quickly make changes to your app code while your app is running on an Android device or Android Emulator. Instead of waiting for your entire app to rebuild and redeploy after each code change, Android Studio 2.0 will try to incrementally build and push only the incremental code or resource change. Depending on the code changes you make, you can see the results of your change in under a second. By simply updating your app to use the latest Gradle plugin ( ''
com.android.tools.build:gradle:2.0.0-beta2
’ ), you can take advantage of this time saving features with no other modifications to your code.
它可以快速的更改运行在 Android 虚拟机中的 APP,也就是说在 Android 虚拟机中的 app 还在运行的时候,就可以直接改变它的内部代码
开发者可以不用再等待整个应用程序重建以及每次代码更改后重新部署
简单来说就是改了代码后,点击即时运行,模拟器上的应用不需要重启就可以直接呈现出我们修改后的代码效果!
Android Studio 3.0:canary 6:启动活动中的android.content.res.Resources $NotFoundException
我将android-studio 3.0从canary 5更新为canary 6,然后突然我的应用程序在KitKat(API 19)上发生崩溃,下面是stacktrace.
Main2Activity.java:10行是我的活动onCreate()方法的第一行.
07-11 13:00:39.523 8913-8913/dcpl.com.myapplication E/AndroidRuntime: FATAL EXCEPTION: main
Process: dcpl.com.myapplication, PID: 8913
java.lang.RuntimeException: Unable to start activity ComponentInfo{dcpl.com.myapplication/dcpl.com.myapplication.Main2Activity}: android.content.res.Resources$NotFoundException: Resource ID #0x7f070058
at android.app.ActivityThread.performlaunchActivity(ActivityThread.java:2318)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2396)
at android.app.ActivityThread.access$800(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1293)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:149)
at android.app.ActivityThread.main(ActivityThread.java:5257)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:817)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:633)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f070058
at android.content.res.Resources.getValue(Resources.java:1173)
at android.support.v7.widget.AppCompatDrawableManager.loadDrawableFromDelegates(AppCompatDrawableManager.java:332)
at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:197)
at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:190)
at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:711)
at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:195)
at android.support.v7.widget.TintTypedArray.getDrawableIfKNown(TintTypedArray.java:81)
at android.support.v7.app.AppCompatDelegateImplBase.<init>(AppCompatDelegateImplBase.java:131)
at android.support.v7.app.AppCompatDelegateImplV9.<init>(AppCompatDelegateImplV9.java:155)
at android.support.v7.app.AppCompatDelegateImplV11.<init>(AppCompatDelegateImplV11.java:31)
at android.support.v7.app.AppCompatDelegateImplV14.<init>(AppCompatDelegateImplV14.java:55)
at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:205)
at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:185)
at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:519)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at dcpl.com.myapplication.Main2Activity.onCreate(Main2Activity.java:10)
at android.app.Activity.performCreate(Activity.java:5411)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performlaunchActivity(ActivityThread.java:2270)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2396)
at android.app.ActivityThread.access$800(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1293)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:149)
at android.app.ActivityThread.main(ActivityThread.java:5257)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:817)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:633)
at dalvik.system.NativeStart.main(Native Method)
我该如何解决?
解决方法:
似乎这个问题与Aapt 2有关.
放
android.enableAapt2 = FALSE
在您的gradle.properties文件中,它为我修复了问题.
Android studio gradle失败并出现错误:无法获取资源'https://jcenter.bintray.com/…/"
如何解决Android studio gradle失败并出现错误:无法获取资源''https://jcenter.bintray.com/…/"?
我在Android Studio中同步项目时遇到问题。直到上周才出现问题。最初,我认为这可能是网络问题。但是我在移动热点,办公室VPN等中尝试过。错误显示:
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.72.
> Could not get resource ''https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.72/kotlin-stdlib-jdk8-1.3.72.pom''.
> Could not GET ''https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.72/kotlin-stdlib-jdk8-1.3.72.pom''.
> sun.security.validator.ValidatorException: PKIX path building Failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve org.ow2.asm:asm:7.0.
required by:
project : > com.android.tools.build:gradle:4.0.1
project : > com.android.tools.build:gradle:4.0.1 > com.android.tools.build:builder:4.0.1
> Could not resolve org.ow2.asm:asm:7.0.
> Could not get resource ''https://jcenter.bintray.com/org/ow2/asm/asm/7.0/asm-7.0.pom''.
> Could not GET ''https://jcenter.bintray.com/org/ow2/asm/asm/7.0/asm-7.0.pom''.
> sun.security.validator.ValidatorException: PKIX path building Failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve org.ow2.asm:asm-analysis:7.0.
required by:
project : > com.android.tools.build:gradle:4.0.1
> Could not resolve org.ow2.asm:asm-analysis:7.0.
> Could not get resource ''https://jcenter.bintray.com/org/ow2/asm/asm-analysis/7.0/asm-analysis-7.0.pom''.
> Could not GET ''https://jcenter.bintray.com/org/ow2/asm/asm-analysis/7.0/asm-analysis-7.0.pom''.
> sun.security.validator.ValidatorException: PKIX path building Failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve org.ow2.asm:asm-commons:7.0.
required by:
project : > com.android.tools.build:gradle:4.0.1
project : > com.android.tools.build:gradle:4.0.1 > com.android.tools.build:builder:4.0.1
> Could not resolve org.ow2.asm:asm-commons:7.0.
> Could not get resource ''https://jcenter.bintray.com/org/ow2/asm/asm-commons/7.0/asm-commons-7.0.pom''.
> Could not GET ''https://jcenter.bintray.com/org/ow2/asm/asm-commons/7.0/asm-commons-7.0.pom''.
> sun.security.validator.ValidatorException: PKIX path building Failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve org.ow2.asm:asm-util:7.0.
required by:
project : > com.android.tools.build:gradle:4.0.1
project : > com.android.tools.build:gradle:4.0.1 > com.android.tools.build:builder:4.0.1
> Could not resolve org.ow2.asm:asm-util:7.0.
> Could not get resource ''https://jcenter.bintray.com/org/ow2/asm/asm-util/7.0/asm-util-7.0.pom''.
> Could not GET ''https://jcenter.bintray.com/org/ow2/asm/asm-util/7.0/asm-util-7.0.pom''.
> sun.security.validator.ValidatorException: PKIX path building Failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve com.google.protobuf:protobuf-java:3.10.0.
required by:
project : > com.android.tools.build:gradle:4.0.1
project : > com.android.tools.build:gradle:4.0.1 > com.android.tools.build:builder:4.0.1 > com.android.tools:sdk-common:27.0.1
project : > com.android.tools.build:gradle:4.0.1 > com.android.tools.build:builder:4.0.1 > com.android.tools.analytics-library:protos:27.0.1
project : > com.android.tools.build:gradle:4.0.1 > com.android.tools.build:builder:4.0.1 > com.android.tools.analytics-library:tracker:27.0.1
project : > com.android.tools.build:gradle:4.0.1 > com.android.tools.build:aaptcompiler:4.0.1 > com.android.tools.build:aapt2-proto:4.0.1-6197926
> Could not resolve com.google.protobuf:protobuf-java:3.10.0.
> Could not get resource ''https://jcenter.bintray.com/com/google/protobuf/protobuf-java/3.10.0/protobuf-java-3.10.0.pom''.
> Could not GET ''https://jcenter.bintray.com/com/google/protobuf/protobuf-java/3.10.0/protobuf-java-3.10.0.pom''.
> sun.security.validator.ValidatorException: PKIX path building Failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve com.google.protobuf:protobuf-java-util:3.10.0.
required by:
project : > com.android.tools.build:gradle:4.0.1
> Could not resolve com.google.protobuf:protobuf-java-util:3.10.0.
> Could not get resource ''https://jcenter.bintray.com/com/google/protobuf/protobuf-java-util/3.10.0/protobuf-java-util-3.10.0.pom''.
我试图解决的问题:
- 尝试过的网络(从WiFi到移动热点)。
- 添加了此内容:maven {url“ http://jcenter.bintray.com”}
我了解到该问题归因于jcenter。但是我需要做些什么以及为什么,我不理解。我在某些地方看到他们要求这样做:您需要将jcenter的证书导入到Java密钥库中。但是我不确定如何获得该证书。
最奇怪的是为什么我突然得到这个问题。
我正在使用Android Studio 4.0.1。
谢谢, 阿林丹。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)
Android Studio 启动时出现 unable to access android sdk add-on list
目录
Android Studio First Run 检测 Android SDK 及更新,由于众所周知的原因,我们会「Unable to access Android SDK add-on list」,而且大家一般也已经提前配置好了 Android SDK,真正需要更新的时候手动去 SDK Manager 更新就好了。
解决方案:
在 Android Studio 安装目录 bin/idea.properties 文件最后追加一句
1
|
disable.android.first.run=
true
|
参考:http://mazhuang.org/2015/05/06/android-studio/
安装 Android studio 出现的问题及解决办法
第一次安装能出现以下问题:
1. 在第一次安装过程中,可能出现 unable to access android sdk add-on list
解决办法:
打开安装位置的 bin 文件(如果安装文件是默认的,应该在电脑的 program file 下的 android 下的 android studio 下的 bin),打开 idea.properties, 用笔记本可以打开,然后在最后加一行:disable.android.first.run=true 保存,重新启动电脑。
2. 此时可以正常安装了,但是在打开新建项目或者打开项目时,又出现了:your android sdk is missing,out of date,or is missing template 或者 Android SDK path not specified
解决办法:
安装一个 SDK:
3. 在安装 SDK 中又出现了让安装 JDK(java 的安装包):
根据自己的系统选择即可,注意在安装 JDK 时,要选择接受协议,那个按钮有点难发现。
Android Studio 启动模拟机时关于 “Intel HAXM is required to run this AVD,VT-x is disabled in BIOS” 问题
- 首先在 SDK Manager 中检查是否安装 Download Intel x86 Emulator Accelerator (HAXM installer),如果没有安装,则在 SDK Manager 中下载安装 Download Intel x86 Emulator Accelerator (HAXM installer)。
- 到 SDK 目录下。在这个目录下沿着 extras\ intel \ Hardware_Accelerated_Execution_Manager 目录找到 intelhaxm-android.exe 这个文件安装定并运行。
- 在安装的过程中,你可能会遇到这样的错误提示:”Intel virtualization technology (vt,vt-x) is not enabled”, 不用担心,这时你只需要进入 BIOS 界面在 “configurations” 中找到 “Intel Virtualization Technology” 将其设置成 Enable 即可;
- 一般电脑再开机界面按下 delete 或 F2 即可,不行的话按 F12。在配置完之后再安装。
- 重新启动 Android Studio, 然后再次启动 AVD 即可。
PS: 由于是 Mac 系统,此方法未亲自测试,仅收藏。Mac 版解决方案请看链接,亲测有用:https://my.oschina.net/u/2326091/blog/838286
关于AndroidStudio 运行时出现错误:Instant Run requires ''Tools | Android | Enable ADB integration'' to b...的问题我们已经讲解完毕,感谢您的阅读,如果还想了解更多关于Android Studio 3.0:canary 6:启动活动中的android.content.res.Resources $NotFoundException、Android studio gradle失败并出现错误:无法获取资源'https://jcenter.bintray.com/…/"、Android Studio 启动时出现 unable to access android sdk add-on list、Android Studio 启动模拟机时关于 “Intel HAXM is required to run this AVD,VT-x is disabled in BIOS” 问题等相关内容,可以在本站寻找。
本文标签: