gpt4 book ai didi

xml - 调试/AndroidManifest 中的错误

转载 作者:行者123 更新时间:2023-12-04 17:48:29 25 4
gpt4 key购买 nike

在调试 list 中获取错误。通过禁用 AAPT2 找到了解决方法,但我宁愿找到问题的根源。除了错误之外,还有各种属性“此处不允许”和“URI 未注册”(仅在调试 list 中)。

调试/AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- suppress ALL -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sam.duluthbikes"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="20"
android:targetSdkVersion="25" />

<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
Google Maps Android API v2, but you must specify either coarse or fine
location permissions for the 'MyLocation' functionality.
-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />

<!-- To auto-complete the email text field in the login form with the user's emails -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<uses-feature
android:name="android.hardware.camera2"
android:required="false" />

<meta-data
android:name="android.support.VERSION"
android:value="25.3.0" />

<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />

<application
android:allowBackup="true"
android:debuggable="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme" >

<!--
The API key for Google Maps-based APIs is defined as a string resource.
(See the file "res/values/google_maps_api.xml").
Note that the API key is linked to the encryption key used to sign the APK.
You need a different API key for each encryption key, including the release key that is used to
sign the APK for publishing.
You can define the keys for the debug and release targets in src/debug/ and src/release/.
-->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />

<activity
android:name="com.example.sam.duluthbikes.MenuActivity"
android:label="@string/title_activity_maps" >
</activity>
<activity android:name="com.example.sam.duluthbikes.MainActivity" />

<fragment android:name=".AboutFragment" />
<fragment android:name=".DiscountFragment" />
<fragment android:name=".EventsFragment" />
<fragment android:name=".ReportFragment" />
<fragment android:name=".ToursFragment" />
<fragment android:name=".RideHistoryFragment" />

<activity android:name="com.example.sam.duluthbikes.EndRideActivity" />
<activity
android:name="com.example.sam.duluthbikes.LoginActivity"
android:label="@string/title_activity_maps" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.google.android.gms.common.api.GoogleApiActivity"
android:exported="false"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />

<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
</application>

</manifest>

主/AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<!--suppress ALL -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sam.duluthbikes">

<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
Google Maps Android API v2, but you must specify either coarse or fine
location permissions for the 'MyLocation' functionality.
-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />

<!-- To auto-complete the email text field in the login form with the user's emails -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>


<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera2" android:required="false" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">

<!--
The API key for Google Maps-based APIs is defined as a string resource.
(See the file "res/values/google_maps_api.xml").
Note that the API key is linked to the encryption key used to sign the APK.
You need a different API key for each encryption key, including the release key that is used to
sign the APK for publishing.
You can define the keys for the debug and release targets in src/debug/ and src/release/.
-->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />

<activity
android:name=".MenuActivity"
android:label="@string/title_activity_maps">

</activity>
<activity android:name=".MainActivity" />
<fragment android:name=".AboutFragment" />
<fragment android:name=".DiscountFragment" />
<fragment android:name=".EventsFragment" />
<fragment android:name=".ReportFragment" />
<fragment android:name=".ToursFragment" />
<fragment android:name=".RideHistoryFragment" />
<activity android:name=".EndRideActivity" />
<activity
android:name=".LoginActivity"
android:label="@string/title_activity_maps">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>

错误

Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:compileDebugAndroidTestSources, :app:compileDebugUnitTestSources, :app:compileDebugSources]
C:\Users\barda\Desktop\College\Fall2017\SoftwareEngineering\GroupBikes\duluthBikes-master\duluthBikes-master\android\app\build\intermediates\manifests\full\debug\AndroidManifest.xml
Error:(72) error: unknown element <fragment> found.
Error:(73) error: unknown element <fragment> found.
Error:(74) error: unknown element <fragment> found.
Error:(75) error: unknown element <fragment> found.
Error:(76) error: unknown element <fragment> found.
Error:(77) error: unknown element <fragment> found.
Error:(72) unknown element <fragment> found.
Error:(73) unknown element <fragment> found.
Error:(74) unknown element <fragment> found.
Error:(75) unknown element <fragment> found.
Error:(76) unknown element <fragment> found.
Error:(77) unknown element <fragment> found.
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt
Information:BUILD FAILED in 1s
Information:16 errors
Information:0 warnings
Information:See complete output in console

最佳答案

您可能有一个打开的目录,该目录锁定了该文件夹。因此IDE无法在重新编译时删除它。

如果您检查是否打开了该窗口 - 请先关闭该文件夹,然后运行 ​​

构建->清理项目。

然后

Build->rebuild project it may work for you.

您可以尝试的另一件事是删除中间文件夹并从头开始重建它们。简而言之,问题与构建文件的缓存有关。

关于xml - 调试/AndroidManifest 中的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47062084/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com