distriqt / airnativeextensions

DEPRECATED: Original repository of the distriqt native extensions and is no longer maintained. Please see our site for the latest ANEs
https://airnativeextensions.com
2 stars 0 forks source link

Android packaging fails with FacebookApi #60

Closed randalfien closed 10 years ago

randalfien commented 10 years ago

I cannot package my app for Android with the FacebookAPI ANE,

I keep getting this:

Error occurred while packaging the application:

aapt tool failed:Warning: AndroidManifest.xml already defines versionCode (in http://schemas.android.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines versionName (in http://schemas.android.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines minSdkVersion (in http://schemas.android.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines targetSdkVersion (in http://schemas.android.com/apk/res/android); using existing value in manifest.
C:\Users\Ondra\AppData\Local\Temp\20bad67a-363a-404f-b672-2c79c5a632ce\AndroidManifest.xml:61: error: Error: No resource found that matches the given name (at 'theme' with value '@android:style/Theme.Translucent.NoTitleBar.FullScreen').

I tried updating the Android SDK and plugin and I tried putting in there, but nothing works, any ideas?

<manifestAdditions><![CDATA[
            <manifest android:installLocation="auto">

                <permission android:name="air.cz.fit.paska.fishtrone.permission.C2D_MESSAGE" android:protectionLevel="signature" />
                <uses-permission android:name="air.cz.fit.paska.fishtrone.permission.C2D_MESSAGE" />
                <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

                <application android:enabled="true">
                    <activity android:name="com.facebook.LoginActivity"/>   
                    <activity android:name="com.distriqt.extension.facebookapi.FacebookAPILoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.FullScreen"></activity>
                    <activity android:name="com.distriqt.extension.facebookapi.FacebookAPIDialogActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"></activity>

                    <activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
                    <activity android:name="com.distriqt.extension.inappbilling.activities.PurchaseActivity" android:theme="@android:style/Theme.NoDisplay"></activity>
                    <receiver android:enabled="true" android:exported="true" android:name="com.distriqt.extension.pushnotifications.PushNotificationsBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" >
                        <intent-filter>
                            <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                            <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
                            <category android:name="air.cz.fit.paska.fishtrone" />
                        </intent-filter>
                    </receiver>
                    <service android:enabled="true" android:exported="true" android:name="com.distriqt.extension.pushnotifications.gcm.GCMIntentService" />
                    <receiver android:name="com.distriqt.extension.pushnotifications.PushNotificationsReceiver">
                        <intent-filter>
                            <action android:name="air.cz.fit.paska.fishtrone.PUSHNOTIFICATION_SELECTED" />
                        </intent-filter>
                    </receiver>
                    <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="\ 417431221701779"/>
                    <provider android:authorities="com.facebook.app.NativeAppCallContentProvider417431221701779" android:name="com.facebook.NativeAppCallContentProvider" />
                </application>
                <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.WAKE_LOCK"/>
                <uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
                <uses-permission android:name="com.android.vending.BILLING" />
                <uses-permission android:name="android.permission.GET_ACCOUNTS" />
                <uses-permission android:name="android.permission.VIBRATE"/>
            </manifest>
koriner commented 10 years ago

Hmm can you try changing these two lines:

<activity android:name="com.distriqt.extension.facebookapi.FacebookAPILoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"></activity>
<activity android:name="com.distriqt.extension.facebookapi.FacebookAPIDialogActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"></activity>

to

<activity android:name="com.distriqt.extension.facebookapi.FacebookAPILoginActivity" android:theme="android:style/Theme.Translucent.NoTitleBar.Fullscreen"></activity>
<activity android:name="com.distriqt.extension.facebookapi.FacebookAPIDialogActivity" android:theme="android:style/Theme.Translucent.NoTitleBar.Fullscreen"></activity>
randalfien commented 10 years ago

Just this:

C:\Users\Ondra\AppData\Local\Temp\3ded5773-a13d-43f8-8a1f-e92dacbfe1cf\AndroidManifest.xml:61: error: Error: String types not allowed (at 'theme' with value 'android:style/Theme.Translucent.NoTitleBar.FullScreen').
C:\Users\Ondra\AppData\Local\Temp\3ded5773-a13d-43f8-8a1f-e92dacbfe1cf\AndroidManifest.xml:65: error: Error: String types not allowed (at 'theme' with value 'android:style/Theme.Translucent.NoTitleBar.Fullscreen').
randalfien commented 10 years ago

Any ideas? I'm still stuck on this

koriner commented 10 years ago

Sorry about the delay. It appears to be caused by the latest version of the Android SDK platform tools (aapt in particular)

Unfortunately it's not a bug with aapt - it's actually a bug fix that has caused these styles not to work (as far as I can tell right now).

For now, you should be able to get around it by rolling back to a previous version of the android platform tools, or at the very least replacing your version of the aapt tool.

We'll look into a fix for this for the next version of the ANE.

randalfien commented 10 years ago

Thanks, No luck so far, I downloaded build-tools 18.1.1 and 17.0.0 and replaced the aapt file in AIRSDK_PATH'/lib/android/bin/ but still get the same error.

Is there another way to tell Flash Builder which packaging tool to use?

koriner commented 10 years ago

I'm not sure - but maybe double check your PATH to see which aapt is actually being used?

In Terminal:

which aapt
randalfien commented 10 years ago

Ok, now I am confident I'm really using the correct aapt (17.0.0) and Android SDK 17, but I'm still getting the same error. Any other ideas? I might have to wait for the next version, I guess.

koriner commented 10 years ago

Have you also got Android 2.2 (API v8) installed through your android sdk manager?

Also, can you confirm - are you on Windows? And are you using Flash Builder 4.7?

randalfien commented 10 years ago

I did not have API v8 installed, but did not change after installing. I'm on windows with Flash Builder 4.6

koriner commented 10 years ago

OK, and which AIR SDK version are you using?

randalfien commented 10 years ago

Version 4.0 overlayed with flex sdk 4.6

randalfien commented 10 years ago

Hi, any changes with this? would it be possible for you to send me the exact aapt.exe that you have that works with this extension? It would be really helpful! or tell me at least which tools (air sdk version, andriod sdk) to install to make it work.

randalfien commented 10 years ago

I changed it to this and now it works!

<activity android:name="com.distriqt.extension.facebookapi.FacebookAPILoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity android:name="com.distriqt.extension.facebookapi.FacebookAPIDialogActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />

weird...

Except now it says my dev_key is invalid? what's up with that? It works with all the other extensions.

koriner commented 10 years ago

Oh really? Just the closing tag in the XML? That's strange. We've never seen that before, thanks for posting back.

Re. the dev key, that's an issue with a particular version of the ANE. Can you email us at support@distriqt.com and I will send you an updated version that should work.