- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经尝试使用旧的预构建源代码编写 Jetpack。但是最近我下载了一个新源,但它对我不起作用。这是我尝试过的。
I have added source in Project/androidx_prebuilts/out/ui/build/support_repo/androidx
在 androidx 目录下,我有 compose和 ui源目录
Module level gradle
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"
}
Application level gradle
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
}
Error I'm getting while building the project
* 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
最佳答案
首先,请参阅此文档:googlesource
“本节介绍如何设置本地工作环境以构建 Android 源文件。您必须使用 Linux 或 macOS;目前不支持在 Windows 下构建。” — 安卓文档
Step 1:
首先,我们需要从(如果没有安装)安装 Repo https://source.android.com/setup/build/downloading
然后在你的命令行中点击下面的命令
mkdir bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
现在检查 repo 状态
Step 2:
创建一个目录让我们说“AndroidCompose”
mkdir ~/AndroidCompose
cd ~/AndroidCompose
并像这样设置 git 配置(如果没有设置)
git config — global user.name “Your Real Name”
git config — global user.email “you@example.com”
现在初始化repo
repo init -u https://android.googlesource.com/platform/manifest -b androidx-master-dev
repo 现已初始化,如果我们查看 ~/AndroidCompose 目录,我们将看到一个“.repo”列表
点击
ls -a ~/AndroidCompose/.repo
“现在您的存储库已设置为仅提取构建和运行 AndroidX 库所需的内容。下载代码(并在我们提取 6GB 时喝杯咖啡)”-Android 文档
Step 3: Command to get all required source
repo sync -j8 -c
(类似于 git fetch)
现在我们已经下载了包含@Composable 的正确版本的Android JetPack 源
这会将所有 Jetpack Compose 源放在“ui”目录中
cd ~/AndroidCompose/frameworks/support/ui
点击
./studio
启动Android工作室
重启 Android Studio 时要小心。我们需要始终从该目录开始获取 Jetpack Compose 库。
出现提示时接受许可协议(protocol)。现在我们已准备好编辑、运行和测试!
关于android - Jetpack 撰写新源不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57789661/
我在Windows 10中使用一些简单的Powershell代码遇到了这个奇怪的问题,我认为这可能是我做错了,但我不是Powershell的天才。 我有这个: $ix = [System.Net.Dn
var urlsearch = "http://192.168.10.113:8080/collective-intellegence/StoreClicks?userid=" + userId +
我有一个非常奇怪的问题,过去两天一直让我抓狂。 我有一个我试图控制的串行设备(LS 100 光度计)。使用设置了正确参数的终端(白蚁),我可以发送命令(“MES”),然后是定界符(CR LF),然后我
我目前正试图让无需注册的 COM 使用 Excel 作为客户端,使用 .NET dll 作为服务器。目前,我只是试图让概念验证工作,但遇到了麻烦。 显然,当我使用 Excel 时,我不能简单地使用与可
我开发了简单的 REST API - https://github.com/pavelpetrcz/MandaysFigu - 我的问题是在本地主机上,WildFly 16 服务器的应用程序运行正常。
我遇到了奇怪的情况 - 从 Django shell 创建一些 Mongoengine 对象是成功的,但是从 Django View 创建相同的对象看起来成功,但 MongoDB 中没有出现任何数据。
我是 flask 的新手,只编写了一个相当简单的网络应用程序——没有数据库,只是一个航类搜索 API 的前端。一切正常,但为了提高我的技能,我正在尝试使用应用程序工厂和蓝图重构我的代码。让它与 pus
我的谷歌分析 JavaScript 事件在开发者控制台中运行得很好。 但是当从外部 js 文件包含在页面上时,它们根本不起作用。由于某种原因。 例如; 下面的内容将在包含在控制台中时运行。但当包含在单
这是一本名为“Node.js 8 the Right Way”的书中的任务。你可以在下面看到它: 这是我的解决方案: 'use strict'; const zmq = require('zeromq
我正在阅读文本行,并创建其独特单词的列表(在将它们小写之后)。我可以使它与 flatMap 一起工作,但不能使它与 map 的“子”流一起工作。 flatMap 看起来更简洁和“更好”,但为什么 di
我正在编写一些 PowerShell 脚本来进行一些构建自动化。我发现 here echo $? 根据前面的语句返回真或假。我刚刚发现 echo 是 Write-Output 的别名。 写主机 $?
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 4年前关闭。 Improve thi
我将一个工作 View Controller 类从另一个项目复制到一个新项目中。我无法在新项目中加载 View 。在旧项目中我使用了presentModalViewController。在新版本中,我
我对 javascript 很陌生,所以很难看出我哪里出错了。由于某种原因,我的功能无法正常工作。任何帮助,将不胜感激。我尝试在外部 js 文件、头部/主体中使用它们,但似乎没有任何效果。错误要么出在
我正在尝试学习Flutter中的复选框。 问题是,当我想在Scaffold(body :)中使用复选框时,它正在工作。但我想在不同的地方使用它,例如ListView中的项目。 return Cente
我们当前使用的是 sleuth 2.2.3.RELEASE,我们看不到在 http header 中传递的 userId 字段没有传播。下面是我们的代码。 BaggageField REQUEST_I
我有一个组合框,其中包含一个项目,比如“a”。我想调用该组合框的 Action 监听器,仅在手动选择项目“a”完成时才调用。我也尝试过 ItemStateChanged,但它的工作原理与 Action
你能看一下照片吗?现在,一步前我执行了 this.interrupt()。您可以看到 this.isInterrupted() 为 false。我仔细观察——“这个”没有改变。它具有相同的 ID (1
我们当前使用的是 sleuth 2.2.3.RELEASE,我们看不到在 http header 中传递的 userId 字段没有传播。下面是我们的代码。 BaggageField REQUEST_I
我正在尝试在我的网站上设置一个联系表单,当有人点击发送时,就会运行一个作业,并在该作业中向所有管理员用户发送通知。不过,我在失败的工作表中不断收到此错误: Illuminate\Database\El
我是一名优秀的程序员,十分优秀!