I am developing an application in which i found the error in the manifest file.
my xml file
<?xml version="1.0" encoding="utf-8"?>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
Google Maps Android API v2, but are recommended.
-->
<application
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/MyMaterialTheme" >
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="#string/google_maps_key" />
<activity
android:name=".activity.SplashActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#style/MyMaterialTheme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activity.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MapsActivity"
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=".activity.HomeFragment"/> -->
<!-- <activity android:name=".activity.MessagesFragment"/> -->
<!-- Admission Activity -->
<activity android:name=".activity.AdmissionActivity" />
<activity android:name=".activity.HomeFragment" />
<!-- Admission Activity -->
<activity android:name=".activity.OverViewActivity" />
<!-- <activity android:name=".activity.Tab1Fragment"/> -->
<!-- <activity android:name=".activity.Tab2Fragment" /> -->
<activity android:name=".activity.MessagesFragment" />
<activity android:name=".activity.AboutActivity" />
<activity android:name=".activity.FriendsFragment" />
<activity android:name=".activity.ContactFragment" />
<activity android:name=".activity.CampusFragment" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="#string/google_maps_key" />
</application>
Error:
Error parsing XML: not well-formed (invalid token)
What could be possibly wrong.
Add this first in your manifest .
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="add package name"
android:installLocation="auto"
android:versionCode="1"
android:versionName="1.0" >
<application
.....
</application>
</manifest>
you using this line as Two times,
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="#string/google_maps_key" />
If your code is copyed from other place and then pasted, the format of code may not be "utf-8", try hand typing the code again, or you can move the mouse to the wrong layout, click the right mouse button to select "Source" and then select "Format". I'm not sure about this, wish I could help you.
Related
I get the following error when I run the application on my phone via Android Studio.
I have checked, there is no version of this app installed on any of the user accounts on my phone. My build.gradle file contains defaultConfig.applicationId = "com.fyp.agripoint"
Here is the AndroidManifest.xml file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.fyp.agripoint">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="AgriPointApp"
android:supportsRtl="true">
<activity
android:name=".MainActivity"
android:theme="#style/AppChildTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".buysell.MainActivityMap"
android:theme="#style/AppChildTheme">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />
</activity>
<activity
android:name=".calendar.MainActivityCalendar"
android:theme="#style/AppChildTheme">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />
</activity>
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/google_maps_key" />
<service
android:name=".location.LocationService"
android:enabled="true"
android:exported="true" />
<service
android:name=".location.test"
android:enabled="true"
android:exported="true" />
<activity
android:name=".mandi.MandiRateActivity"
android:theme="#style/AppChildTheme" />
<meta-data
android:name="io.fabric.ApiKey"
android:value="my_key" />
<activity
android:name=".profile.ProfileActivity"
android:theme="#style/AppChildTheme" />
<activity
android:name=".profile.PrefsActivity"
android:theme="#style/AppChildTheme" />
<activity
android:name=".profile.EditProfileActivity"
android:theme="#style/AppChildTheme" />
<activity
android:name=".events.MainActivityEvent"
android:theme="#style/AppChildTheme" />
<receiver
android:name=".events.AlarmReceiver"
android:process="remote" />
<service
android:name=".events.NotificationService"
android:enabled="true"
android:exported="true" />
<activity
android:name=".articles.MainActivityArticles"
android:theme="#style/AppChildTheme" />
<activity
android:name=".articles.ArticleDetail"
android:theme="#style/AppChildTheme" />
</application>
</manifest>
Specify complete activity name in manifest.
Always use:
www.yourcompany.com.MainActivity
instead of :
.MainActivity
I'd like to release my app on the google play store. Currently the app's name is shown right, but in the options to uninstall the app, it's full package name is shown and I'd like to avoid this and instead show the app's name there, too.
Is this possible and if so how would I accomplish it?
Here's my manifest file
<?xml version="1.0" encoding="utf-8"?>
<!--
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.INTERACT_ACROSS_USERS_FULL" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="com.sonyericsson.home.permission.BROADCAST_BADGE" />
<!-- GCM -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:icon="#drawable/ic_icon"
android:name="android.support.multidex.MultiDexApplication"
android:largeHeap="true"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.Light.NoActionBar" >
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id" />
<provider
android:name="com.facebook.FacebookContentProvider"
android:authorities="com.facebook.app.FacebookContentProvider12345678"
android:exported="true" />
<activity
android:name=".SplashScreen"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar" >
</activity>
<activity
android:name=".AddActivity"
android:label="#string/title_activity_add"
android:parentActivityName=".MainActivity"
android:theme="#style/AppTheme.NoActionBar" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.app.name.MainActivity" />
</activity>
<activity
android:name=".DiscoverActivity"
android:label="#string/title_activity_discover"
android:parentActivityName=".MainActivity"
android:theme="#style/AppTheme.NoActionBar" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.app.name.MainActivity" />
</activity>
<activity
android:name=".DetailActivity"
android:label="#string/title_activity_detail"
android:parentActivityName=".MainActivity"
android:theme="#style/Theme.AppCompat.Light.NoActionBar" >
</activity>
<activity
android:name=".ProfileActivity"
android:label="#string/title_activity_profile"
android:theme="#style/Theme.AppCompat.Light.NoActionBar" >
</activity>
<activity
android:name=".EditProfileActivity"
android:label="#string/title_activity_edit_profile"
android:parentActivityName=".ProfileActivity"
android:theme="#style/Theme.AppCompat.Light.NoActionBar" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.app.name.ProfileActivity" />
</activity>
<!--
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" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name=".MapsActivity"
android:label="#string/title_activity_maps"
android:screenOrientation="portrait" >
</activity>
<!-- FACEBOOK ACTIVITY -->
<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="#string/app_name"
android:theme="#android:style/Theme.Translucent.NoTitleBar" />
<activity
android:name=".FriendsActivity"
android:label="#string/title_activity_friends"
android:theme="#style/Theme.AppCompat.Light.NoActionBar" >
</activity>
<activity
android:name=".RegisterActivity"
android:label="#string/title_activity_register"
android:theme="#style/Theme.AppCompat.Light.NoActionBar" >
</activity>
<activity
android:name=".NotificationsActivity"
android:label="#string/title_activity_notifications"
android:theme="#style/Theme.AppCompat.Light.NoActionBar" >
</activity>
<!-- GCM -->
<!-- [START gcm_receiver] -->
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="gcm.play.android.samples.com.gcmquickstart" />
</intent-filter>
</receiver>
<service
android:name=".MyGcmListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<service
android:name=".MyInstanceIDListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID" />
</intent-filter>
</service>
<service
android:name=".NotificationService"
android:exported="false" >
</service>
<!-- make API to register app to GCM available -->
<service
android:name=".RegistrationIntentService"
android:exported="false" >
<intent-filter>
<action
android:name="com.google.android.gms.iid.InstanceID"
android:permission="com.google.android.c2dm.permission.RECEIVE" />
</intent-filter>
</service>
<activity
android:name=".EditActivity"
android:label="#string/title_activity_edit"
android:theme="#style/Theme.AppCompat.Light.NoActionBar" >
</activity>
<activity
android:name=".BasesActivity"
android:label="#string/title_activity_bases"
android:theme="#style/Theme.AppCompat.Light.NoActionBar" >
</activity>
<activity
android:name=".SettingsActivity"
android:label="#string/title_activity_settings"
android:theme="#style/Theme.AppCompat.Light.NoActionBar" >
</activity>
</application>
android:label was missing in manifests application tag. When I added it first nothing changed but I tested it again today and the "error" is gone.
Just remove android:name="android.support.multidex.MultiDexApplication" from your application tag in AndroidManifest file ,it will definitely remove the problem.
I am a novice trying to figure out the error. But I have reached upon no solution even after trying it several times.
I am sharing the android-manifest.xml file code. More details are after this code.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.home.timestopper" >
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".StopwatchActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:name="com.applozic.application.key"
android:value="API_KEY" /> <!-- Applozic Application Key -->
<meta-data android:name="com.applozic.mobicomkit.notification.icon"
android:resource="#drawable/mobicom_ic_launcher" /> <!-- Launcher Icon -->
<meta-data android:name="com.applozic.mobicomkit.notification.smallIcon"
android:resource="YOUR_LAUNCHER_SMALL_ICON" /> <!-- Launcher white Icon -->
<meta-data android:name="share_text"
android:value="Talk about time!..the essence of life." /> <!-- Invite Message -->
<meta-data android:name="main_folder_name"
android:value="#string/default_media_location_folder" /> <!-- Attachment Folder Name -->
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="GEO_KEY" /> <!--Replace with your geo api key from google developer console -->
<!-- For testing purpose use
To disable the location sharing via map add this line ApplozicSetting.getInstance(context).disableLocationSharingViaMap(); in onSuccess of Applozic UserLoginTask -->
<meta-data android:name="activity.open.on.notification"
android:value="com.applozic.mobicomkit.uiwidgets.conversation.activity.ConversationActivity" /> <!-- NOTE : Do NOT change this value -->
<meta-data android:name="com.package.name"
android:value="${applicationId}" /> <!-- NOTE: Do NOT change this, it should remain same i.e 'com.package.name' -->
<receiver android:name="com.applozic.mobicomkit.uiwidgets.notification.MTNotificationBroadcastReceiver">
<intent-filter>
<action android:name="${applicationId}.send.notification" />
</intent-filter>
</receiver>
<activity android:name="com.applozic.mobicomkit.uiwidgets.conversation.activity.ConversationActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="#string/app_name"
android:parentActivityName=".StopwatchActivity"
android:theme="#style/ApplozicTheme"
android:launchMode="singleTask" >
<!-- Parent activity meta-data to support API level 7+ -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".StopwatchActivity" />
</activity>
<activity android:name="com.applozic.mobicomkit.uiwidgets.people.activity.MobiComKitPeopleActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="#string/activity_contacts_list"
android:parentActivityName="com.applozic.mobicomkit.uiwidgets.conversation.activity.ConversationActivity"
android:theme="#style/Applozic.People.Theme"
android:windowSoftInputMode="adjustResize">
<!-- Parent activity meta-data to support API level 7+ -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.applozic.mobicomkit.uiwidgets.conversation.activity.ConversationActivity" />
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="#xml/searchable_contacts" />
</activity>
<activity android:name="com.applozic.mobicomkit.uiwidgets.conversation.activity.FullScreenImageActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="Image"
android:parentActivityName="com.applozic.mobicomkit.uiwidgets.conversation.activity.ConversationActivity"
android:theme="#style/Applozic_FullScreen_Theme">
<!-- Parent activity meta-data to support API level 7+ -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.applozic.mobicomkit.uiwidgets.conversation.activity.ConversationActivity" />
</activity>
<activity
android:name="com.applozic.mobicomkit.uiwidgets.conversation.activity.ContactSelectionActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleTop"
android:parentActivityName="com.applozic.mobicomkit.uiwidgets.conversation.activity.ConversationActivity"
android:theme="#style/ApplozicTheme">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.applozic.mobicomkit.uiwidgets.conversation.activity.ConversationActivity" />
</activity>
<activity
android:name="com.applozic.mobicomkit.uiwidgets.conversation.activity.ChannelCreateActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleTop"
android:parentActivityName="com.applozic.mobicomkit.uiwidgets.conversation.activity.ConversationActivity"
android:theme="#style/ApplozicTheme">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.applozic.mobicomkit.uiwidgets.conversation.activity.ConversationActivity" />
</activity>
<activity android:name="com.applozic.mobicomkit.uiwidgets.conversation.activity.ChannelNameActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleTop"
android:parentActivityName="com.applozic.mobicomkit.uiwidgets.conversation.activity.ConversationActivity"
android:theme="#style/ApplozicTheme">
</activity>
<activity android:name="com.applozic.mobicomkit.uiwidgets.conversation.activity.ChannelInfoActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleTop"
android:parentActivityName="com.applozic.mobicomkit.uiwidgets.conversation.activity.ConversationActivity"
android:theme="#style/ApplozicTheme">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.applozic.mobicomkit.uiwidgets.conversation.activity.ConversationActivity" />
</activity>
<activity
android:name="com.applozic.mobicomkit.uiwidgets.conversation.activity.MobiComAttachmentSelectorActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleTop"
android:parentActivityName="com.applozic.mobicomkit.uiwidgets.conversation.activity.ConversationActivity"
android:theme="#style/ApplozicTheme"
android:windowSoftInputMode="stateHidden|adjustResize">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.applozic.mobicomkit.uiwidgets.conversation.activity.ConversationActivity" />
</activity>
<activity android:name="com.applozic.mobicomkit.uiwidgets.conversation.activity.MobicomLocationActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:parentActivityName="com.applozic.mobicomkit.uiwidgets.conversation.activity.ConversationActivity"
android:theme="#style/ApplozicTheme"
android:windowSoftInputMode="adjustResize">
</activity>
<service android:name="com.applozic.mobicomkit.api.conversation.MessageIntentService"
android:exported="false" />
<service android:name="org.eclipse.paho.android.service.MqttService" />
<service android:name="com.applozic.mobicomkit.api.conversation.ApplozicIntentService"
android:exported="false" />
<service android:name="com.applozic.mobicomkit.api.conversation.ApplozicMqttIntentService"
android:exported="false" />
<receiver android:name="com.applozic.mobicomkit.broadcast.TimeChangeBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.TIME_SET" />
<action android:name="android.intent.action.TIMEZONE_CHANGED" />
</intent-filter>
</receiver>
<receiver android:name="com.applozic.mobicomkit.broadcast.ConnectivityReceiver"
android:exported="true" android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
</intent-filter>
</receiver>
<receiver android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="<APP_PKG_NAME>" />
</intent-filter>
</receiver>
<service android:name=".pushnotification.ApplozicGcmListenerService">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<service android:name=".pushnotification.GcmInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID" />
</intent-filter>
</service>
</application>
<uses-permission android:name="com.example.home.timestopper.pushnotification.permission.C2D_MESSAGE" />
<uses-permission android:name="com.example.home.timestopper.pushnotification.permission.MAPS_RECEIVE" />
<permission android:name="com.example.home.timestopper.pushnotification.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<permission android:name="com.example.home.timestopper.pushnotification.permission.MAPS_RECEIVE" android:protectionLevel="signature" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
</manifest>
So, what I am trying to do here is to integrate a chat feature in a small time-stopper app that I just created for the learning purpose and I am integrating it also for the learning purpose.
When I build gradle,Result shows Error:The value of attribute "android:name" associated with an element type "null" must not contain the '<' character.
and
Error:Cannot read packageName from C:\Users\APnaturals\AndroidStudioProjects\TimeStopper\app\src\main\AndroidManifest.xml
When I replace APP_PKG_NAME with the one mentioned in here
manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.home.timestopper"
Gradle Build fails again without giving any cause.
<category android:name="<APP_PKG_NAME>" />
Looks like you forgot to configure your package name in this element.
Simply remove the APP_PKG_NAME from metadata and put your package name or ID, as in androidmanifest.xml not allow <>.
I am a game designer and unity developer, i rarely do any android native development and i was hoping that you guys can help me with this, in this manifest, what is the main Activity?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" android:theme="#android:style/Theme.NoTitleBar" package="com.juiceglobal.lines" android:versionName="1.0" android:versionCode="1">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<application android:icon="#drawable/app_icon" android:label="#string/app_name" android:debuggable="true" android:name="com.soomla.SoomlaApp">
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:launchMode="singleTask" android:label="#string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="portrait">
</activity>
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity" android:launchMode="singleTask" android:label="#string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="portrait">
<meta-data android:name="android.app.lib_name" android:value="unity" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>
<activity android:name=".Main" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:label="#string/app_name">
</activity>
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
<activity android:name="com.unity3d.player.UnityPlayerProxyActivity" android:launchMode="singleTask" android:label="#string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>
<!-- Google Play -->
<!-- -->
<!-- -->
<meta-data android:name="billing.service" android:value="google.GooglePlayIabService" />
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
<!-- End Google Play -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- voluum -->
<receiver android:exported="true" android:name="com.voluum.sdk.VoluumForwardingBroadcastReceiver">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<!-- End voluum -->
<!-- -->
<!-- -->
<!-- HeyZap -->
<activity android:name="com.heyzap.sdk.ads.HeyzapInterstitialActivity" android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize" />
<activity android:name="com.heyzap.sdk.ads.HeyzapVideoActivity" android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize" />
<activity android:name="com.heyzap.sdk.ads.HeyzapProxyActivity" />
<!--<activity android:name="com.heyzap.sdk.ads.VASTActivity" />-->
<receiver android:name="com.heyzap.sdk.ads.PackageAddedReceiver">
<intent-filter>
<data android:scheme="package" />
<action android:name="android.intent.action.PACKAGE_ADDED" />
</intent-filter>
</receiver>
<!-- End HeyZap -->
<!-- -->
<!-- -->
<!-- Others -->
<activity android:name="com.mobilefuel.sdk.AdInterstitialActivity" android:configChanges="orientation|keyboardHidden|screenSize" android:label="AD" android:exported="false" />
<activity android:name="com.soomla.store.billing.google.GooglePlayIabService$IabActivity" android:theme="#android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity android:name="com.facebook.unity.FBUnityLoginActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="#android:style/Theme.Translucent.NoTitleBar.Fullscreen">
</activity>
<activity android:name="com.facebook.unity.FBUnityDialogsActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="#android:style/Theme.Translucent.NoTitleBar.Fullscreen">
</activity>
<activity android:name="com.facebook.LoginActivity" android:configChanges="keyboardHidden|orientation" android:theme="#android:style/Theme.Translucent.NoTitleBar.Fullscreen">
</activity>
<activity android:name="com.facebook.unity.FBUnityDeepLinkingActivity" android:exported="true">
</activity>
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="\ 503591776472556" />
<!--End Others -->
<!-- TrialPay activities -->
<activity android:name="com.trialpay.android.views.webcontainer.WebContainerActivity" android:hardwareAccelerated="true" android:launchMode="singleTop" android:windowSoftInputMode="adjustResize" android:theme="#android:style/Theme.NoTitleBar" android:screenOrientation="fullSensor" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale">
<meta-data android:name="android.app.lib_name" android:value="unity" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>
<activity android:name="com.trialpay.android.views.webcontainer.WebContainerPopupActivity" android:hardwareAccelerated="true" android:launchMode="singleTop" android:windowSoftInputMode="adjustResize" android:theme="#android:style/Theme.Translucent.NoTitleBar" android:screenOrientation="fullSensor" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale">
<meta-data android:name="android.app.lib_name" android:value="unity" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>
<activity android:name="com.trialpay.android.views.videocontainer.VideoContainerActivity" android:hardwareAccelerated="true" android:theme="#android:style/Theme.NoTitleBar.Fullscreen" android:screenOrientation="fullSensor" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale">
<meta-data android:name="android.app.lib_name" android:value="unity" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>
<!--End TrialPay activities -->
</application>
<uses-feature android:glEsVersion="0x00020000" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="21" />
</manifest>
i need it in the initialization of another "plugin", i tried :
com.unity3d.player.UnityPlayer
com.unity3d.player.UnityPlayerActivity
com.unity3d.player.UnityPlayerProxyActivity
com.soomla.SoomlaApp
And i always get the same error :
AndroidJavaException: java.lang.NoSuchFieldError: no static field with name='one.of.the.package.above' signature='Ljava/lang/Object;' in class Lcom/unity3d/player/UnityPlayer;
EDIT
i can't share the entire class because it's not mine but this is the initialization that gives the error :
private const string MainActivityName = "com.unity3d.player.UnityPlayerProxyActivity";
public void ReportConversion(string payload)
{
using (AndroidJavaClass cls_UnityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
{
using (AndroidJavaObject obj_Activity = cls_UnityPlayer.GetStatic<AndroidJavaObject>(MainActivityName))
{
AndroidJavaClass cls_MainActivity = new AndroidJavaClass("com.companyName.voluum.Main");
cls_MainActivity.CallStatic("ReportConversion", obj_Activity, payload);
}
}
}
Thank you
com.unity3d.player.UnityPlayerProxyActivity is the main Activity in your app. The activity with the android.intent.category.LAUNCHER in the manifest file is always the main activity (starting activity).
Using currentActivity fixed the problem (literally typing currentActivity) when I do this call
private const string MainActivityName = "currentActivity";
using (AndroidJavaObject obj_Activity = cls_UnityPlayer.GetStatic<AndroidJavaObject>(MainActivityName)) ;
Manifest:
This was working fine before some time. Now it shows 0-supported devices!
Please help me on this.
Shows these features on console though I am not using it.
android.hardware.screen.PORTRAIT
android.hardware.TOUCHSCREEN
android.hardware.WIFI
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app.irb.wallpro"
android:versionCode="5"
android:versionName="1.0.5" >
<uses-sdk
android:minSdkVersion="8"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<!-- Include next permission if you want to allow UIL to cache images on SD card -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.SET_WALLPAPER_HINTS" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<application
android:name="com.irbrothers.wallpro.ui.WallProApplication"
android:allowBackup="true"
android:icon="#drawable/app_icon"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.irbrothers.wallpro.ui.SplashActivity"
android:label="#string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.irbrothers.wallpro.ui.PropertiesActivity"
android:configChanges="orientation"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.irbrothers.wallpro.ui.HomeActivity"
android:configChanges="orientation|screenSize"
android:launchMode="singleTask" >
</activity>
<activity
android:name="com.irbrothers.wallpro.ui.EULA"
android:configChanges="orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.irbrothers.wallpro.ui.AboutActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Black.NoTitleBar"
android:windowSoftInputMode="adjustPan" >
</activity>
<activity
android:name="com.startapp.android.publish.list3d.List3DActivity"
android:taskAffinity="com.app.irbrothers.wallpro.AppWall"
android:theme="#android:style/Theme" />
<activity
android:name="com.startapp.android.publish.AppWallActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:taskAffinity="com.app.irbrothers.wallpro.AppWall"
android:theme="#android:style/Theme.Translucent" />
<service android:name="com.irbrothers.wallpro.alarm.NotificationService" />
<receiver android:name="com.irbrothers.wallpro.recievers.NotificationAlarmReciever" >
<intent-filter>
<action android:name="com.irbrothers.notification" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.DATE_CHANGED" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.TIMEZONE_CHANGED" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.TIME_SET" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.TIME_TICK" />
</intent-filter>
</receiver>
</application>
</manifest>
Solved
Do not use any library which is already present in framework. Ex: "json-simple" here.