在使用空白打字稿模板创建项目并添加nativescript-contacts和nativescript-permissions插件之后,在android平台上运行项目会导致此错误
F:\AMZONE-F\ProjectMobile\Tally>tns run android --device NioshaAVD
Skipping node_modules folder! Use the syncAllFiles option to sync files from this folder.
Searching for devices...
Starting Android emulator with image NioshaAVD
Waiting for emulator device initialization...
Your application will be deployed only on the device specified by the provided index or identifier.
Executing before-watchPatterns hook from F:\AMZONE-F\ProjectMobile\Tally\hooks\before-watchPatterns\nativescript-dev-typescript.js
Executing before-watchPatterns hook from F:\AMZONE-F\ProjectMobile\Tally\hooks\before-watchPatterns\nativescript-dev-webpack.js
Executing before-watch hook from F:\AMZONE-F\ProjectMobile\Tally\hooks\before-watch\nativescript-dev-typescript.js
Found peer TypeScript 3.1.6
Executing before-watch hook from F:\AMZONE-F\ProjectMobile\Tally\hooks\before-watch\nativescript-dev-webpack.js
Executing before-shouldPrepare hook from F:\AMZONE-F\ProjectMobile\Tally\hooks\before-shouldPrepare\nativescript-dev-webpack.js
Executing before-prepare hook from F:\AMZONE-F\ProjectMobile\Tally\hooks\before-prepare\nativescript-dev-typescript.js
Hook skipped because either bundling or livesync is in progress.
Preparing project...
Executing before-prepareJSApp hook from F:\AMZONE-F\ProjectMobile\Tally\hooks\before-prepareJSApp\nativescript-dev-webpack.js
Successfully prepared plugin nativescript-contacts for android.
Successfully prepared plugin nativescript-permissions for android.
Successfully prepared plugin nativescript-theme-core for android.
Successfully prepared plugin tns-core-modules for android.
Successfully prepared plugin tns-core-modules-widgets for android.
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':releaseCompileClasspath'.
> Could not resolve com.android.support:support-v4:27.0.1.
Required by:
project :
> Could not resolve com.android.support:support-v4:27.0.1.
> Could not get resource 'https://jcenter.bintray.com/com/android/support/support-v4/27.0.1/support-v4-27.0.1.pom'.
> Could not HEAD 'https://jcenter.bintray.com/com/android/support/support-v4/27.0.1/support-v4-27.0.1.pom'.
> Connect to jcenter.bintray.com:443 [jcenter.bintray.com/159.122.18.156] failed: Connection timed out: connect
> Could not resolve com.android.support:appcompat-v7:27.0.1.
Required by:
project :
> Could not resolve com.android.support:appcompat-v7:27.0.1.
> Could not get resource 'https://jcenter.bintray.com/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.pom'.
> Could not HEAD 'https://jcenter.bintray.com/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.pom'. > Connect to jcenter.bintray.com:443 [jcenter.bintray.com/159.122.18.156] failed: Connection timed out: connect
* 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 1m 2s
Unable to apply changes on device: emulator-5554. Error is: Failed to build plugin nativescript-contacts :
Error: Command gradlew.bat failed with exit code 1.
Executing after-watch hook from F:\AMZONE-F\ProjectMobile\Tally\hooks\after-watch\nativescript-dev-typescript.js
Stopping tsc watch
Executing after-watch hook from F:\AMZONE-F\ProjectMobile\Tally\hooks\after-watch\nativescript-dev-webpack.js
Stopping webpack watch
Executing after-watch hook from F:\AMZONE-F\ProjectMobile\Tally\hooks\after-watch\nativescript-dev-typescript.js
Executing after-watch hook from F:\AMZONE-F\ProjectMobile\Tally\hooks\after-watch\nativescript-dev-webpack.js
Stopping webpack watch
F:\AMZONE-F\ProjectMobile\Tally>tns run android --device NioshaAVD
Skipping node_modules folder! Use the syncAllFiles option to sync files from this folder.
Searching for devices...
Starting Android emulator with image NioshaAVD
Waiting for emulator device initialization...
Your application will be deployed only on the device specified by the provided index or identifier.
Executing before-watchPatterns hook from F:\AMZONE-F\ProjectMobile\Tally\hooks\before-watchPatterns\nativescript-dev-typescript.js
Executing before-watchPatterns hook from F:\AMZONE-F\ProjectMobile\Tally\hooks\before-watchPatterns\nativescript-dev-webpack.js
Executing before-watch hook from F:\AMZONE-F\ProjectMobile\Tally\hooks\before-watch\nativescript-dev-typescript.js
Found peer TypeScript 3.1.6
Executing before-watch hook from F:\AMZONE-F\ProjectMobile\Tally\hooks\before-watch\nativescript-dev-webpack.js
Executing before-shouldPrepare hook from F:\AMZONE-F\ProjectMobile\Tally\hooks\before-shouldPrepare\nativescript-dev-webpack.js
Executing before-prepare hook from F:\AMZONE-F\ProjectMobile\Tally\hooks\before-prepare\nativescript-dev-typescript.js
Hook skipped because either bundling or livesync is in progress.
Preparing project...
Executing before-prepareJSApp hook from F:\AMZONE-F\ProjectMobile\Tally\hooks\before-prepareJSApp\nativescript-dev-webpack.js
Successfully prepared plugin nativescript-contacts for android.
Successfully prepared plugin nativescript-permissions for android.
Successfully prepared plugin nativescript-theme-core for android.
Successfully prepared plugin tns-core-modules for android.
Successfully prepared plugin tns-core-modules-widgets for android.
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':releaseCompileClasspath'.
> Could not find com.android.support:support-v4:27.0.1.
Searched in the following locations:
- file:/C:/Users/Mehdizadeh-PC/AppData/Local/Android/Sdk/extras/m2repository/com/android/support/support-v4/27.0.1/support-v4-27.0.1.pom
- file:/C:/Users/Mehdizadeh-PC/AppData/Local/Android/Sdk/extras/m2repository/com/android/support/support-v4/27.0.1/support-v4-27.0.1.jar
- file:/C:/Users/Mehdizadeh-PC/AppData/Local/Android/Sdk/extras/google/m2repository/com/android/support/support-v4/27.0.1/support-v4-27.0.1.pom
- file:/C:/Users/Mehdizadeh-PC/AppData/Local/Android/Sdk/extras/google/m2repository/com/android/support/support-v4/27.0.1/support-v4-27.0.1.jar
- file:/C:/Users/Mehdizadeh-PC/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-v4/27.0.1/support-v4-27.0.1.pom
- file:/C:/Users/Mehdizadeh-PC/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-v4/27.0.1/support-v4-27.0.1.jar
- file:/C:/Users/Mehdizadeh-PC/.m2/repository/com/android/support/support-v4/27.0.1/support-v4-27.0.1.pom
- file:/C:/Users/Mehdizadeh-PC/.m2/repository/com/android/support/support-v4/27.0.1/support-v4-27.0.1.jar
- https://repo.maven.apache.org/maven2/com/android/support/support-v4/27.0.1/support-v4-27.0.1.pom
- https://repo.maven.apache.org/maven2/com/android/support/support-v4/27.0.1/support-v4-27.0.1.jar
- https://maven.google.com/com/android/support/support-v4/27.0.1/support-v4-27.0.1.pom
- https://maven.google.com/com/android/support/support-v4/27.0.1/support-v4-27.0.1.jar
- https://jcenter.bintray.com/com/android/support/support-v4/27.0.1/support-v4-27.0.1.pom
- https://jcenter.bintray.com/com/android/support/support-v4/27.0.1/support-v4-27.0.1.jar
Required by:
project :
> Could not find com.android.support:appcompat-v7:27.0.1.
Searched in the following locations:
- file:/C:/Users/Mehdizadeh-PC/AppData/Local/Android/Sdk/extras/m2repository/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.pom
- file:/C:/Users/Mehdizadeh-PC/AppData/Local/Android/Sdk/extras/m2repository/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.jar
- file:/C:/Users/Mehdizadeh-PC/AppData/Local/Android/Sdk/extras/google/m2repository/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.pom
- file:/C:/Users/Mehdizadeh-PC/AppData/Local/Android/Sdk/extras/google/m2repository/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.jar
- file:/C:/Users/Mehdizadeh-PC/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.pom
- file:/C:/Users/Mehdizadeh-PC/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.jar
- file:/C:/Users/Mehdizadeh-PC/.m2/repository/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.pom
- file:/C:/Users/Mehdizadeh-PC/.m2/repository/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.jar
- https://repo.maven.apache.org/maven2/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.pom
- https://repo.maven.apache.org/maven2/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.jar
- https://maven.google.com/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.pom
- https://maven.google.com/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.jar
- https://jcenter.bintray.com/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.pom
- https://jcenter.bintray.com/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.jar
Required by:
project :
我将此添加到依赖项中,权限插件在那里,但没有联系!
{
"name": "nativescript-contacts",
"directory": "..\\..\\node_modules\\nativescript-contacts"
}
我也将此添加到build.gradle
allprojects {
repositories {
google()
jcenter()
maven {
url "https://maven.google.com"
}
}
dependencies {
implementation "com.android.support:support-v4:27.0.1"
}
}
我也下架了support-v4和support compat文件,并将它们手动放入 在错误位置的错误日志中提到并更改了系统中的路径
maven {
url "https://maven.google.com"
}
到
mavenlocal()
我也将sdktargetversion更改为27,而minversion为17
但是我仍然遇到这些错误 我无法解析联系人插件