An android app fails to build and run and displays this error message.
Task 'extractApksForDebug' not found in project ':app'.
When I tried to clean and build again, this error comes
Task 'bundleDebug' is ambiguous in project ':app'. Candidates are: 'bundleDebugAndroidTestResources', 'bundleDebugResources'.
How can I find the error and correct that?
Go to Help > Check for Updates.
Update all.
This will resolve the issue.
This one works for me.
On right pane of android studio click on Gradle > Right click on project > Refresh Gradle dependencies.
Related
I am beginner of ionic mobile development and now I am setting CI for my mobile application using Jenkins (on localhost). I am facing an error that I am unable to resolve for many days. ionic compiles successfully but at the last at the time of android build preparation it fails and gives error I mentioned below.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:3.0.0.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:3.0.0.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'.
> corphttpsproxyhost.yourdomain: Name or service not known
> Could not resolve com.android.tools.build:gradle:3.0.0.
> Could not get resource 'https://maven.google.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'.
> Could not GET 'https://maven.google.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'.
> corphttpsproxyhost.yourdomain
Please let me know where I am committing mistake, or is there any other dependency issue.
Thanks
I think you did not add gradle 3.0.0
You can do this by going to “Configure System” (Jenkins 1.x) or to “Global Tool Configuration” (Jenkins 2.x). From the home page navigate to:
Manage Jenkins -> Configure System (Jenkins 1.x)
Manage Jenkins -> Global Tool Configuration (Jenkins 2.x)
Scroll down a little bit and you should encounter a small section for gradle with a single button labeled “Gradle installations…”. Click on that button to expand the configuration panel.
The gradle configuration panel will ask for a few parameters. Here you can set the tool to a static path, or let Jenkins handle the installation for you. We recommend using “Install automatically” for ease of use. Below is an example of an automatic installation of gradle 3.0.0
than you have to select this gradle version from your project configration.
in bbuild tab
add Invoke Gradle script
Invoke Gradle
X Gradle Version 3.0.0
than build it it may help you
I just tried to run react-native-git-upgrade by following the documentation here. After running the upgrade, I then tried to start my project using react-native run-android but got the following errors (see below).
I also tried to follow the "Alternative" way of upgrading from that documentation but eventually ended up with the same error shown below.
How should I proceed to get the upgrade working properly?
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
> Could not resolve com.facebook.fresco:fresco:1.0.1.
Required by:
OrderEntry:app:unspecified > com.facebook.react:react-native:0.43.3
> Could not resolve com.facebook.fresco:fresco:1.0.1.
> Could not get resource 'https://jcenter.bintray.com/com/facebook/fresco/fresco/1.0.1/fresco-1.0.1.pom'.
> Could not GET 'https://jcenter.bintray.com/com/facebook/fresco/fresco/1.0.1/fresco-1.0.1.pom'.
> jcenter.bintray.com
> Could not resolve com.facebook.fresco:imagepipeline-okhttp3:1.0.1.
Required by:
OrderEntry:app:unspecified > com.facebook.react:react-native:0.43.3
> Could not resolve com.facebook.fresco:imagepipeline-okhttp3:1.0.1.
> Could not get resource 'https://jcenter.bintray.com/com/facebook/fresco/imagepipeline-okhttp3/1.0.1/imagepipeline-okhttp3-1.0.1.pom'.
> Could not GET 'https://jcenter.bintray.com/com/facebook/fresco/imagepipeline-okhttp3/1.0.1/imagepipeline-okhttp3-1.0.1.pom'.
> jcenter.bintray.com
I was finally able to resolve this. It turned out to be an issue with gradle not being able to access the google repositories due to proxy issues. To resolve it, I added a gradle.properties file to my C:\Users\my_user_id>\.gradle folder with the following values:
systemProp.http.proxyHost=your_proxy.com
systemProp.http.proxyPort=80
systemProp.https.proxyHost=your_proxy.com
systemProp.https.proxyPort=80
Once I added that file, I actually ran into more problems which you can read about here, but I finally got things running.
I am not sure why the project ran ok on the previous react-native version without needing the gradle.properties file. Anyway, hope this helps if anyone has the same problem.
I am pretty new to Android Studio.
I have converted my Eclipse project to Android Studio successfully. everything worked fine, until today I updated my SDK and suddenly it started giving me error
> Error: A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not find com.android.support:multidex:1.0.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/multidex/1.0.1/multidex-1.0.1.pom
https://jcenter.bintray.com/com/android/support/multidex/1.0.1/multidex-1.0.1.jar
https://jitpack.io/com/android/support/multidex/1.0.1/multidex-1.0.1.pom
https://jitpack.io/com/android/support/multidex/1.0.1/multidex-1.0.1.jar
file:/C:/Users/as/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/multidex/1.0.1/multidex-1.0.1.pom
file:/C:/Users/as/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/multidex/1.0.1/multidex-1.0.1.jar
file:/C:/Users/as/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/multidex/1.0.1/multidex-1.0.1.pom
file:/C:/Users/as/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/multidex/1.0.1/multidex-1.0.1.jar
Required by:
ElalaSeller:app:unspecified
when I rebuild my project. it says
Error:(25, 13) Failed to resolve: com.android.support:multidex:1.0.1
Install Repository and sync project
Show in File
Show in Project Structure dialog
I checked Android support repository is installed.
Any help will be appreciated.
Thank you.
Update : I have checked this Question. most upvoted answer says install Android Support Repository. but in my case i already have installed it. you can see in screenshot i have uploaded. but still getting same error.
I have cleaned my project but still no change.
I am new to Android Studio. But after updating my Android Studio to the latest version everything works fine, but when I decide to run the app I get this error:
(Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
java.io.FileNotFoundException: C:\Users\collinluvpc.gradle\caches\2.14.1\classAnalysis\cache.properties (The system cannot find the file specified))
I have tried to invalidate cache and restart but nothing seems to work. Please help.
At first Upgrade SDK Manager .
(Error:Execution failed for task ':app:compileDebugJavaWithJavac'. java.io.FileNotFoundException: C:\Users\collinluvpc.gradle\caches\2.14.1\classAnalysis\cache.properties (The system cannot find the file specified))
This exception is thrown during a failed attempt to open the file denoted by a specified pathname.
What is your classpath ??
You can use
compile 'com.google.android.gms:play-services:current_version'
& Use this
classpath 'com.android.tools.build:gradle:current_version'
Then Clean-Rebuild Your Project .
Go to File > Settings > Build Tools > Gradle > Configure "Gradle User Home to" -> user/.android/.gradle
I am new to Android Studio IDE. I have created a sample project using Android Studio and when I tried to build it, it comes with the following error.
Error:A problem occurred configuring root project 'SampleApp".
> Could not resolve all dependencies for configuration ':classpath'.
> Could not download artifact 'org.bouncycastle:bcprov-jdk15on:1.48:bcprov-jdk15on.jar': No
cached version available for offline mode
Can anyone please figure out what I did wrong.
It needs to download that library in order to do your build, but you've (perhaps inadvertantly) put Android Studio into offline mode. To fix it, go to Preferences > Gradle and ensure that the "Offline work" checkbox is not checked.
I think you should add following code at the top level of your build.gradle:
repositories {
mavenCentral()}
You might also need to try with --refresh-dependencies.
You can take more help from this here.