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

A problem occurred configuring project ':app' #6282

Closed
nobleson opened this issue Sep 20, 2018 · 5 comments
Closed

A problem occurred configuring project ':app' #6282

nobleson opened this issue Sep 20, 2018 · 5 comments

Comments

@nobleson
Copy link

  • CLI: 4.2.3
  • Cross-platform modules: 4.2.0
  • Runtime(s): 4.0.0
    -OS: Windows 7 64.bit (AMD)
    STEP !: I created a blank template HelloWorld Project:
    tns create HelloWorld --template tns-template-blank-ng
    ....
    Removing after-createProject...
    Project HelloWorld was successfully created.
    Now you can navigate to your project with $ cd HelloWorld
    After that you can run it on device/emulator by executing $ tns run
    STEP2: I navigate into HelloWorld and run tns doctor
    C:\Users\Luke\Documents\MobileProjects\HelloWorld>tns doctor
    √ Getting environment information

No issues were detected.

C:\Users\Luke\Documents\MobileProjects\HelloWorld>tns doctor
√ Getting environment information
No issues were detected.
√ Your ANDROID_HOME environment variable is set and points to correct directory.
√ Your adb from the Android SDK is correctly installed.
√ The Android SDK is installed.
√ A compatible Android SDK for compilation is found.
√ Javac is installed and is configured properly.
√ The Java Development Kit (JDK) is installed and is configured properly.
√ Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
√ Getting NativeScript components versions information...
‼ Update available for component nativescript. Your current version is 4.2.3 and the latest available version is 4.2.4.
√ Component tns-core-modules has 4.2.1 version and is up to date.
√ Component tns-android has 4.2.0 version and is up to date.
√ Component tns-ios has 4.2.0 version and is up to date.
STEP 4: I run the project with and increase timeout of 300
C:\Users\Luke\Documents\MobileProjects\HelloWorld>tns run android --timeout 300
Skipping node_modules folder! Use the syncAllFiles option to sync files from this folder.
Searching for devices...
npm WARN extract-text-webpack-plugin@3.0.2 requires a peer of webpack@^3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 21 packages in 88.201s
Executing before-liveSync hook from C:\Users\Luke\Documents\MobileProjects\HelloWorld\hooks\before-liveSync\nativescript-angular-sync.js
Executing before-watchPatterns hook from C:\Users\Luke\Documents\MobileProjects\HelloWorld\hooks\before-watchPatterns\nativescript-dev-typescript.js
Executing before-watchPatterns hook from C:\Users\Luke\Documents\MobileProjects\HelloWorld\hooks\before-watchPatterns\nativescript-dev-webpack.js
Executing before-watch hook from C:\Users\Luke\Documents\MobileProjects\HelloWorld\hooks\before-watch\nativescript-dev-typescript.js
Found peer TypeScript 2.7.2
Executing before-watch hook from C:\Users\Luke\Documents\MobileProjects\HelloWorld\hooks\before-watch\nativescript-dev-webpack.js
Copying template files...
Platform android successfully added. v4.2.0
Executing before-shouldPrepare hook from C:\Users\Luke\Documents\MobileProjects\HelloWorld\hooks\before-shouldPrepare\nativescript-dev-webpack.js
Executing before-prepare hook from C:\Users\Luke\Documents\MobileProjects\HelloWorld\hooks\before-prepare\nativescript-dev-typescript.js
Hook skipped because either bundling or livesync is in progress.
Preparing project...
Executing before-prepareJSApp hook from C:\Users\Luke\Documents\MobileProjects\HelloWorld\hooks\before-prepareJSApp\nativescript-dev-webpack.js
Successfully prepared plugin nativescript-angular for android.
Successfully prepared plugin nativescript-theme-core for android.
Successfully prepared plugin tns-core-modules for android.
Successfully prepared plugin nativescript-intl for android.
Successfully prepared plugin tns-core-modules-widgets for android.
Project successfully prepared (Android)
Executing after-prepare hook from C:\Users\Luke\Documents\MobileProjects\HelloWorld\hooks\after-prepare\nativescript-dev-webpack.js
Building project...
Gradle build...
+ setting applicationId
+ applying user-defined configuration from C:\Users\Luke\Documents\MobileProjects\HelloWorld\App_Resources\Android\app.gradle
+ adding nativescript runtime package dependency: nativescript-optimized-with-inspector
+ adding aar plugin dependency: C:\Users\Luke\Documents\MobileProjects\HelloWorld\node_modules\tns-core-modules-widgets\platforms\android\widgets-release.aar
Checking the license for package Android SDK Build-Tools 27.0.3 in C:\Android\licenses
Warning: License for package Android SDK Build-Tools 27.0.3 not accepted.
Checking the license for package Android SDK Platform 22 in C:\Android\licenses
Warning: License for package Android SDK Platform 22 not accepted.

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':app'.

Failed to install the following Android SDK packages as some licences have not been accepted.
platforms;android-22 Android SDK Platform 22
build-tools;27.0.3 Android SDK Build-Tools 27.0.3

To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

