获得此版本的 Android Studio 后,我可以在我的项目中使用JDK17 。一切都工作得很好,没有构建失败,没有运行时错误等(就像增强型开关工作正常)......但是这个警告在每次构建期间不断出现。有什么办法可以抑制这种情况吗?
(警告文本 -> “一个或多个类的文件版本 >= 56,不受官方支持”)
这些是 build.gradle 文件:
(1):-
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.0-rc01'
classpath 'com.google.android.gms:strict-version-matcher-plugin:1.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)
(2):-
apply plugin: 'com.android.application'
apply plugin: 'com.google.android.gms.strict-version-matcher-plugin'
android {
compileSdkVersion 32 …
Run Code Online (Sandbox Code Playgroud) 我尝试使用这个:
<item name="android:navigationBarColor">?attr/colorSurface</item>
Run Code Online (Sandbox Code Playgroud)
我最近切换到材质 3。
如果您想要应用程序的完整代码:https://github.com/Sujal1245/WALLisWALL-Wallpaper-App
我正在尝试使用新的 Android 12 Splash Screen API,但我的应用程序在打开第一个 Activity 时不断崩溃。
MainActivity
我的启动器活动没有任何与之关联的布局文件。当应用程序启动时,我会在检查当前身份验证会话时保持启动屏幕处于活动状态。
// in MainActivity.kt
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val splashScreen = installSplashScreen()
splashScreen.setKeepVisibleCondition { !authSessionIsReady }
Amplify.Auth.fetchAuthSession(onFetchSuccess, onFetchError)
}
private val onFetchSuccess = fun(session: AuthSession) {
authSessionIsReady = true
when (session.isSignedIn) {
true -> goToHomeActivity(Amplify.Auth.currentUser.username)
false -> goToLoginOrSignupActivity()
}
}
private val goToHomeActivity = fun(username: String) {
Intent(this, HomeActivity::class.java).apply {
putExtra(EXTRA_USERNAME, username)
}.also { startActivity(it) }
finish()
}
Run Code Online (Sandbox Code Playgroud)
这是我的清单文件
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myapp.myapp">
<application
android:name=".AmplifyApp" …
Run Code Online (Sandbox Code Playgroud) 我有以下代码:
Box(
Modifier.fillMaxWidth(),
contentAlignment = Alignment.Center
) {
OutlinedTextField(
value = text,
onValueChange = {
text = it
if (text.length >= 3) {
viewModel.getSuggestions(text)
}
},
label = { Text("Search") },
modifier = Modifier.fillMaxWidth(),
singleLine = true,
leadingIcon = {
Icon(
painter = painterResource(id = R.drawable.ic_search),
contentDescription = null,
modifier = Modifier.padding(16.dp, 0.dp, 8.dp, 0.dp),
tint = Color.Unspecified
)
},
shape = RoundedCornerShape(50)
)
DropdownMenu(expanded = suggestions.value.isNotEmpty(),
modifier = Modifier
.fillMaxWidth(0.92f),
onDismissRequest = { }) {
for (suggestion in suggestions.value) …
Run Code Online (Sandbox Code Playgroud) 刚刚将 Glide 更新到版本4.13.0并收到此弃用警告。
那么,这部分代码的适当等价物应该是什么?
GlideApp.with(holder.itemView.getContext())
.load(sr)
.thumbnail(0.2f)
.placeholder(R.drawable.background_splash)
.into(holder.album);
Run Code Online (Sandbox Code Playgroud)
我认为语法应该是这样的,但对传递给构造函数的内容感到困惑。
我正在使用 React-Native 开发一个应用程序。我的操作系统是 Windows 10。我希望该应用程序与 iOS 和 Android 兼容。我正在使用 Expo 进行开发。在博览会上,
有以上选择,由于我没有iOS模拟器,所以选择第二个就报错。如何在我的电脑上安装 iOS 模拟器?
android ×5
java ×3
colors ×1
deprecated ×1
expo ×1
ios ×1
java-17 ×1
java-record ×1
kotlin ×1
react-native ×1
themes ×1
thumbnails ×1