Adobe AIR packaging for Android - java

I seem to be getting this error... I believe I am typing everything correctly:
desktop/adobeairsdk/bin/adt -package -target apk -storetype pkcs12 -keystore ./desktop/mycert.p12 myApp.apk ./desktop/Untitled-1-app.xml -C ./desktop/Untitled-1.swf
To which I get:
unexpected failure: inputs not set
java.lang.IllegalStateException: inputs not set
at com.adobe.air.ApplicationPackager.createPackage(ApplicationPackager.java:59)
at com.adobe.air.ADT.parseArgsAndGo(ADT.java:504)
at com.adobe.air.ADT.run(ADT.java:361)
at com.adobe.air.ADT.main(ADT.java:411)
Here is the content of my .xml file:
<?xml version ="1.0" encoding="utf-8" ?>
<application xmlns="http://ns.adobe.com/air/application/2.5">
<id>com.adobe.example.Untitled-1</id>
<versionNumber>1.000</versionNumber>
<filename>Untitled-1</filename>
<description></description>
<name>Untitled-1</name>
<copyright></copyright>
<initialWindow>
<content>Untitled-1.swf</content>
<systemChrome>standard</systemChrome>
<transparent>false</transparent>
<visible>true</visible>
</initialWindow>
<supportedProfiles>mobileDevice</supportedProfiles>
<android>
<manifestAdditions>
<![CDATA[
<manifest android:installLocation='auto'>
<uses-permission android:name="android.permission.INTERNET" />
<supports-screens android:normalScreens="true"/>
<uses-feature android:required="true" android:name="android.hardware.touchscreen.multitouch"/>
<application android:enabled="true">
<activity android:excludeFromRecents="false">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
]]>
</manifestAdditions>
</android>
<customUpdateUI>false</customUpdateUI>
<allowBrowserInvocation>false</allowBrowserInvocation>
<icon>
<image16x16>AppIconsForAIRPublish/AirApp_16.png</image16x16><image32x32>AppIconsForAIRPublish/AirApp_32.png</image32x32><image48x48>AppIconsForAIRPublish/AirApp_48.png</image48x48><image128x128>AppIconsForAIRPublish/AirApp_128.png</image128x128></icon>
</application>
I am a bit stuck... any ideas? O_o
Thank you for your help in advance.

Look at this post. Probably you didn't build the project before packaging it. You'll only want to create the AIR package to redistribute your application.

I also have this problem. Then I reboot win7. It works well after that.

Related

How to add the <queries> tag in the manifest?

I have this code and I was told that for Android 11 I need to add the queries tag in manifest:
final PackageManager pm = getPackageManager();
Intent main = new Intent(Intent.ACTION_MAIN, null);
main.addCategory(Intent.CATEGORY_LAUNCHER);
List<ResolveInfo> packages = pm.queryIntentActivities(main, 0); //get a list of installed apps.
I was told it should be this:
<queries>
<intent>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent>
</queries>
Problem is I cannot add the <category> tag. Android Studio says that the element is not allowed there. I can only add the <action> and <data> tags inside <intent>. And it seems other people on SO have this problem too. It's strange because Android's own documentation instructs us to use the <category> tag there.
The <queries> section is introduced in API 30, so be sure you use it only if you target such version upward.
It is indeed needed when, for instance, you want to launch some other apps from yours, knowing only their package name. Otherwise, using the package manager will return you some null when using functions like packageManager.getLaunchIntentForPackage("com.yyy"). You can find more information here: Package visibility in Android 11
In your case, you can just write the section like this:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxx">
...
<queries>
<intent>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent>
</queries>
...
</manifest>

Android Hello World Example App: Error: Bad component name: com.example.sir.geo_app/