Using Android SDK: C:\Android

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 2m 44s
Unable to apply changes on device: emulator-5554. Error is: Command gradlew.bat failed with exit code 1.
Executing after-watch hook from C:\Users\Luke\Documents\MobileProjects\HelloWorld\hooks\after-watch\nativescript-dev-typescript.js
Stopping tsc watch
Executing after-watch hook from C:\Users\Luke\Documents\MobileProjects\HelloWorld\hooks\after-watch\nativescript-dev-webpack.js
Executing after-watch hook from C:\Users\Luke\Documents\MobileProjects\HelloWorld\hooks\after-watch\nativescript-dev-typescript.js
Executing after-watch hook from C:\Users\Luke\Documents\MobileProjects\HelloWorld\hooks\after-watch\nativescript-dev-webpack.js


From the last error it shows that
Warning: License for package Android SDK Build-Tools 27.0.3 not accepted.
Warning: License for package Android SDK Platform 22 not accepted.

I have installed the SDK Build-Tools 27.0.3 View it here
I have updated the Android SDK Platform to the latest. You can find it in the screenshot link

I also notice this in the Package.json;
"nativescript": {
"id": "org.nativescript.HelloWorld",
"tns-android": {
"version": "4.0.0"
},
"tns-ios": {
"version": "4.0.0"
}
},
My target platform is 5.1.1 (Android version) which i have already installed. So i tried to change the version from 4.2.0 to 5.1.1 still the application refused to run.

The android emulator settings are like this.
The CLI launch the emulator successfully but can not display.
I am following the offical documentation of NativeScript.

What can i do hence?

@NathanaelA

This comment was marked as abuse.

@nobleson
Copy link
Author

I tried it like this
Luke@Luke-PC MINGW64 ~/Documents/MobileProjects/HelloWorld
$ sdkmanager --licenses
bash: sdkmanager: command not found

Luke@Luke-PC MINGW64 ~/Documents/MobileProjects/HelloWorld
$ tns sdkmanager --licenses
The option 'licenses' is not supported. To see command's options, use '$ tns help sdkmanager'. To see all commands use '$ tns help'.

Luke@Luke-PC MINGW64 ~/Documents/MobileProjects/HelloWorld
$ android sdkmanager --licenses
bash: android: command not found

No success!

@tsonevn
Copy link
Contributor

tsonevn commented Sep 20, 2018

Hi @nobleson,
From the provided log it seems that you should accept some Google Android SDK licenses. As @NathanaelA suggested, you can use the sdkmanager to do that. Can you try the below-attached steps?

  1. open the Command prompt as administrator
  2. run cd %ANDROID_HOME%/tools/bin command
  3. then you will be able to start the sdkmanager via sdkmanager.bat --licenses

Then the sdkmanager will ask you if you want to accept the needed licenses.

Hope this helps.

@nobleson
Copy link
Author

@tsonevn ,
Sir i did just as you have suggested and found this:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Windows\system32>cd %ANDROID_HOME%/tools/bin

C:\Android\tools\bin>sdkmanager.bat --licenses
Error: Unknown argument --licenses
Usage:
sdkmanager [--uninstall] []
[--package_file ] [...]
sdkmanager --update []
sdkmanager --list []

In its first form, installs, or uninstalls, or updates packages.
is a sdk-style path (e.g. "build-tools;23.0.0" or
"platforms;android-23").
is a text file where each line is a sdk-style path
of a package to install or uninstall.
Multiple --package_file arguments may be specified in combination
with explicit paths.
In its second form (with --update), currently installed packages are
updated to the latest version.
In its third form, all installed and available packages are printed out.

Common Arguments:
--sdk_root=: Use the specified SDK root instead of the SDK containing this tool
--channel=: Include packages in channels up to .
Common channels are:
0 (Stable), 1 (Beta), 2 (Dev), and 3 (Canary).

--include_obsolete: With --list, show obsolete packages in the
                    package listing. With --update, update obsolete
                    packages as well as non-obsolete.
--no_https: Force all connections to use http rather than https.
--proxy=<http | socks>: Connect via a proxy of the given type.
--proxy_host=<IP or DNS address>: IP or DNS address of the proxy to use.
--proxy_port=<port #>: Proxy port to connect to.
  • If the env var REPO_OS_OVERRIDE is set to "windows",
    "macosx", or "linux", packages will be downloaded for that OS.

C:\Android\tools\bin>

I can start the sdkmanager gui from command line via android.
In that i have accepted license to installed SDK Build Tools version 22.0.1,23.0.3,25,26.0.1,27.0.3,28.0.2.
Have installed SDK Tool 25.2.5.
Have Installed SDK Platform Tools version 28.0.1
Have installed all packages from Android 5.0.1 API(21)
Have installed all packages from Android 5.1.1 API(22)
On Extras
Android support repository
Google USB Drive
Good Web Drive

All the listed packages, i have accepted the license via sdkmanager gui before doing the installations
Surprisingly tns point SDK Build Tool version 27.0.3 which i also accepted license before doing the installation
Thanks for your help

@lock
Copy link

lock bot commented Mar 27, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants