小编Mau*_*ato的帖子

如何修复 Android 资源链接失败的 dialogCornerRadius not found

我正在开发一个应用程序,我遇到了这个问题。

Android gradle/缓存/转换

Android 资源链接失败 */appcompat-1.0.0/res/values-v28/values-v28.xml:5:5-8:13: AAPT: 错误: 资源 android:attr/dialogCornerRadius 未找到。

我读过这个问题可以通过 API 27 到 28 解决。我遇到的问题是,如果我更新到 28,我会失去我的应用程序的感觉,因为我所有的应用程序都是由 Fragments 制作的,并且是在最新版本的 Android Studio 中api 片段已弃用。

       v28/values-v28.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
          <style name="Base.Theme.AppCompat" parent="Base.V28.Theme.AppCompat"/>
          <style name="Base.Theme.AppCompat.Light" parent="Base.V28.Theme.AppCompat.Light"/>
          <style name="Base.V28.Theme.AppCompat" parent="Base.V26.Theme.AppCompat">
            <!-- We can use the platform styles on API 28+ -->
            <item name="dialogCornerRadius">?android:attr/dialogCornerRadius</item>
          </style>
          <style name="Base.V28.Theme.AppCompat.Light" parent="Base.V26.Theme.AppCompat.Light">
            <!-- We can use the platform styles on API 28+ -->
            <item name="dialogCornerRadius">?android:attr/dialogCornerRadius</item>
          </style>
</resources>
Run Code Online (Sandbox Code Playgroud)

那么,如何运行我的应用程序并保留片段(不更新到 Android 9 api)。

我要修改项目 dialogCornerRadius

android android-appcompat android-fragments android-support-library androidx

8
推荐指数
1
解决办法
5759
查看次数

ParseError at [row,col]:[66,34] 消息:-xml-names-19990114#AttributeNSNotUnique?Button&amp;layout_column

我的应用程序出现错误,错误提示

    ParseError at [row,col]:[66,34] Message:         http://www.w3.org/TR/1999/REC-xml-names-19990114#AttributeNSNotUnique?        Button&layout_column 
Run Code Online (Sandbox Code Playgroud)

我找不到错误在哪里..我不知道哪些是行和列...也许在 xml 文件中?

这是AndroidManifest文件

    AndroidManifest.xml
    <?xml version="1.0" encoding="utf-8"?>
    <manifest     xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.***">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="App Name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
    <activity
        android:name="com.example.appname.MainActivity"
        android:theme="@style/Theme.AppCompat.NoActionBar"
        android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER"    />
        </intent-filter>
    </activity>
    <!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->

        <meta-data
            android:name="appname"
            android:value="ca-app-pub-2703074771097768~4557375307"/>. 
    </application>
Run Code Online (Sandbox Code Playgroud)

android android-studio

7
推荐指数
2
解决办法
6452
查看次数

无法创建新活动android studio

我有 android studio 的问题。我正在开发一个有很多活动的项目。但是现在,我已将 Android Studio 更新到 3.4 版(2019 年 4 月),但无法创建新活动。ide 没有显示任何错误消息,我按“新建”>“空活动”,然后写下活动的名称,然后按“完成”,但布局中没有任何反应。有人知道这是什么错误吗?谢谢。

新活动

新建>活动

布局中没有创建活动

android-studio

6
推荐指数
2
解决办法
3215
查看次数

错误:无法解析:androidx.lifecycle:lifecycle:2.2.0-beta01

我的文件有问题build.gradle,特别是 module 'android.x.lifecycle'

我有以下错误

ERROR: Failed to resolve: androidx.lifecycle:lifecycle:2.2.0-beta01
This is the last version of androidx.lifecycle
Run Code Online (Sandbox Code Playgroud)

不知道是不是语法错误

这是build.gradle文件

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    defaultConfig {
        applicationId "com.flixarts.ar.englishnow"
        minSdkVersion 14
        targetSdkVersion 29
        buildToolsVersion '25.0.2'
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    buildToolsVersion = '28.0.3'
}

dependencies {
    implementation 'androidx.lifecycle:lifecycle:2.2.0-beta01'
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.recyclerview:recyclerview:1.0.0'
    implementation 'com.google.android.material:material:1.1.0-beta01'
    implementation fileTree(dir: 'libs', …
Run Code Online (Sandbox Code Playgroud)

android android-lifecycle build.gradle androidx

5
推荐指数
1
解决办法
5152
查看次数