Tag: android manifest

如何解决“生成最终归档时出错:重复条目:AndroidManifest.xml”

我把两个项目放到Eclipse中,称为Project1和Project2。 Project1是独立的,但Project2必须依赖于Project1。 当我构buildProject2时,错误消息如下所示:生成最终归档时出错:重复条目:AndroidManifest.xml

清单文件中是否可以将广播接收器定义为内部类?

我想在我的主要活动中创build一个广播接收器作为内部类。 但我有定义在清单xml文件广播接收机的问题,因为android找不到它。 码: public class MyActivity extends Activity{ … public class Receiver extends BroadcastReceiver{ @Override public void onReceive(Context context, Intent intent) { …. } } … } performance: <receiver android:name=".org.danizmax.myapp.MyActivity$Receiver" android:enabled="true"> <intent-filter> <action android:name="org.danizmax.myapp.BROADCAST_INITIAL_DATA"></action> </intent-filter> </receiver> 我试着用: .org.danizmax.myapp.MyActivity $接收器 org.danizmax.myapp.MyActivity $接收器 .MyActivity $接收器 。接收机 我看到其他人也有类似的问题,但没有find任何答案。 那可能吗? 如果没有,使用广播接收机的更好方法是什么? 谢谢!

深层链接意图不起作用

我遵循https://developer.android.com/training/app-indexing/deep-linking.html上的规则 ,但是当我想通过adb触发intent时: adb shell am start -W -a android.intent.action.BROWSEABLE -d "http://example.com/gizmos" com.myapp.android 我刚刚得到 Error: Activity not started, unable to resolve Intent { act=android.intent.action.VIEW dat=example://gizmos flg=0x10000000 pkg=com.myapp.android } <activity android:name=".activities.DeepLinkActivity" android:label="@string/title_activity_deep_link"> <meta-data android:name="android.app.searchable" android:resource="@xml/searchable" /> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="http" android:host="example.com" android:pathPrefix="/gizmos" /> </intent-filter> </activity> 我有没有犯过明显的错误?

摆脱“导出服务不需要许可”的警告

我正在寻找一个解决scheme来摆脱这个警告。 我甚至不明白为什么会出现。 我看了一个没有警告的SDK例子。 起初,这里是我的清单,我得到的警告导出服务不需要权限 : <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.android" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" /> <uses-feature android:name="android.hardware.camera" android:required="true" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.USE_CREDENTIALS" /> <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" /> <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" /> <uses-permission android:name="android.permission.READ_SYNC_SETTINGS" /> <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/Theme.Sherlock"> <service android:name=".AuthenticationService" android:exported="true"> <intent-filter> <action android:name="android.accounts.AccountAuthenticator" /> </intent-filter> <meta-data android:name="android.accounts.AccountAuthenticator" android:resource="@xml/authenticator" […]

在AndroidManifest xml文件中使用android:supportsRtl =“true”是什么意思?

每当我在android studio中创build新项目时,我在我的应用程序AndroidManifest文件中获得了android:supportsRtl="true" 。 <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme"> … </application> 什么是在应用程序中使用,或者什么是我的应用程序AndroidManifest添加或不添加时的优势和劣势。

清单合并失败错误

我正在将我当前的项目巨大的应用程序移动到Android Studio和Gradle。 我目前被困在以下问题: Error:(87, 9) Execution failed for task ':App:processDebugManifest'. > Manifest merger failed : Attribute application@label value=(@string/app_label) from AndroidManifest.xml:87:9 is also present at ANDROID_APPLICATION:Library:unspecified:9:18 value=(@string/app_name) Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:82:5 to override 我已经尝试将以下属性添加到主AndroidManifest.xml文件中: tools:replace="android:label, *App Name*" tools:replace="android:label, @string/app_label" tools:replace="android:label" 这些属性定义都不起作用。 我究竟做错了什么?

Android库清单与应用程序清单

我在这里读过类似的问题,但是在一些事情上我还不清楚。 使用图书馆项目意味着我的整个项目将有两个清单 – 一个用于图书馆,另一个用于“主”应用程序项目 – 我不清楚在哪些方面或如果有一些冗余。 我正在开发一个具有“精简版”和“付费”版本的应用程序部件,因此几乎所有的代码都在一个库项目中。 作为一个小部件,图书馆将至less有一个接收器,一个服务,一个configuration活动,以及一些其他的活动。 那么应该在哪里声明这些组件的完整声明(包括意图,filter等)呢? 他们是否进入图书馆清单,或在申请包本身的清单中,引用图书馆中的类(例如android:name =“com.foo.mylibrary.MyService”)? 我所看到的一些例子似乎是在两个清单中都宣布它们,但是我怀疑把它们放在一个或另一个中是没有用的。

Android回购清单存储库如何工作?

Android源代码是一个很大的git仓库层次结构 。 它们由称为回购的自定义脚本pipe理。 Repo使用manifest.xml来确定要pipe理的git存储库。 Android的manifest.xml与其他所有git仓库一起被托pipe在一个git仓库中。 这个存储库在Android中如何pipe理? 具体来说,每个分支托pipe的不同分支和不同文件是如何组织的?

我的debuggingAndroidManifest.xml给我“无法解决符号错误”

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="ac.tec.oop.ahorcado.android" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="16"/> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme"> <activity android:label="@string/app_name" android:name="ac.tec.oop.ahorcado.android.MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application> </manifest> 这些行给我“不能解决符号错误”,即使它们需要被引用的包明确写入。 我试图解决这个小时,但我不知道还有什么要做。 我正在使用Android Studio,并导致了很多问题。 android:icon="@drawable/ic_launcher android:label="@string/app_name" android:theme="@style/AppTheme"> android:name="ac.tec.oop.ahorcado.android.MainActivity">

Android Studio有两种不同的清单文件

我在Android Studio中为定义两个不同的清单文件时遇到了问题。 这是我目前的项目结构: free风格的AndroidManifest.xml如下所示: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="se.example.package"> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> </manifest> main风格中的AndroidManifest.xml没有使用权限,但包含了所有风格之间共享的其他清单代码。 专业版的AndroidManifest.xml如下所示: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="se.example.package"> <uses-permission android:name="com.android.vending.CHECK_LICENSE" /> </manifest> build.gradle定义了两种风格 productFlavors { free { applicationId 'se.example.package.free' minSdkVersion 14 targetSdkVersion 21 versionCode 1 versionName '1.0' } pro { minSdkVersion 14 applicationId 'se.example.package.pro' targetSdkVersion […]