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.
Related
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 ...
So essentially I've been making a game using libgdx and just recently I started to try and add Google Play Game Services and So I tried my hand at it and it seems as though I have completely messed up my .xml file I've tried looking at questions such as How do I resolve this Java Class not found exception? and NoClassDefFoundError - Eclipse and Android, but to no avail.
Here is the runtime error I am recieving.
02-19 19:25:17.772: E/AndroidRuntime(25746): FATAL EXCEPTION: main
02-19 19:25:17.772: E/AndroidRuntime(25746): Process: com.coppercow.minerman, PID: 25746
02-19 19:25:17.772: E/AndroidRuntime(25746): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.coppercow.minerman/com.coppercow.minerman.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.coppercow.minerman.MainActivity" on path: DexPathList[[zip file "/data/app/com.coppercow.minerman-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.coppercow.minerman-2, /vendor/lib, /system/lib]]
The class Name is MainActivity.Java and it is in the src file. I understand that this is done because of one of two things: My .class file, or the .xml file. So here is also my .xml file just in case what I have done wrong is there and not in fact in any .class file.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.coppercow.minerman"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="19" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
However I've messed around with this xml file quite a lot and so I do not believe it is in here and that My whole problem has to be in some .class file somewhere, but I don't even understand how to access those from eclipse from going off of other questions asked here on StackOverflow.
Try this:
Go to Project/Properties/Java Build Path/Order and Export -- Make sure there's a check in front of Android Dependencies and the support library, if you use it.Mark all checkboxes and Click on Apply and clean the project.
Hope this helps.
I have a live wallpaper based off of some open source code that I heavily modified. As the last item, I right clicked on it in Eclipse to change the package name and all was well with the world. The wallpaper works right. The settings menu works right. But when I try to click an item in the settings menu to launch another activity, I get:
10-10 16:16:56.215: E/AndroidRuntime(13825): FATAL EXCEPTION: main
10-10 16:16:56.215: E/AndroidRuntime(13825): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.nightscapecreations.orionkeysfree/ffvideolivewallpaper.frankandrobot.com.extLinkNC}; have you declared this activity in your AndroidManifest.xml?
Here is the manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.nightscapecreations.anim1"
android:versionCode="1"
android:versionName="0.9.0" >
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="9" />
<!-- Tell the system this app requires OpenGL ES 2.0. -->
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<uses-feature android:name="android.software.live_wallpaper" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:icon="#drawable/icon"
android:label="#string/app_name" >
<service
android:name="ffvideolivewallpaper.frankandrobot.com.VideoLiveWallpaper"
android:label="#string/wallpaper"
android:permission="android.permission.BIND_WALLPAPER" >
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
</intent-filter>
<meta-data
android:name="android.service.wallpaper"
android:resource="#xml/wallpaper" />
</service>
<activity
android:name="ffvideolivewallpaper.frankandrobot.com.VideoLiveWallpaper"
android:label="#string/app_name" >
</activity>
<activity
android:name="ffvideolivewallpaper.frankandrobot.com.VideoWallpaperSettings"
android:exported="true"
android:label="#string/app_name" >
</activity>
<activity
android:name="ffvideolivewallpaper.frankandrobot.com.About"
android:exported="true"
android:label="#string/app_name" >
</activity>
<activity
android:name="ffvideolivewallpaper.frankandrobot.com.License"
android:exported="true"
android:label="#string/app_name" >
</activity>
<activity
android:name="ffvideolivewallpaper.frankandrobot.com.SelectVideo"
android:exported="true"
android:label="#string/app_name" >
</activity>
<activity
android:name="ffvideolivewallpaper.frankandrobot.com.extLinkNC"
android:exported="true"
android:label="#string/app_name" >
</activity>
<activity
android:name="ffvideolivewallpaper.frankandrobot.com.extLinkZazzle"
android:exported="true"
android:label="#string/app_name" >
</activity>
<activity
android:name="ffvideolivewallpaper.frankandrobot.com.extLinkFacebook"
android:exported="true"
android:label="#string/app_name" >
</activity>
<activity
android:name="ffvideolivewallpaper.frankandrobot.com.extLinkGooglePlus"
android:exported="true"
android:label="#string/app_name" >
</activity>
</application>
</manifest>
Here is the About activity, as an example, which was confirmed working before this change:
package ffvideolivewallpaper.frankandrobot.com;
import android.app.Activity;
import android.os.Bundle;
import android.text.method.LinkMovementMethod;
import android.widget.TextView;
import android.content.Intent;
import android.view.View;
import com.nightscapecreations.anim1.R;
public class About extends Activity {
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.about);
TextView t = (TextView) findViewById(R.id.about_box);
t.setMovementMethod(LinkMovementMethod.getInstance());
}
public void showLicense(View view) {
startActivity(new Intent(About.this, License.class));
}
}
ffvideolivewallpaper.frankandrobot.com was the old package name. Eclipse added the prefix to the android:name for all activities during the package name change. What I don't understand is that if this is incorrect then why does the wallpaper work at all since the service name is qualified the exact same way?
EDIT
Dunamis made an excellent catch. The original name was
ffvideolivewallpaper.frankandrobot.com, but it's been through several name changes since then. One such name was com.nightscapecreations.orionkeysfree. It looks like there was still a reference to that old name which I totally missed in the settings xml file. Example:
<PreferenceCategory android:title="Links and Information" >
<PreferenceScreen android:title="Visit Nightscape Creations"
android:summary="See more live wallpapers, get free static wallpapers, and learn about NC by visiting us online." >
<intent
android:targetClass="ffvideolivewallpaper.frankandrobot.com.extLinkNC"
android:targetPackage="com.nightscapecreations.orionkeysfree" />
</PreferenceScreen>
However, this still does not work. I tried every combination of fully qualified name and simple dot notation ".extLinkFacebook" between this file and the manifest file, but without success. Here is the error I'm receiving now with both names fully qualified:
10-11 08:19:43.176: E/AndroidRuntime(25204): FATAL EXCEPTION: main
10-11 08:19:43.176: E/AndroidRuntime(25204): android.content.ActivityNotFoundException: Unable to find explicit activity class {ffvideolivewallpaper.frankandrobot.com/ffvideolivewallpaper.frankandrobot.com.extLinkFacebook}; have you declared this activity in your AndroidManifest.xml?
Here is the settings file for reference:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
<PreferenceCategory android:title="Wallpaper Settings">
<ffvideolivewallpaper.frankandrobot.com.PrefsSlider
android:key="fps"
android:title="Framerate"
android:summary="Set the target framerate. Lower framerates will decrease resource usage. Requires wallpaper restart to take effect."
android:layout_width="fill_parent"
android:defaultValue="30"
android:orientation="vertical" />
<!-- <ListPreference -->
<!-- android:enabled="true" -->
<!-- android:key="resolution" -->
<!-- android:title="Resolution" -->
<!-- android:summary="Ultra resolution may decrease framerate. Only recommended for high end devices." -->
<!-- android:entries="#array/prefs_resolutionEntries" -->
<!-- android:entryValues="#array/prefs_resolutionValues" -->
<!-- android:defaultValue="512" /> -->
<!-- <ListPreference -->
<!-- android:enabled="true" -->
<!-- android:key="frameTonality" -->
<!-- android:title="Filters" -->
<!-- android:summary="Various effects and filters can be applied to the animation" -->
<!-- android:entries="#array/prefs_tonalityEntries" -->
<!-- android:entryValues="#array/prefs_tonalityValues" -->
<!-- android:defaultValue="1" /> -->
</PreferenceCategory>
<PreferenceCategory android:title="Links and Information" >
<PreferenceScreen android:title="Visit Nightscape Creations"
android:summary="See more live wallpapers, get free static wallpapers, and learn about NC by visiting us online." >
<intent
android:targetClass="ffvideolivewallpaper.frankandrobot.com.extLinkNC"
android:targetPackage="ffvideolivewallpaper.frankandrobot.com" />
</PreferenceScreen>
<PreferenceScreen
android:title="#string/prefsProductsHeading"
android:summary="#string/prefsProductsSummary" >
<intent
android:targetClass="ffvideolivewallpaper.frankandrobot.com.extLinkZazzle"
android:targetPackage="ffvideolivewallpaper.frankandrobot.com" />
</PreferenceScreen>
<PreferenceScreen android:title="Like on Facebook" >
<intent
android:targetClass="ffvideolivewallpaper.frankandrobot.com.extLinkFacebook"
android:targetPackage="ffvideolivewallpaper.frankandrobot.com" />
</PreferenceScreen>
<PreferenceScreen android:title="Like on Google+" >
<intent
android:targetClass="ffvideolivewallpaper.frankandrobot.com.extLinkGooglePlus"
android:targetPackage="ffvideolivewallpaper.frankandrobot.com" />
</PreferenceScreen>
</PreferenceCategory>
<PreferenceCategory android:title="About" >
<PreferenceScreen android:title="About" >
<intent
android:targetClass="ffvideolivewallpaper.frankandrobot.com.About"
android:targetPackage="ffvideolivewallpaper.frankandrobot.com" />
</PreferenceScreen>
</PreferenceCategory>
</PreferenceScreen>
Shortly after adding the bounty I found a workaround for this problem. I'm still not sure what the original issue was, though.
To resolve this I renamed the ffvideolivewallpaper.frankandrobot.com package, which contained all the code, to match that of the manifest. I had hesitated to do this as it required an update to the video.c file to change all "ffvideolivewallpaper_frankandrobot_com" references in native calls to "com_nightscapecreations_anim1" and the last time I had tried that I hosed the app so bad I had to return to a backup copy. However, after doing so today, and then search/replacing through the app to find all other references, I was able to get it to work.
I would still like to know the answer to the above question as it stands, though. It would be much easier to create new apps off this base in the future if I could just leave the main package name alone instead of bothering with a search/replace. If no one knows, though, I will just mark this as the answer.
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
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.