我收到此 gradle 同步错误 -应用了 Hilt Android Gradle 插件,但未找到 com.google.dagger:hilt-android 依赖项。有人可以帮忙吗?:)
我使用 kotlin dsl,我在 buildSrc 中有 libs.kt
buildSrc - build.gradle.kts:
plugins {
`kotlin-dsl`
}
repositories {
jcenter()
}
Run Code Online (Sandbox Code Playgroud)
buildSrc 中的 libs.kt
object libs {
object hilt {
private const val dagger_hilt_version = "2.30.1-alpha"
private const val jetpack_hilt_version = "1.0.0-alpha02"
const val gradlePlugin = "com.google.dagger:hilt-android-gradle-plugin:$dagger_hilt_version"
const val android = "com.google.dagger:hilt-android:$dagger_hilt_version"
const val android_compiler = "com.google.dagger:hilt-android-compiler:$dagger_hilt_version"
const val jetpack_viewmodel = "androidx.hilt:hilt-lifecycle-viewmodel:$jetpack_hilt_version"
const val jetpack_compiler = "androidx.hilt:hilt-compiler:$jetpack_hilt_version"
}
/* more objects + …Run Code Online (Sandbox Code Playgroud) 在项目中,我使用 kotlin dsl、jetpack compose、com.android.tools.build:gradle:7.0.0-alpha08、许多模块,并且我不断收到此错误。
Zip 文件 'E:\project_name\module_name\build\intermediates\compile_library_classes_jar\debug\classes.jar' 已包含条目 'META-INF/module_name_debug.kotlin_module',无法覆盖
排除/pickFirst/合并的任意组合
packagingOptions {
exclude/pickFirst/merge("META-INF/module_name_debug.kotlin_module")
}
Run Code Online (Sandbox Code Playgroud)
只是不起作用。
有什么解决办法吗?
我已经创建了一个即时应用程序。我将其上传到我的Google控制台,但出现此错误。
www.kochchy.cz网站尚未通过数字资产链接协议链接到您的应用程序。将应用程序站点与Digital Assets Link链接。
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.kochchy.instantapptest.app",
"sha256_cert_fingerprints":["A4:A6:74:15:F1:3E:38:3F:93:0F:EF:E3:A6:86:8E:7C:25:45:E8:80:5B:5E:35:70:49:20:DB:F8:CB:D4:FC:E0"]
}
}]
Run Code Online (Sandbox Code Playgroud)
即时和可安装的两个APK都使用相同的ID:com.kochchy.instantapptest.app(每个都在自己的模块清单中定义)
我的基本模块清单如下所示:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.kochchy.instantapptest">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="default-url"
android:value="https://www.kochchy.cz" />
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:scheme="http" />
<data android:host="www.kochchy.cz" />
<data android:pathPattern="/menu" />
</intent-filter>
</activity>
</application>
</manifest> …Run Code Online (Sandbox Code Playgroud) 这段代码导致此崩溃:
我正在使用 compose 版本 1.0.0-alpha06
java.lang.IllegalStateException:androidx.compose.runtime.Composer.finalizeCompose(Composer.kt:2369) at androidx.compose.runtime.Composer.endRoot(Composer.kt:575) at androidx.compose.runtime 的开始/结束不平衡.Composer.composeInitial(Composer.kt:2054) 在 androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:276) 在 androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:110) 在 androidx。 compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.kt:234) 在 androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.kt:-1) 在 androidx.compose.ui.platform .AndroidComposeView.onAttachedToWindow(AndroidComposeView.kt:627) 在 android.view.View.dispatchAttachedToWindow(View.java:20479) 在 android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3489) 在 android。view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3496) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3496) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3496) at android.view.ViewGroup.dispatchAttachedToWindow (ViewGroup.java:3496) 在 android.view.AttachInfo_Accessor.setAttachInfo(AttachInfo_Accessor.java:44)
有人能帮我吗?谢谢
@Composable
@Preview
private fun Image1() {
Box(modifier = Modifier.fillMaxWidth().wrapContentHeight()) {
Image(
asset = imageResource(id = R.mipmap.fit_static_image_1),
contentScale = ContentScale.FillWidth,
)
Column(Modifier.padding(start = 16.dp, end = 16.dp).align(Alignment.CenterStart), horizontalAlignment = Alignment.Start) {
Text(
color = getColor(id = R.color.white),
fontWeight = FontWeight.Bold,
fontSize = …Run Code Online (Sandbox Code Playgroud)