离子问题无法解决 org.jetbrains.kotlin:kotlin-stdlib:1.1.3-2
IONIC ISSUE Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.1.3-2
我正在尝试使用 IONIC 框架构建和模拟 android 应用程序,但在 运行 ionic cordova build android 之后我遇到了一些问题。
以下是列出的所有版本:
- OS: Windows 10 x64
- 离子:4.12.0
- 科尔多瓦:8.1.2
- Gradle: 4.10.1
我还在 [project_name]\platforms\android 中创建了一个 gradle.properties 文件,我在其中为我的代理指定了 http 和 https 设置。我在 gradle-wrapper.properties 文件中所做的相同。
ionic-v1 build [11:26:25] Invoking sass gulp task.
cordova build android Android Studio project detected Running command: "C:\Program Files\nodejs\node.exe"
C:\Users\KAA1WA3\Desktop\ionic\todo\hooks\after_prepare0_add_platform_class.js
C:\Users\KAA1WA3\Desktop\ionic\todo
ANDROID_HOME=C:\Users\KAA1WA3\Desktop\androidSDK\androidSDK
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_181 studio Starting a Gradle
Daemon, 2 stopped Daemons could not be reused, use --status for
details
Task :wrapper
4 秒内构建成功 1 个可操作任务:1 个已执行子项目路径:
CordovaLib 子项目路径:app
失败:构建失败,出现异常。
- 出了什么问题:配置根项目时出现问题 'android'。
Could not resolve all files for configuration ':classpath'.
Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.1.3-2.
Required by:
project : > com.android.tools.build:gradle:3.0.1 > com.android.tools.build:gradle-core:3.0.1
project : > com.android.tools.build:gradle:3.0.1 > com.android.tools.build:gradle-core:3.0.1 >
com.android.tools.build:builder:3.0.1
project : > com.android.tools.build:gradle:3.0.1 > com.android.tools.build:gradle-core:3.0.1 >
com.android.tools.lint:lint:26.0.1
project : > com.android.tools.build:gradle:3.0.1 > com.android.tools.build:gradle-core:3.0.1 >
我的 build.gradle 文件:
/* Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
google()
jcenter{url "http://jcenter.bintray.com/"}
}
dependencies {
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
allprojects {
repositories {
maven {
url "https://maven.google.com"
}
jcenter{url "http://jcenter.bintray.com/"}
}
//This replaces project.properties w.r.t. build settings
project.ext {
defaultBuildToolsVersion="27.0.1" //String
defaultMinSdkVersion=19 //Integer - Minimum requirement is Android 4.4
defaultTargetSdkVersion=27 //Integer - We ALWAYS target the latest by default
defaultCompileSdkVersion=27 //Integer - We ALWAYS compile with the latest by default
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Example to include kotlin plugin.
app/build.gradle
-----------------
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 25
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
implementation 'androidx.core:core-ktx:1.1.0-alpha05'
implementation 'androidx.legacy:legacy-support-v4:1.0.0-beta01'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
}
build.gradle
------------
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.20'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我正在尝试使用 IONIC 框架构建和模拟 android 应用程序,但在 运行 ionic cordova build android 之后我遇到了一些问题。 以下是列出的所有版本:
- OS: Windows 10 x64
- 离子:4.12.0
- 科尔多瓦:8.1.2
- Gradle: 4.10.1
我还在 [project_name]\platforms\android 中创建了一个 gradle.properties 文件,我在其中为我的代理指定了 http 和 https 设置。我在 gradle-wrapper.properties 文件中所做的相同。
ionic-v1 build [11:26:25] Invoking sass gulp task. cordova build android Android Studio project detected Running command: "C:\Program Files\nodejs\node.exe" C:\Users\KAA1WA3\Desktop\ionic\todo\hooks\after_prepare0_add_platform_class.js C:\Users\KAA1WA3\Desktop\ionic\todo ANDROID_HOME=C:\Users\KAA1WA3\Desktop\androidSDK\androidSDK JAVA_HOME=C:\Program Files\Java\jdk1.8.0_181 studio Starting a Gradle Daemon, 2 stopped Daemons could not be reused, use --status for details Task :wrapper
4 秒内构建成功 1 个可操作任务:1 个已执行子项目路径: CordovaLib 子项目路径:app
失败:构建失败,出现异常。
- 出了什么问题:配置根项目时出现问题 'android'。
Could not resolve all files for configuration ':classpath'. Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.1.3-2. Required by: project : > com.android.tools.build:gradle:3.0.1 > com.android.tools.build:gradle-core:3.0.1 project : > com.android.tools.build:gradle:3.0.1 > com.android.tools.build:gradle-core:3.0.1 > com.android.tools.build:builder:3.0.1 project : > com.android.tools.build:gradle:3.0.1 > com.android.tools.build:gradle-core:3.0.1 > com.android.tools.lint:lint:26.0.1 project : > com.android.tools.build:gradle:3.0.1 > com.android.tools.build:gradle-core:3.0.1 >
我的 build.gradle 文件:
/* Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
google()
jcenter{url "http://jcenter.bintray.com/"}
}
dependencies {
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
allprojects {
repositories {
maven {
url "https://maven.google.com"
}
jcenter{url "http://jcenter.bintray.com/"}
}
//This replaces project.properties w.r.t. build settings
project.ext {
defaultBuildToolsVersion="27.0.1" //String
defaultMinSdkVersion=19 //Integer - Minimum requirement is Android 4.4
defaultTargetSdkVersion=27 //Integer - We ALWAYS target the latest by default
defaultCompileSdkVersion=27 //Integer - We ALWAYS compile with the latest by default
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Example to include kotlin plugin.
app/build.gradle
-----------------
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 25
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
implementation 'androidx.core:core-ktx:1.1.0-alpha05'
implementation 'androidx.legacy:legacy-support-v4:1.0.0-beta01'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
}
build.gradle
------------
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.20'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}