uri、url、refer

1.简写:
URI (uniform resource identifier)统一资源标志符;
URL(uniform resource location )统一资源定位符(或统一资源定位器);
URN(uniform resource name )统一资源命名。

URL可以用来标识一个资源,而且还指明了如何locate这个资源。而URN,uniform resource name,统一资源命名,是通过名字来标识资源,比如mailto:java-net@java.sun.com。也就是说,URI是以一种抽象的,高层次概念定义统一资源标识,而URL和URN则是具体的资源标识的方式。URL和URN都是一种URI。

  URL的格式由下列三部分组成: 
第一部分是协议(或称为服务方式);  
第二部分是存有该资源的主机IP地址(有时也包括端口号);  
第三部分是主机资源的具体地址。
  URI一般由三部分组成: 
访问资源的命名机制。  
存放资源的主机名。  
资源自身的名称,由路径表示。


refer域存放的是上一个页面的地址(url),通俗讲就是来源地址。


项目的build.gradle.kts文件如下: buildscript { repositories { google() mavenCentral() maven { url = uri("https://maven.aliyun.com/repository/public") } maven { url = uri("https://dl.bintray.com/openinstall/maven")} } dependencies { classpath("com.android.tools.build:gradle:8.10.1") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.22") } } repositories { google() } APP的build.gradle.kts文件如下: plugins { id("com.android.application") id("org.jetbrains.kotlin.android") } android { namespace = "com.example.gyppcx" // Kotlin DSL 使用等号赋值 compileSdk = 36 // 属性名是 compileSdk,不是 compileSdkVersion defaultConfig { applicationId = "com.example.gyppcx" // 使用等号赋值 minSdk = 26 // 属性名是 minSdk,不是 minSdkVersion //noinspection OldTargetApi,EditedTargetSdkVersion targetSdk = 34 // 属性名是 targetSdk,不是 targetSdkVersion versionCode = 1 versionName = "1.0" } signingConfigs { create("release") { storeFile = file("../gyppcx.jks") storePassword = "Liu=123456" keyAlias = "key0" keyPassword = "Liu=123456" } } buildTypes { release { signingConfig = signingConfigs.getByName("release") isMinifyEnabled = false proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) } } compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } kotlinOptions { jvmTarget = "17" } buildFeatures { compose = true } composeOptions { kotlinCompilerExtensionVersion = "1.5.10" } } // 添加依赖项(如果有) repositories { google() mavenCentral() maven { url = uri("https://maven.aliyun.com/repository/public") } maven { url = uri("https://dl.bintray.com/openinstall/maven")} } dependencies { implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) implementation("androidx.appcompat:appcompat:1.7.0") // 确保版本号与项目兼容 implementation("androidx.core:core-ktx:1.13.1") implementation("androidx.webkit:webkit:1.10.0") implementation("com.google.android.material:material:1.11.0") testImplementation("org.junit.jupiter:junit-jupiter:5.10.1") implementation("androidx.compose.ui:ui:1.7.0") implementation("androidx.compose.material3:material3:1.3.0") implementation("androidx.compose.ui:ui-tooling-preview:1.7.0") debugImplementation("androidx.compose.ui:ui-tooling:1.7.0") implementation("androidx.activity:activity-compose:1.8.2") } dependencies { //implementation(files("libs/OpenInstall_v2.8.5.jar")) // 添加这行 implementation("com.openinstall:openinstall-sdk:latest_version") implementation("androidx.appcompat:appcompat:1.7.0") // 确保版本号与项目兼容 implementation("androidx.core:core-ktx:1.13.1") implementation("androidx.webkit:webkit:1.10.0") implementation("com.google.android.material:material:1.11.0") testImplementation("org.junit.jupiter:junit-jupiter:5.10.1") implementation("androidx.compose.ui:ui:1.7.0") implementation("androidx.compose.material3:material3:1.3.0") implementation("androidx.compose.ui:ui-tooling-preview:1.7.0") debugImplementation("androidx.compose.ui:ui-tooling:1.7.0") implementation("androidx.activity:activity-compose:1.8.2") } repositories { maven { url = uri("https://maven.aliyun.com/repository/public") } } build sync时报错如下: Failed to resolve: com.openinstall:openinstall-sdk:latest_version build output时报错如下: FAILURE: Build completed with 10 failures. 1: Task failed with an exception. ----------- * What went wrong: Execution failed for task ':app:mergeReleaseNativeLibs'. > Could not resolve all files for configuration ':app:releaseRuntimeClasspath'. > Could not find com.openinstall:openinstall-sdk:latest_version. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://repo.maven.apache.org/maven2/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://maven.aliyun.com/repository/public/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://dl.bintray.com/openinstall/maven/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom Required by: project :app * 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. ============================================================================== 2: Task failed with an exception. ----------- * What went wrong: Execution failed for task ':app:checkReleaseDuplicateClasses'. > Could not resolve all files for configuration ':app:releaseRuntimeClasspath'. > Could not find com.openinstall:openinstall-sdk:latest_version. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://repo.maven.apache.org/maven2/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://maven.aliyun.com/repository/public/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://dl.bintray.com/openinstall/maven/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom Required by: project :app * 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. ============================================================================== 3: Task failed with an exception. ----------- * What went wrong: Execution failed for task ':app:checkReleaseAarMetadata'. > Could not resolve all files for configuration ':app:releaseRuntimeClasspath'. > Could not find com.openinstall:openinstall-sdk:latest_version. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://repo.maven.apache.org/maven2/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://maven.aliyun.com/repository/public/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://dl.bintray.com/openinstall/maven/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom Required by: project :app * 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. ============================================================================== 4: Task failed with an exception. ----------- * What went wrong: Execution failed for task ':app:mapReleaseSourceSetPaths'. > Could not resolve all files for configuration ':app:releaseRuntimeClasspath'. > Could not find com.openinstall:openinstall-sdk:latest_version. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://repo.maven.apache.org/maven2/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://maven.aliyun.com/repository/public/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://dl.bintray.com/openinstall/maven/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom Required by: project :app * 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. ============================================================================== 5: Task failed with an exception. ----------- * What went wrong: Execution failed for task ':app:mergeReleaseResources'. > Could not resolve all files for configuration ':app:releaseRuntimeClasspath'. > Could not find com.openinstall:openinstall-sdk:latest_version. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://repo.maven.apache.org/maven2/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://maven.aliyun.com/repository/public/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://dl.bintray.com/openinstall/maven/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom Required by: project :app * 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. ============================================================================== 6: Task failed with an exception. ----------- * What went wrong: Execution failed for task ':app:processReleaseMainManifest'. > Could not resolve all files for configuration ':app:releaseRuntimeClasspath'. > Could not find com.openinstall:openinstall-sdk:latest_version. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://repo.maven.apache.org/maven2/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://maven.aliyun.com/repository/public/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://dl.bintray.com/openinstall/maven/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom Required by: project :app * 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. ============================================================================== 7: Task failed with an exception. ----------- * What went wrong: Execution failed for task ':app:desugarReleaseFileDependencies'. > Could not resolve all files for configuration ':app:releaseRuntimeClasspath'. > Could not find com.openinstall:openinstall-sdk:latest_version. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://repo.maven.apache.org/maven2/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://maven.aliyun.com/repository/public/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://dl.bintray.com/openinstall/maven/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom Required by: project :app * 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. ============================================================================== 8: Task failed with an exception. ----------- * What went wrong: Execution failed for task ':app:mergeReleaseArtProfile'. > Could not resolve all files for configuration ':app:releaseRuntimeClasspath'. > Could not find com.openinstall:openinstall-sdk:latest_version. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://repo.maven.apache.org/maven2/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://maven.aliyun.com/repository/public/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://dl.bintray.com/openinstall/maven/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom Required by: project :app * 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. ============================================================================== 9: Task failed with an exception. ----------- * What went wrong: Execution failed for task ':app:mergeReleaseAssets'. > Could not resolve all files for configuration ':app:releaseRuntimeClasspath'. > Could not find com.openinstall:openinstall-sdk:latest_version. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://repo.maven.apache.org/maven2/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://maven.aliyun.com/repository/public/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://dl.bintray.com/openinstall/maven/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom Required by: project :app * 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. ============================================================================== 10: Task failed with an exception. ----------- * What went wrong: Execution failed for task ':app:collectReleaseDependencies'. > Could not resolve all files for configuration ':app:releaseRuntimeClasspath'. > Could not find com.openinstall:openinstall-sdk:latest_version. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://repo.maven.apache.org/maven2/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://maven.aliyun.com/repository/public/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom - https://dl.bintray.com/openinstall/maven/com/openinstall/openinstall-sdk/latest_version/openinstall-sdk-latest_version.pom Required by: project :app * 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. ============================================================================== Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. For more on this, please refer to https://docs.gradle.org/8.14.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. BUILD FAILED in 5s
最新发布
06-06
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值