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.
Related
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?
I am getting the error "Tag attribute package has invalid character ' '." in the Android Manifest, while there is no obviously invalid character. Here is the code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.exampl e.harounsmida.test2"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="22" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:name="com.example.harounsmida.test2.app.AppController"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.harounsmida.test2.LoginActivity"
android:label="#string/app_name"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustPan" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.harounsmida.test2.RegisterActivity"
android:label="#string/app_name"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustPan" />
<activity
android:name="com.example.harounsmida.test2.MainActivity"
android:label="#string/app_name"
android:launchMode="singleTop" />
<activity
android:name="com.example.harounsmida.test2.UploadToServerActivity"
android:label="#string/app_name"
android:launchMode="singleTop" />
</application>
</manifest>
I don't understand where is the problem, Android Studio says that "File under the build folder are generated and should not be edited." although I didn't edit it.
Remove space from package name :
package="com.exampl e.harounsmida.test2"
After removing space :
package="com.example.harounsmida.test2"
For those who still can't solve this problem :
1 - Close Android Studio.
2 - Browse to your project directory.
3 - Rename the project directory name to something else.
4 - Open Android Studio and open your project (browse to the renamed directory) .
5 - Select Build --> Edit Flavors --> Type something like yourname.myapplication in application id textbox (avoid using non English characters or space)
Image
6 - Select Build --> Rebuild Project and you are good to go.
Please consider gradle file and see what you have given as applicationId, any name that you have given in applicationId will be copied from gradle file and pasted to manifest
Also see for space and extra character in package's value
Try this code
package="com.example.harounsmida.test2"
remove the space in your package definition because space is not allowed
After throwing the error as mentioned above, Android Studio opens the file "debug\AndroidManifest.xml". Note that the Manifest file for the project is "main\AndroidManifest.xml". I didn't notice initially and was removing the space from the former file (which Android Studio opens up).
Hope it helps!
I've been following this tutorial to create an android game. I downloaded the skeleton he provided but changed one of my packages from robotgame to highst. Whenever I try and deploy the application with the example code to my device I get the following error.
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.ronyo.robotgame/com.ronyo.highst.Loader }
Error type 3
Error: Activity class {com.ronyo.robotgame/com.ronyo.highst.Loader} does not exist.
I've searched for an instance of robotgame in my project and I can't find an instance of it. The tutorial above is created using Eclipse and I'm porting it to Android Studio. I'm wondering if I've overlooked something when switching IDEs?
Here is my AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ronyo.highst"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:icon="#drawable/icon"
android:label="Loader" >
<activity
android:name=".Loader"
android:configChanges="keyboard|keyboardHidden|orientation"
android:label="Loader"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.inten.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Delete the folders .idea and .gradle then click button "Sync project with gradle files"
It looks like the package wasn't updated everywhere. Have you changed anything in the manifest?
In the AndroidManifest.xml file, in the <manifest tag, there should be a package attribute. That needs to be updated to match your new package name, com.ronyo.highst.
Check out the documentation here: http://developer.android.com/guide/topics/manifest/manifest-element.html
don't change it directly , It'll not update all the references, use this
right click on project > Android tools > Rename application package
I am currently busy in designing a custom view for my major project. I ran through custom view tutorial provided at developer.android.com . I downloaded the associated sharable project because it gets easy to handle and understand the mechanism of the application when source code is in front of you. To my surprise, the project only contains two folders, src and res and there was no android-manifest file. I tried normal import method, import from existing code and createing new project from exsting android code, no luck with any of the methods. Here the link for the project.
Can somebody please explain to me how I can get it working ?
Can somebody please explain to me how I can get it working ?
Create an empty Android project. Copy in the res/ and src/ from the ZIP file. Modify the manifest to point to the activity class that you copied from the ZIP file.
Create a new empty android project. Copy all resources and source files to your project folder.
http://developer.android.com/guide/topics/manifest/manifest-intro.html.
Goto AndroidManifest.xml define activities and permissions accordingly.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="package name"
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"
android:theme="#style/AppTheme" >
<activity
android:name="packagename.MainActivity"//your 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="packagename.SecondActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="packagename.SecondActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
When I run the project the .apk file get uploaded and installed successfully on the device but AVD unbale to launch. Please help me to solve this issue.
Manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.bottleworks.dailymoney.core">
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
If it gives message "unable to upload file timeout" or something similar to that then close the emulator and run the app again
Otherwise post the logcat here to get better kind of solution
Make sure that the list of existing AVDs located in this folder
C:\Users\youruser\.android\avd
or test it this way :
1- right click in your app
2- run as => run configurations
3- Target Tab => manager
and post your error if you have any
you need to add application tag also in manifest.xml file.
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
>
<activity
android:name=".SplahScreenActivity"
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=".OtherActivity"
android:screenOrientation="portrait" >
</activity>
</application>