implementing Ubers usebutton sdk and AndroidManifest.xml - android

I am trying to use the Uber usebutton but each time, it crashes giving the following error:
Unable to find explicit activity class {com.heyjude.heyjudeapp/com.usebutton.sdk.internal.GroupedInventoryCardActivity}; have you declared this activity in your AndroidManifest.xml?
I am unsure what to put in the AndroidManifest, currently as per the docs I have:
<meta-data
android:name="com.usebutton.applicationid"
android:value="app-myId" />
But it's clearly not working...
I have some more information, I checked the manifest-merger-debug-report.txt and found the following line
REJECTED from [com.usebutton:android-sdk:5.0.1] /Users/adamkatz/Projects/LavaLamp/Hey Jude/heyjudestudio/app/build/intermediates/exploded-aar/com.usebutton/android-sdk/5.0.1/AndroidManifest.xml:13:5-43:19
Why would the library manifest be rejected and how to make it accepted?

The maifest stuff maybe a red herring, your probably missing a library (The Uber library).
Here's a typical (working) AndroidMainfest.xml.
VERY important:
package="com.example.html2pdf"
replace with your package name (it's normally in your (local package) GroupedInventoryCardActivity.java file).
VERY important: Html2pdfActivity"
replace with one entry for activity for all your Activity files .GroupedInventoryCardActivity in your case (full path best package plus activity with dots (full stop's separating things, normally no slashes).
VERY VERY important:
com.heyjude.heyjudeapp/com.usebutton.sdk.internal.GroupedInventoryCardActivity is reffering to a library Activity (also with a package name the forward slash links the two packages). That's o.k.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.html2pdf"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.html2pdf.Html2pdfActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
So package (replace/change):
package="com.heyjude.heyjudeapp"
and (replace/change/insert) Activity (name):
<activity
android:name="com.heyjude.heyjudeapp/com.usebutton.sdk.internal.GroupedInventoryCardActivity"
Hope this helps and not make it more confusing ;O)

All that goes into the AndroidManifest.xml file is this:
<application
<activity
<!-- your activities -->
</activity>
<!--Button SDK-->
<meta-data android:name="com.usebutton.applicationid" android:value="YOUR_BUTTON_APP_ID"/>
</application>
Did you remember to replace "YOUR_BUTTON_APP_ID" with your Button app ID found in the dashboard?

Related

Upload APK, google store - different package name

I am receiving this error whenever I try to upload my project to google play. However, I recently did a refactor - rename on my project package - "com.mike.myapplication1_0". I cleaned and rebuilt the file but I am still getting this error. I also updated the Manifest file as well...
Here is my manifest -
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.solomichael.myappppppp" >
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name="com.solomichael.myappppppp.MyAndroidAppActivity"
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="com.solomichael.myappppppp.probability_act"
android:label="#string/title_activity_probability_act"
android:parentActivityName="com.solomichael.myappppppp.MyAndroidAppActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.michael.myandroidappactivity.MyAndroidAppActivity" />
</activity>
<activity
android:name="com.solomichael.myappppppp.showOldCards"
android:label="#string/title_activity_show_old_cards"
android:parentActivityName="com.solomichael.myappppppp.MyAndroidAppActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.michael.myandroidappactivity.MyAndroidAppActivity" />
</activity>
</application>
The package name should be unique (across google play store!) so it seems that someone else already used : com.example or com.mike.myapplication1_0 you'll have to choose another name!
Comment:
If you already have an app in the app-store and you change the package name and re-upload the apk - you lose all your current users (their app won't get updated!)
In the <meta-data> elements of two of your Activities you have attributes starting as follows...
android:value="com.example.
I'm not entirely sure why you have <meta-data> elements for those Activities but you either need to change the values to reflect your package name or simply delete the <meta-data> elements completely unless they're absolutely necessary.

Element type "application" must be followed by either attribute specifications, ">" or "/>" #2

I keep getting an error that says, "Element type "application" must be followed by either attribute specifications, ">" or "/>"."
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.thenewboston.sammy"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
I'm getting the error right below this:
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
This is the right form, see if you didn't close some tags.
<application android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
...>
<activity ...>
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
As my friend said , check the right format
For me It was like this :
BEFORE :
<activity android:name=".DisplayMessageActivity" android:label="display_message_activity"
</activity>
AFTER:
<activity android:name=".DisplayMessageActivity" android:label="display_message_activity" >
</activity>
Then the error disappeared
In my case, a comment had been placed (by the build tools?) inside the application tag:
<application android:allowBackup="true"
<!-- android:debuggable="true" -->
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/GdxTheme">
After I removed the entire debuggable=true comment line - everything worked.
I just ran into this error for a completely different reason. For some reason Android Studio had replaced every instance of the string name with "name" (e.g. it wrapped them all in double quotes) in my XML. It completely broke everything.
I had to clear out the double quotes from everything, clean the project and rebuild it.
If you're a flutter developer and you're getting this exception you must know there are two AndroidManifest file in your flutter project. One is inside debug folder and another one is main folder. My main folder AndroidManifest is ok and well formatted but AndroidManifest in debug folder is not ok and not well formatted due to a git conflict.
you must fix this.

Android activity restarted at orientation change even with configChanges set

I have an Android library project and the main application that uses this library project. The manifest file of the main application looks as follows:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.test.myapp"
android:installLocation="preferExternal"
android:versionCode="3"
android:versionName="1.1" >
<uses-sdk android:minSdkVersion="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="android.permission.ACCESS_COARSE_LOCATION" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:screenOrientation="sensor"
android:configChanges="orientation|screenSize"
android:label="#string/app_name"
android:name="MyAppActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
</application>
</manifest>
I also override the onConfigurationChanged() method in the main application. Now when I run the application in the Android emulator and change the orientation via Ctrl+F11 the main activity of the application is restarted.
According to all notes I found here and on Google this should not happen when I have set the android:configChanges="orientation|screenSize" parameter in the manifest file ... but it does :(
Any ideas what I am missing here?
Thanks in advance!
If you use abs, it is a limitation, and you can't solve it. But you don't use that library, so
give this in the activity tag in manifest file
android:configChanges="keyboard|keyboardHidden|orientation"
remove that
android:screenOrientation="sensor"
You need to add keyboard|keyboardHidden to the android:configChanges attribute. Certainly on the emulator (and on certain devices, I think), when you change orientations the keyboard state also changes. This is also needed to prevent double-restarts of your activity when you don't have it handling orientation changes.

Cannot upload an .apk file to the market

I have developed a new application for Android and my application is completed. It doesn't have any errors except for a few (2) harmless warnings. I created an .apk package using the tools available in ECLIPSE. It created a key and an .apk file. Created all right. BUT when I upload the .apk file I get an error telling that I cannot use the following in front of the package name :[com.android,com.goolge,android,com.example]
Below is my manifest details
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.Scheduler"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="7"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:icon="#drawable/icon"
android:label=".SchedulerActivity" >
<activity
android:label="#string/app_name"
android:name=".SchedulerActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".addSubject"/>
<activity android:name=".Assignment"/>
<activity android:name=".CameraTake" android:screenOrientation="landscape"/>
<activity android:name=".view_details"/>
<activity android:name=".about"/>
<activity android:name=".help"/>
<activity android:name=".MyAlarmService"/>
<activity android:name=".Assignment_view"/>
<receiver android:name=".MyAlarmService" />
</application>
I tried some methods that are explained in here but it didn't work. Can anyone help me?
It is because of
package="android.Scheduler"
that you are getting this problem.
Notice in your file browser that you probably have src > android > scheduler
you cannot have android there.
all I can think of for a quick fix, is start a new project FROM that one, and in the setup set the package name to com.something.yourappname, but where "something" is do not include "google" or "android"
You have choosen incorrect package name "android.Scheduler", just change your package name.
For eg. if your name is "ravi" then choose package name something like this-
"com.ravi.scheduler".
Steps change package name (eclipse):-
Under your project folder just go to "src" then here you found "android.Scheduler" right click on it, choose "Refactor" -> "rename" & then write your desired package name like "com.ravi.scheduler" & click OK.
Now Rebuild/Run your project & then do application signing.
Now you are ready to upload your app to Google Play.

Android application not displaying in market

I have publish an application on market but is unable to see it on the market website. I hear that is may be due to the /lib in the folder. I got the /lib and have got the admob library in it. I need it. If i delete it, there would be an error. And changing from my current <uses-sdk android:minSdkVersion="3"/> to <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="4" /> doesn't help either. adding the extra targetSdkVersion just creates an error. Tried a direct url link also didn't work. Any solution for it?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="calc.calc"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".Calculator"
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="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation"/>
</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-sdk android:minSdkVersion="3"
/>
If you have a green checkmark and can see a label with the text saying "Published" in the top right corner of your app description in the Android Market Console (like here) then you may just have to wait some time.
In my case, app upgrades are not visible to all of the users instantly.

Categories

Resources