Jetpack создает новый исходный код не работаетAndroid

Форум для тех, кто программирует под Android
Ответить
Anonymous
 Jetpack создает новый исходный код не работает

Сообщение Anonymous »

Я уже пробовал компоновать Jetpack со старым исходным кодом предварительной сборки. Но недавно я скачал новый исходный код, и он у меня не работает. Вот что я попробовал.


Я добавил исходный код в
Project/androidx_prebuilts/out/ui/build/support_repo/ androidx


ниже каталога androidx у меня есть каталоги Compose и UI для исходного кода

< блоковая цитата>
Градус уровня модуля


apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

repositories {
maven { url "$androidx_home/out/ui/build/support_repo/" }
google()
jcenter()
}

android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.compose.app"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
// typeuseIR = true
freeCompilerArgs += "-P"
freeCompilerArgs +=
"plugin:androidx.compose.plugins.kotlin:syntax=FCS"
}
}

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-jdk8:1.3.41"
implementation "androidx.appcompat:appcompat:1.0.2"
implementation "androidx.core:core-ktx:1.0.2"

implementation "androidx.compose:compose-runtime:1.0.0-alpha01"
implementation "androidx.ui:ui-animation:1.0.0-alpha01"
implementation "androidx.ui:ui-animation-core:1.0.0-alpha01"
implementation "androidx.ui:ui-android-view:1.0.0-alpha01"
implementation "androidx.ui:ui-android-view-non-ir:1.0.0-alpha01"
implementation "androidx.ui:ui-android-text:1.0.0-alpha01"
implementation "androidx.ui:ui-core:1.0.0-alpha01"
implementation "androidx.ui:ui-framework:1.0.0-alpha01"
implementation "androidx.ui:ui-layout:1.0.0-alpha01"
implementation "androidx.ui:ui-material:1.0.0-alpha01"
implementation "androidx.ui:ui-platform:1.0.0-alpha01"
implementation "androidx.ui:ui-text:1.0.0-alpha01"

testImplementation "junit:junit:4.12"
androidTestImplementation "androidx.test:runner:1.1.1"
androidTestImplementation "androidx.test.espresso:espresso-core:3.1.1"
}



Градус уровня приложения


buildscript {
ext.kotlin_version = "1.3.41"
ext.androidx_home = project.properties["androidx.home"] ?: "$projectDir/androidx_prebuilts"
repositories {
maven { url "$androidx_home/out/ui/build/support_repo/" }
maven {
url "http://dl.bintray.com/kotlin/kotlin-eap"
}

mavenLocal()
google()
jcenter()

}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.0-alpha09'
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
}
}

apply plugin: 'idea'

idea.module {
excludeDirs += file('$projectDir/androidx_prebuilts')
}

allprojects {
repositories {

maven {
url "https://dl.bintray.com/kotlin/kotlin-dev/"
}
maven { url "$androidx_home/out/ui/build/support_repo/" }

mavenLocal()
google()
jcenter()

}
}

task clean(type: Delete) {
delete rootProject.buildDir
}



Ошибка, возникающая при создании проекта


* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
> Could not find androidx.compose:compose-runtime:1.0.0-alpha01.
Required by:
project :app
> Could not find androidx.ui:ui-animation:1.0.0-alpha01.
Required by:
project :app
> Could not find androidx.ui:ui-animation-core:1.0.0-alpha01.
Required by:
project :app
> Could not find androidx.ui:ui-android-view:1.0.0-alpha01.
Required by:
project :app
> Could not find androidx.ui:ui-android-view-non-ir:1.0.0-alpha01.
Required by:
project :app
> Could not find androidx.ui:ui-android-text:1.0.0-alpha01.
Required by:
project :app
> Could not find androidx.ui:ui-core:1.0.0-alpha01.
Required by:
project :app
> Could not find androidx.ui:ui-framework:1.0.0-alpha01.
Required by:
project :app
> Could not find androidx.ui:ui-layout:1.0.0-alpha01.
Required by:
project :app
> Could not find androidx.ui:ui-material:1.0.0-alpha01.
Required by:
project :app
> Could not find androidx.ui:ui-platform:1.0.0-alpha01.
Required by:
project :app
> Could not find androidx.ui:ui-text:1.0.0-alpha01.
Required by:
project :app


Подробнее здесь: https://stackoverflow.com/questions/577 ... ot-working
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Android»