我使用compose 1.0.1和Kotlin 1.5.20创建了一个全新的android应用程序,并在编译过程中收到以下警告: w: ATTENTION!
This build uses unsafe internal compiler arguments:
-XXLanguage:+NonParenthesizedAnnotationsOnFunctionalTypes
This mode is not recommended for production use,
as no stability/compatibility guarantees are given on
compi
我想从Jetpack Compose sample应用程序中运行“猫头鹰应用程序”,但我得到了这个错误: This version of the Android Support plugin for IntelliJ IDEA (or Android Studio) cannot open this project, please retry with version 4.2 or newer. 它是用来干嘛的?
我开始使用Jetpack compose (1.0.0-beta07),在使用TextField时遇到了一个非常奇怪的问题。根据所有可能的文档和说明,我做的每件事都是正确的,但是Android Studio经常给我写TextField的消息None of the following functions can be called with the arguments supplied.
下面是我写的代码,Studio仍然在Text (label)和text = it下划线,但我认为它在定义TextField时有问题。当我用"text"替换remember {mutableSta
在我的Android Studio应用程序项目中,I registered all activities, services, receivers etc. in the manifest。我还可以定义这样的方案: myApp://MyMapActivity/x_and_y_coordinates 打开我的应用程序与这个特定的指定活动和预先填写地图区域,例如。因此,我可以从其他应用程序启动此活动,也可以创建相应的通知来启动这些活动。 现在,我正在创建一个带有jetpack compose的Android应用程序,我有一个单独的活动,在其中我组成了所有的“视图”。如何通过jetpack com
我今天开始学习jetpack compose,当我使用NavHost时,我有一个渲染预览问题 java.lang.IllegalStateException: ViewModels creation is not supported in Preview
at androidx.compose.ui.tooling.ComposeViewAdapter$FakeViewModelStoreOwner$1.getViewModelStore(ComposeViewAdapter.kt:709)
at androidx.navigation.compose.NavHostKt.NavHost(N
(配置: compose_version =‘1.0.0-字母09’kotlin_version = "1.4.21")
Jetpack可组合函数"Text“被废弃
Text( // <===== Strikethrough in Android Studio
text = "Anna"
)
但我想不出怎么换。医生说用.文本
@Deprecated(
message = "Use androidx.compose.material.Text for a high level Text component that "
我正在尝试加载一个向量,但是继续得到这个错误堆栈跟踪
java.lang.IllegalArgumentException: Unknown command for: R
at androidx.compose.ui.graphics.vector.PathNodeKt.toPathNodes(PathNode.kt:275)
at androidx.compose.ui.graphics.vector.PathParser.addNode(PathParser.kt:525)
at androidx.compose.ui.graphics.vector.PathPa
在我的片段中使用撰写时,我得到了这个错误,这在XML的情况下运行得很好
ViewTreeLifecycleOwner not found from androidx.fragment.app.FragmentContainerView
我使用的是单独的活动方法,而不是,使用Jetpack导航组件
活动
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_nav)
supportFragmentM
假设我有一个带有文本字段的LazyColumn,要切换的按钮是可用的文本字段。
LazyColumn() {
item {
var text by remember { mutableStateOf("Hello") }
if (myViewModel.showTextField.value) {
TextField(value = text, onValueChange = { text = it })
}
TextButton(onClick = { myViewModel.to
API上显示了很多错误,
在LazyVerticalGrid部分显示错误:
This foundation API is experimental and is likely to change or be removed in the future.
在工作日部分:
Field requires API level 26 (current min is 21): `java.time.DayOfWeek#SUNDAY`
在月份部分中,有以下错误:
Field requires API level 26 (current min is 21): `java.time.Month#JULY`
下
我在Android Studio立即删除我的Dart/Flutter导入时遇到了问题,特别是当我在Android Studio之外单击时。
例如,我将这些代码从另一个文件粘贴到一个空文件中以重构我的代码:
import 'package:http/http.dart' as http;
import 'dart:convert';
在我可以使用导入之前,Android Studio会自动删除它们。我进入了Preferences > General > Auto Import。对于Dart,它有行"Update imports on paste
我总共有两个屏幕,即SplashScreen和BottomNavScreen(带有底部导航)。BottomNavScreen有两个屏幕,即Screen1和Screen2。
我想从SplashScreen返回到Screen2,但是在导航到SplashScreen时我得到了这个错误。
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.lool, PID: 8610
java.lang.IllegalStateException: ViewModelStore should be set before setGr
由于我的应用程序结构,我试图在@Copmosable之外播放声音。 我有一个验证例程,它在我的视图模型中,根据结果我想触发一个声音,但我似乎无法在@Composable之外获得上下文工作 我在MasterViewModel中得到以下错误: None of the following functions can be called with the arguments supplied.
create(Context!, Uri!) defined in android.media.MediaPlayer
create(Context!, Int) defined in android.med
据推测,现在Jetpack Compose支持Robolectric测试,因为。但是我尝试实现一个非常简单的测试( ,请参阅runClickScenario()),但它对我不起作用。我得到的错误是:
java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.IllegalAccessException: class androidx.test.espresso.base.ThreadPoolExecutorExtractor$2 cannot access a member of class a