zulip / zulip-mobile

Zulip mobile apps for Android and iOS.
https://zulip.com/apps/
Apache License 2.0
1.3k stars 654 forks source link

Unable to build - Could not find com.android.tools:common X issues #3202

Open mbuotidem opened 5 years ago

mbuotidem commented 5 years ago

I am unable to build on Ubuntu. I run into this error :

`> Could not resolve all artifacts for configuration ':react-native-image-picker:classpath'.

Could not find com.android.tools:common:25.2.3. Searched in the following locations: https://jcenter.bintray.com/com/android/tools/common/25.2.3/common-25.2.3.pom https://jcenter.bintray.com/com/android/tools/common/25.2.3/common-25.2.3.jar Required by: project :react-native-image-picker > com.android.tools.build:gradle:2.2.3 > com.android.tools.build:gradle-core:2.2.3 > com.android.tools.build:builder:2.2.3 project :react-native-image-picker > com.android.tools.build:gradle:2.2.3 > com.android.tools.build:gradle-core:2.2.3 > com.android.tools.build:builder:2.2.3 > com.android.tools.build:manifest-merger:25.2.3 project :react-native-image-picker > com.android.tools.build:gradle:2.2.3 > com.android.tools.build:gradle-core:2.2.3 > com.android.tools.build:builder:2.2.3 > com.android.tools.ddms:ddmlib:25.2.3 project :react-native-image-picker > com.android.tools.build:gradle:2.2.3 > com.android.tools.build:gradle-core:2.2.3 > com.android.tools.build:builder:2.2.3 > com.android.tools.analytics-library:shared:25.2.3 project :react-native-image-picker > com.android.tools.build:gradle:2.2.3 > com.android.tools.build:gradle-core:2.2.3 > com.android.tools.build:builder:2.2.3 > com.android.tools.analytics-library:tracker:25.2.3 project :react-native-image-picker > com.android.tools.build:gradle:2.2.3 > com.android.tools.build:gradle-core:2.2.3 > com.android.tools.build:builder:2.2.3 > com.android.tools:sdklib:25.2.3 > com.android.tools.layoutlib:layoutlib-api:25.2.3 project :react-native-image-picker > com.android.tools.build:gradle:2.2.3 > com.android.tools.build:gradle-core:2.2.3 > com.android.tools.build:builder:2.2.3 > com.android.tools:sdklib:25.2.3 > com.android.tools:dvlib:25.2.3 project :react-native-image-picker > com.android.tools.build:gradle:2.2.3 > com.android.tools.build:gradle-core:2.2.3 > com.android.tools.build:builder:2.2.3 > com.android.tools:sdklib:25.2.3 > com.android.tools:repository:25.2.3`

I did some initial troubleshooting and a lot of people are having this issue, see : https://github.com/react-native-community/react-native-image-picker/issues/999#issuecomment-445501130

The fix there worked for me, but it was a bandaid solution because right after another react package failed, react-native-vector-icons. It looks like a lot of react-native packages are failing due to a similar underlying problem, a google search with the phrase 'could not find com.android.tools common' will pull up several recently created stackoverflow threads with the same issue.

I am wondering if there is something that could be tweaked in the main build.gradle file to solve for this and possible future occurrences.

jainkuniya commented 5 years ago

Hi @mbuotidem can you try with the changes which are in #3201. I too faced similar issue few days back, and #3201 fixed it. Fortunately, today I am able to build android without #3201. :)