导入项目后,http://schemas.android.com/apk/res/android报错

本文介绍如何在软件中正确配置Schema和DTD的路径,通过简单的步骤指导用户完成设置,确保文档验证等功能正常运行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.复制出现红色字体的路径

2.File -  Settings  - schemas and DtDs 


<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.onlinebookstore"> <!-- 记得添加下面的权限 --> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" /> <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" /> <application android:allowBackup="true" android:icon="@drawable/s2" android:label="在线书店" android:requestLegacyExternalStorage="true" android:supportsRtl="true" android:theme="@style/Theme.FlowerShop"> <activity android:name=".activity.LoginActivity"/> <activity android:name=".activity.WelcomeActivity" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".activity.ManageActivity" android:exported="false" /> <activity android:name=".activity.StuffEditActivity" android:exported="false" /> <activity android:name=".activity.LoginActivity" android:exported="false" /> <activity android:name=".activity.RegisterActivity" android:exported="false" /> <activity android:name=".activity.MainActivity" android:exported="false" /> <activity android:name=".activity.DetailActivity" android:exported="false" /> <activity android:name=".activity.AboutActivity" android:exported="false" /> <activity android:name=".activity.InfoActivity" android:exported="false" /> <activity android:name=".activity.RecordActivity" android:exported="false" /> </application> </manifest>。plugins { id 'com.android.application' } android { namespace 'com.example.flowershop' compileSdk 34 defaultConfig { applicationId "com.example.onlinebookstore" minSdk 21 targetSdk 34 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } dependencies { implementation 'androidx.appcompat:appcompat:1.3.1' implementation 'com.google.android.material:material:1.4.0' implementation 'com.github.getActivity:XXPermissions:20.0' implementation ('com.github.bumptech.glide:glide:4.16.0'){ exclude group : 'androidx.annotation' } annotationProcessor 'com.github.bumptech.glide:compiler:4.16.0' }。下面是报错信息Executing tasks: [testDebugUnitTest] in project E:\7.flower-shop\flower-shop\app Starting Gradle Daemon... Connected to the target VM, address: '127.0.0.1:49946', transport: 'socket' Gradle Daemon started in 2 s 237 ms > Task :app:preBuild UP-TO-DATE > Task :app:preDebugBuild UP-TO-DATE > Task :app:javaPreCompileDebug UP-TO-DATE > Task :app:checkDebugAarMetadata UP-TO-DATE > Task :app:generateDebugResValues UP-TO-DATE > Task :app:mapDebugSourceSetPaths > Task :app:generateDebugResources UP-TO-DATE > Task :app:mergeDebugResources UP-TO-DATE > Task :app:packageDebugResources UP-TO-DATE > Task :app:parseDebugLocalResources UP-TO-DATE > Task :app:createDebugCompatibleScreenManifests UP-TO-DATE > Task :app:extractDeepLinksDebug UP-TO-DATE > Task :app:processDebugMainManifest FAILED Incorrect package="com.example.onlinebookstore" found in source AndroidManifest.xml: E:\7.flower-shop\flower-shop\app\src\main\AndroidManifest.xml. Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported. Recommendation: remove package="com.example.onlinebookstore" from the source AndroidManifest.xml: E:\7.flower-shop\flower-shop\app\src\main\AndroidManifest.xml. > Task :app:preDebugUnitTestBuild UP-TO-DATE > Task :app:javaPreCompileDebugUnitTest UP-TO-DATE > Task :app:processDebugUnitTestJavaRes NO-SOURCE FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:processDebugMainManifest'. > Incorrect package="com.example.onlinebookstore" found in source AndroidManifest.xml: E:\7.flower-shop\flower-shop\app\src\main\AndroidManifest.xml. Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported. Recommendation: remove package="com.example.onlinebookstore" from the source AndroidManifest.xml: E:\7.flower-shop\flower-shop\app\src\main\AndroidManifest.xml. * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BUILD FAILED in 10s 12 actionable tasks: 2 executed, 10 up-to-date 21:07:28: Execution finished 'testDebugUnitTest'. Disconnected from the target VM, address: '127.0.0.1:49946', transport: 'socket'。该修改那些地方让它成为新的项目onlinebooksotre
最新发布
06-03
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值