I'm working on my first android app using the walk-through provided by Android and I'm running into a problem (well, more than a few, but I can't find a solution to this one).
When I try to run the app in the Emulator I get the following error:
am get-config: retrieve the configuration and any recent configurations
of the device
<INTENT> specifications include these flags and arguments:
[-a <ACTION>] [-d <DATA_URI>] [-t <MIME_TYPE>]
[-c <CATEGORY> [-c <CATEGORY>] ...]
[-e|--es <EXTRA_KEY> <EXTRA_STRING_VALUE> ...]
[--esn <EXTRA_KEY> ...]
[--ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE> ...]
[--ei <EXTRA_KEY> <EXTRA_INT_VALUE> ...]
[--el <EXTRA_KEY> <EXTRA_LONG_VALUE> ...]
[--ef <EXTRA_KEY> <EXTRA_FLOAT_VALUE> ...]
[--eu <EXTRA_KEY> <EXTRA_URI_VALUE> ...]
[--ecn <EXTRA_KEY> <EXTRA_COMPONENT_NAME_VALUE>]
[--eia <EXTRA_KEY> <EXTRA_INT_VALUE>[,<EXTRA_INT_VALUE...]]
[--ela <EXTRA_KEY> <EXTRA_LONG_VALUE>[,<EXTRA_LONG_VALUE...]]
[--efa <EXTRA_KEY> <EXTRA_FLOAT_VALUE>[,<EXTRA_FLOAT_VALUE...]]
[--esa <EXTRA_KEY> <EXTRA_STRING_VALUE>[,<EXTRA_STRING_VALUE...]]
(to embed a comma into a string escape it using "\,")
[-n <COMPONENT>] [-f <FLAGS>]
[--grant-read-uri-permission] [--grant-write-uri-permission]
[--grant-persistable-uri-permission] [--grant-prefix-uri-permission]
[--debug-log-resolution] [--exclude-stopped-packages]
[--include-stopped-packages]
[--activity-brought-to-front] [--activity-clear-top]
[--activity-clear-when-task-reset] [--activity-exclude-from-recents]
[--activity-launched-from-history] [--activity-multiple-task]
[--activity-no-animation] [--activity-no-history]
[--activity-no-user-action] [--activity-previous-is-top]
[--activity-reorder-to-front] [--activity-reset-task-if-needed]
[--activity-single-top] [--activity-clear-task]
[--activity-task-on-home]
[--receiver-registered-only] [--receiver-replace-pending]
[--selector]
[<URI> | <PACKAGE> | <COMPONENT>]
Error: Bad component name: com.example.sir.geo_app/
Here's my Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sir.geo_app" >
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/CustomActionBarTheme" >
<activity
android:name=".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=".DisplayMessageActivity"
android:label="#string/title_activity_display_message"
android:parentActivityName=".MyActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.sir.geo_app.MyActivity" />
</activity>
</application>
</manifest>
Any help would be gratefully appreciated.
Thanks in advance!
You can't have an "_" in your java package name. So com.example.sir.geo_app should be com.example.sir.geo.app or com.example.sir.geoapp.
In Android this is illegal, see the answer here: Android - Package Name convention.
In Java, it should be alright: http://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html.
Your home/ root package should follow these standerds,
com.adobe.reader (Adobe Reader)
com.adobe.photoshop (Adobe Photoshop)
com.adobe.ideas (Adobe Ideas)
like wise ...

Error executing phonegap command cordova build

I'm executing the command "cordova build" (After finishing the above settings, exemplified this link Phonegap The Command-Line Interface).
But the note.js returns this error:
Generating config.xml from defaults for platform "android"
Preparing android project
Compiling app on platform "android" via command "cmd" /c
C:\Net\Phonegap\hello\platforms\android\cordova\build
Error: An error occurred while building the android project.Error executing "ant" debug -f "C:\Net\Phonegap\hello\platforms\android\build.xml"":
BUILD FAILED
C:\Net\templates\Phonegap\android-sdk\tools\ant\build.xml:601: The following error occurred while executing this line:
C:\Net\templates\Phonegap\android-sdk\tools\ant\build.xml:720: The following error occurred while executing this line:
C:\Net\templates\Phonegap\android-sdk\tools\ant\build.xml:734: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "C:\Program Files\Java\jre7"
Total time: 2 seconds
at ChildProcess. (C:\Users\myuserpc\AppData\Roaming\npm\node_modules\cordova\src\compile.js:65:22)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Socket. (child_process.js:956:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
My config.xml
<widget id="com.example.hello" version="0.0.1">
<name>HelloWorld</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="dev#callback.apache.org" href="http://phonegap.com">
Apache Cordova Team
</author>
<content src="index.html" />
<access origin="*" />
<preference name="Fullscreen" value="true" />
<preference name="WebViewBounce" value="true" />
<feature name="Device">
<param name="android-package" value="org.apache.cordova.device.Device" />
</feature>
And my AndroidManifest.xml
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" android:windowSoftInputMode="adjustPan" package="com.example.hello" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:debuggable="true" android:hardwareAccelerated="true" android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:configChanges="orientation|keyboardHidden|keyboard|locale" android:label="#string/app_name" android:name="HelloWorld" android:theme="#android:style/Theme.Black.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />
It looks like you currently have the Java Runtime Environment (JRE) installed. You need the Java Development Kit (JDK). You can get that over at Oracle. Your path does appear to be set up correctly with %JAVA_HOME%\bin. I believe once you install the JDK, your %JAVA_HOME% environment variable will be changed to something similar to: C:\Program Files\Java\jdk1.7.0_52. The version number might be slightly different of course.

Blank Screen Android 2.2 Google Maps v2

EDIT :
I transferred my 20+ projects that tries to use Google Maps for Android v2. After changing keys and stuff, now, it works. I don't know what made this work, but thank you all. I got one keystore, the key is right. I guess it magically fixed somehow. Well, thanks guys.
I'm doing searches for 2 days and I couldn't fix this problem. I did everything, yet, this application can not work.
I want my application to work on Android 2.2 and above. Like it says "if you create your app in level 8, it'll support 95% of market".
Here are my screenshots and source codes:
I'm pasting the source code which is the easiest to get. I took this from web.
Here's the output of the command
keytool -list -keystore <path>
***************** WARNING WARNING WARNING *****************
* The integrity of the information stored in your keystore *
* has NOT been verified! In order to verify its integrity, *
* you must provide your keystore password. *
***************** WARNING WARNING WARNING *****************
Keystore type: JKS Keystore provider: SUN
Your keystore contains 1 entry
androiddebugkey, 15.Mar.2013, PrivateKeyEntry,
Certificate fingerprint (SHA1): xxx
main.xml file:
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="AIzaSyDim-x5Gxxx"
/>
manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.androidhive.googlemaps"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<!-- Add Google Map Library -->
<uses-library android:name="com.google.android.maps" />
<activity
android:name=".AndroidGoogleMapsActivity"
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>
<!-- Allow to connect with internet -->
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
java file (no need to paste it all, but I guess it's best to paste it all)
http://pastebin.com/yF95Rcbd
Here are my screenshots:
http://i.imgur.com/gExHpUG.png
http://i.imgur.com/AMOXKhr.png
http://i.imgur.com/Aqon97Y.png
I'm trying to compile this app to Android 4.2.2, but I tried and want to make it work in 2.2 and above.
Here's the Android tab of the properties window just to make sure:
http://i.imgur.com/ht0CQwT.png
Here's my log
03-20 07:01:20.145: W/System.err(956): at java.lang.Thread.run(Thread.java:856)
03-20 07:01:20.665: W/System.err(956): IOException processing: 26
03-20 07:01:20.665: W/System.err(956): java.io.IOException: Server returned: 3
03-20 07:01:20.665: W/System.err(956): at android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
03-20 07:01:20.675: W/System.err(956): at android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473)
03-20 07:01:20.675: W/System.err(956): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.processDataRequest(DataRequestDispatcher.java:1117)
03-20 07:01:20.675: W/System.err(956): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(DataRequestDispatcher.java:994)
03-20 07:01:20.675: W/System.err(956): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(DataRequestDispatcher.java:1702)
These lines repeat all the time.
Thank you very much.
Your post appears to contain code that is not properly formatted as code" error made
me delete the blank lines. Sorry for the messed up codes.
http://i.imgur.com/ht0CQwT.png
See the snapshot. You did not add Google Play Services library that is require for displaying Google Android Map V2. Please download and add that library and then try again.
Please also see the target. Your target is 4.2.2 and your are accessing it on 2.2. Change the target to 2.2 and use support fragment.
Thanks,
I have solved this issue,
Open your Google APIs Console
Choose API Access
Edit allowed Android apps from your API Key
Change the package name with your package name
Example: 00:06:A5:0E:04:A2:1E:8F:FE:6B:7F:46:23:C3:xx:xx:xx:xx:xx:xx;com.example.androidmapview
You are missing permissions and meta-data for API KEY.
Read this carefully: https://developers.google.com/maps/documentation/android/start
Working with android mapapi v2 ,the main reason is you must add play service to your app,like below :
<permission
android:name="com.example.androidmapview.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.androidmapview.permission.MAPS_RECEIVE" />
Use fragment class in Layout:
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment"/>
And change your manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.androidmapview"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<permission
android:name="com.example.androidmapview.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.androidmapview.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.androidmapview.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>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"></meta-data>
</application>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
</manifest>
in activity:
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import com.google.android.gms.maps.SupportMapFragment;
public class MainActivity extends FragmentActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SupportMapFragment fragment = new SupportMapFragment();
getSupportFragmentManager().beginTransaction()
.add(android.R.id.content, fragment).commit();
}
}
For more info check the link which will explain you in details about api v2
I solved my blank screen problem with zoom in/out buttons like that.(it happens after I changed my package name)
Delete the keystore file
Create a new keystore file
Get SHA1 fingerprint
Go to API Console
Create a new Android App.
Paste your fingerprint
Use the given API Key in your Manifest File
That worked for me

AndroidManifest.xml errors

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android">
<application android:icon="#drawable/ic_launcher" android:label="#string/app_name">
<activity android:name=".hba1c" 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>
</application>
I'm trying to learn Java and need some help with AndroidManifest.xml
My little hello world project is working code-wise, but I'm confused with making changes to the manifest. Specifically, in the code above package name is "com.android" and in data/app my app shows up as com.android-1.apk. When I try to change it to something like com.jocala or com.jocala.hba1c I get package R does not exist errors through my compile, which fails.
What changes do I need to make? Anything else here that is glaringly bad?
I am working using Ant, VI and the Linux console, no Eclipse.
You should change the package of the java code, let it in accordance with the package which you defined in the manifest file.
The manifest holds meta-data corresponding to your android application. Hence, if you needs changes in the package name, make the changes in the java files, change the package name there, there is no sense making a change here. The only changes that are majorly done in the manifest are activity related(for beginners). Have a read here.

Categories