React-native-firebase: Error:Could not find aapt2-proto.jar

Created on 23 Oct 2018  路  11Comments  路  Source: invertase/react-native-firebase

Issue

Cloning and trying to run the https://github.com/invertase/react-native-firebase-starter.git does not build on windows for android platform:

git clone ...
npm install 
react-native run-android

Project Files

Noting changed from the initial git template

Environment

  • Platform that you're experiencing the issue on:

    • [ ] iOS

    • [x] Android

    • [ ] iOS but have not tested behavior on Android

    • [x] Android but have not tested behavior on iOS

    • [ ] Both

  • If known, the version of the platform are you experiencing the issue on:

    • ADD_SOMETHING_HERE e.g. iOS 10 or Android API 28

  • Operating System:

    • [ ] MacOS, version: N/A

    • [x] Windows, version: 10

    • [ ] Other, please specify: N/A

  • Build Tools:

    • ADD_SOMETHING_HERE

  • React Native version:

react-native-cli: 2.0.1
react-native: 0.57.1

  • React Native Firebase library version:

    • ADD_SOMETHING_HERE

  • Firebase module(s) you're using that has the issue:

    • [x] N/A

    • [ ] Authentication

    • [ ] Analytics

    • [ ] Cloud Firestore

    • [ ] Cloud Messaging (FCM)

    • [ ] Crashlytics

    • [ ] Dynamic Links

    • [ ] Functions Callable

    • [ ] Invites

    • [ ] Instance ID

    • [ ] Notifications

    • [ ] Performance Monitoring

    • [ ] Realtime Database

    • [ ] Remote Config

    • [ ] Storage

  • Are you using TypeScript?

    • [ ] No

    • [ ] Yes, version: N/A

  • Are you using Expo, e.g. ExpoKit?

    • [x] No

    • [ ] Yes, I've _not_ ejected

    • [ ] Yes, but I have ejected to ExpoKit

    • [ ] Yes, but I have ejected to vanilla React Native

    • Expo version: N/A



Most helpful comment

In build.gradle change position of goolge() and place it first:
How it was before:
buildscript {
repositories {
jcenter()
google()
}

Change to:
buildscript {
repositories {
google()
jcenter()
}

Start Sync and it will ask you to upgrade Build tools.

All 11 comments

when trying to build an android app using cordova same error occurs.
on
cordova build android

A problem occurred configuring project ':CordovaLib'.

Could not resolve all files for configuration ':CordovaLib:classpath'.
Could not find aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.3.1).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/aapt2-proto/0.3.1/aapt2-proto-0.3.1.jar

I have meet the same problem.

I have the same problem

In build.gradle change position of goolge() and place it first:
How it was before:
buildscript {
repositories {
jcenter()
google()
}

Change to:
buildscript {
repositories {
google()
jcenter()
}

Start Sync and it will ask you to upgrade Build tools.

@vorlan thanks for the solution

@vorlan in which build.gradle, I have to do this change. It's my first project on Android. Thanks in advance.

@Durdush just check all the "build.gradle"s

In build.gradle change position of goolge() and place it first:
How it was before:
buildscript {
repositories {
jcenter()
google()
}

Change to:
buildscript {
repositories {
google()
jcenter()
}

Start Sync and it will ask you to upgrade Build tools.

Worked for me ....

In build.gradle change position of goolge() and place it first:
How it was before:
buildscript {
repositories {
jcenter()
google()
}

Change to:
buildscript {
repositories {
google()
jcenter()
}

Start Sync and it will ask you to upgrade Build tools.

Thanks for this, this also worked for me.
The question is - what happened and why does this work? It seems to imply that Google has removed their dependencies from jcenter, but surely this would break all sorts of old builds, and surely they would announce such a change?

Was this page helpful?
0 / 5 - 0 ratings