Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find com.android.tools.build:gradle:4.5.6. #5

Closed
rubenhr opened this issue Mar 8, 2022 · 17 comments
Closed

Could not find com.android.tools.build:gradle:4.5.6. #5

rubenhr opened this issue Mar 8, 2022 · 17 comments

Comments

@rubenhr
Copy link

rubenhr commented Mar 8, 2022

Starting yesteday. Some weird behavior start ocurring. We didn't change anything in terms of configurations but our builds stops working.

Do you know, what could be a reason this starts failing?

Screen Shot 2022-03-08 at 09 05 34

@kefahB
Copy link
Owner

kefahB commented Mar 9, 2022

Hi,

Do you have this in your /app/App_Resources/Android/app.gradle ?

project.ext {
    googlePlayServicesVersion = "+"
}

@kefahB
Copy link
Owner

kefahB commented Mar 9, 2022

If it doesn't work, please post info about your NS config ns info and with which version on android you'r running.

@ebiscardi
Copy link

I have the same issue. Just to try to identify the problem, should be this issue related to the use of compile instruction in include.gradle, removed in gradle 7?
https://docs.gradle.org/current/userguide/upgrading_version_6.html#sec:configuration_removal

As described here:
NativeScript/android#1706
when Nativescript CLI builds on Android, Gradle version is not pulled from the current platform, but from the latest Nativescript version, using first

npm view @nativescript/android dist-tags --json

to get the latest version, and then

npm view @nativescript/android@<version> gradle --json

to get the appropriate gradle info

You can see that using --log trace option when you build on Android.
For this reason, version 8.2.0 is broken, and fails to build on Android
The latest version (8.2.1), released some hours later, uses gradle 7.4:

npm view @nativescript/android@8.2.1  gradle --json
{
  "version": "7.4",
  "android": "7.1.2"
}

the previous ones, version 6.4

npm view @nativescript/android@7.0.1  gradle --json
{
  "version": "6.4",
  "android": "3.6.4"
}

npm view @nativescript/android@8.1.1  gradle --json
{
  "version": "6.4",
  "android": "3.6.4"
}

@rubenhr
Copy link
Author

rubenhr commented Mar 9, 2022

HI @kefahB
Yes, I have the googlePlayServicesVersion = "+" in our app.gradle file.
Weird thing is that suddently, everything starts working fine. But today I'm getting the same issue again.

We are using 8.1.5 version with Android 8.1.1.

But for some reason, gradle picks up latest version instead of the appropiate.

@lambourn
Copy link

lambourn commented Mar 9, 2022

see NativeScript/NativeScript#9814 (comment) - that should fix the issue (needs you to update CLI, though)

@kefahB
Copy link
Owner

kefahB commented Mar 9, 2022

Thanks @lambourn ;)

@rubenhr please try the fix and tel me

@CalebSWhite
Copy link

@kefahB Might need to update the include.gradle to use implementation rather than the deprecated compile.

@kefahB
Copy link
Owner

kefahB commented Mar 10, 2022

Hi everyone,

I've published a new version .. please give it a try and tel me if every think run as expected

@rubenhr
Copy link
Author

rubenhr commented Mar 10, 2022

Hi everyone.

So, at the end, I was able to fix all my issues upgrading to new NS version and also upgrading NG version.
I'm running now on 8.2.2 with Java 11.

I'm getting this error right now:

Screen Shot 2022-03-10 at 12 18 32

@lekhmanrus
Copy link

I have the same error as @rubenhr has:

ERROR in ./node_modules/@kefah/nativescript-google-maps/index.android.ts
Module build failed (from ../../node_modules/@ngtools/webpack/src/index.js):
Error: \node_modules\@kefah\nativescript-google-maps\index.android.ts is missing from the TypeScript 
compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
    at \node_modules\@ngtools\webpack\src\ivy\loader.js:60:26

@nativescript/android: 8.2.2
@kefah/nativescript-google-maps: 1.0.4

@kefahB
Copy link
Owner

kefahB commented Mar 10, 2022

@lekhmanrus, @rubenhr can you provide a sample project with the error, because every think work as expected even with angular project.

@CalebSWhite
Copy link

@kefahB looks like you might have published the plugin unbuilt to npm. It doesn't have the js files and it shouldn't include the tsconfig

@kefahB
Copy link
Owner

kefahB commented Mar 11, 2022

@CalebSWhite, I've build the project, in my own I do have the tsconfig ! and it work as expected!

@CalebSWhite
Copy link

It just looks a bit different from the previous (npm) packaged version. Since no code was changed (just the gradle and a version bump) I assumed it was a build/packing step???
image

@kefahB
Copy link
Owner

kefahB commented Mar 11, 2022

Oh, I've mad a npm publish that does not build by default! this repo it is a NS plugin that integrate the command npm run publish-package and it does the build before pushing a new version :)

Please take a test and tel me ;)

@CalebSWhite
Copy link

Good stuff. v1.0.6 is working for me.

@rubenhr
Copy link
Author

rubenhr commented Mar 11, 2022

1.0.6 is working for me too. We can close this ticket. Thanks a lot for all comments

@rubenhr rubenhr closed this as completed Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants