GithubHelp home page GithubHelp logo

distriqt / ane-customresources Goto Github PK

View Code? Open in Web Editor NEW
15.0 8.0 4.0 160 KB

Android Custom Resources for AIR Applications

Home Page: https://airnativeextensions.com

ActionScript 77.06% Java 22.94%
ane air android

ane-customresources's Introduction

built by distriqt //

The AIR SDK now supports adding custom resources directly so you should no longer need to use this ANE approach to add resources to your application.

Have a look at the official documentation on Custom Resources

You can still use this approach if you need to, however we will no longer be maintaining or updating this script.

Custom Android Resources

Quick Start

  1. Install Apache Ant, the AIR SDK, and the Android SDK with Android Studio
  2. update air.sdk and android.sdk in build_config/build.config
  3. Copy your resources to the res directory
  4. Run ant

This project uses an Apache Ant build script to create and package an ANE with your custom Android resources.

The main purpose of this is to allow AIR developers to easily add android resources such as notification icons and configuration values using the correct Android resource process.

This is very important for resources such as notifications icons:

To use this script ensure you have Apache Ant installed on your machine along with a recent version of the AIR and Android SDKs and a version of Java.

Once you have all those setup, download this repository and open the build.config file. You will need to update the paths to the AIR and Android SDKS, however the rest you can leave as is.

# AIR SDK
air.sdk = /PATH/TO/YOUR/AIR/SDK

# ANDROID
android.sdk = /PATH/TO/YOUR/ANDROID/SDK

On Windows it will look something like the following, you must make sure to use:

  • for air.sdk - two backslashes to correctly escape a backslash:
  • for android.sdk - forward slash (See #50, #47)
# AIR SDK (backslash)
air.sdk = C:\\Users\\username\\sdks\\air\\AIRSDK_22.0.0.153

# ANDROID (forward slash)
android.sdk = C:/Users/username/AppData/Local/Android/sdk

Resources

Next you will need to place your resources to the res folder. You can add any custom resources your application requires.

The next section shows how to create notification icons to use in our extensions.

Notification Icons

The Android Asset Studio is a great resource which will convert your icon into the correct sizes and formats for an Android notification icon.

Your notification icon needs to be white(grey) and transparent and will be converted to meet these requirements if you provide something different.

Notification Icons

To generate these goto the Android Asset Studio Notification Icon Generator and upload your source image. Make sure you change the name of the icon. You will be using this name to reference this icon in notifications.

Asset Studio

You can then download the zip and extract the contents into the res directory in the repository.

Running the script

Once you have your resources set up, you can run the script to generate your ANE. Open a terminal in the downloaded repository directory and run:

ant

You should see a series of outputs as the libraries are built and eventually a BUILD SUCCESSFUL message.

Once that occurs your ANE will be located in the build directory:

build/com.distriqt.CustomResources.ane

Add this ANE to any projects you will be using your custom resources in.


License

Copyright (c) 2016 distriqt Pty Ltd

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

ane-customresources's People

Contributors

marchbold avatar shaymolho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ane-customresources's Issues

Missing resource folder customresources for platform Android-x86

Hi.
I made corrections to the ant build.xml in order for it to work on Linux, everything works fine but at the end it crashes

compile_windows:

compile_osx:

compile_linux:
     [exec] Missing resource folder customresources for platform Android-x86

BUILD FAILED
/home/ANE-CustomResources-master/build.xml:261: The following error occurred while executing this line:
/home/Android/ANE-CustomResources-master/build.xml:296: exec returned: 12
296 <exec executable="${air.sdk}/bin/adt" failonerror="true">
297	<arg value="-package"/>
298	<arg value="-target"/>
299	<arg value="ane"/>
300	<arg value="${output.dir}/${output.name}"/>
301	<arg value="./build_config/extension.build.xml"/>
302	<arg line="-swc ${actionscript.dir}/bin/${actionscript.name}"/>
303	<arg line="-platform Android-ARM -platformoptions ./build_config/platform_android.build.xml -C ${android.dir}/${output.dir} ."/>
304	<arg line="-platform Android-x86 -platformoptions ./build_config/platform_android.build.xml -C ${android.dir}/${output.dir} ."/>
305	<arg line="-platform default -C ${default.dir}/bin ."/>
306</exec>

Just see the bell - not the custom icon

Hi,
I have added the ANE you sent me to the library (using Intellij Idea) and in the application descriptor:

<extensions>
        <extensionID>com.distriqt.PushNotifications</extensionID>
        <extensionID>com.distriqt.Core</extensionID>
        <extensionID>com.distriqt.Firebase</extensionID>
        <extensionID>com.distriqt.androidsupport.V4</extensionID>
        <extensionID>com.distriqt.androidsupport.CustomTabs</extensionID>
        <extensionID>com.distriqt.CustomResources</extensionID>
        <extensionID>com.distriqt.playservices.Base</extensionID>
    </extensions>

but still get the bell.

In the ANE there are the correct images...

Anything more I have to do?

Can't set FLEX_HOME

Hello,

I'm trying to build a CustomResources ANE. So far, I installed ANT and set the variables accordingly. But when I launch ant on the command prompt, I get this:

Buildfile: D:\Dropbox\Projects\Libs\ANE-Notifications-master\ANE-CustomResources-master\build.xml
clean:
clean_actionscript:
clean_default:
clean_android:
build:
build_actionscript:
[echo] Building actionscript library...
BUILD FAILED
D:\Dropbox\Projects\Libs\ANE-Notifications-master\ANE-CustomResources-master\build.xml:214: The following error occurred while executing this line:
D:\Dropbox\Projects\Libs\ANE-Notifications-master\ANE-CustomResources-master\build.xml:115: FLEX_HOME must be set to use the Flex Ant Tasks

Total time: 0 seconds

How do I setup FLEX_HOME?

Thank you!

What android.package value must be in build.config?

In build.config I see this

# CHANGE THIS PACKAGE NAME IF YOU ARE USING FIREBASE
android.package = com.distriqt.extension.customresources

Is there must be my application ID with "air." prefix for Android or without it?

The notification icon appears all white

In Android 6.0 and 6.0.1 the notification icon is appearing all white. First I generated the icons as taught on the page. Then I generated the icons directly in Android Studio and even so when I receive the push notifications the icon continues to appear all white. I followed all the steps and managed the ANE correctly. I did the whole process on a MacOSX computer.

icons_android_asset_studio

icons_android_studio

whatsapp image 2017-02-01 at 10 15 56

whatsapp image 2017-02-01 at 10 21 40

whatsapp image 2017-02-01 at 10 22 10

not able to Build Custom Resource

Hi,

We tried to follow instructions and tried to make the Custom Resource ANE..
But, while building we are facing following error.

http://imgur.com/a/NiHEL

I am not sure, if it some setup error. but looks like setup has been done as instructed.
Have attached few Screen Shots to show my setups as well

Thanks,
Aseem

Task 'assemble' not found in root project

Hello I have a problem when compiling, when I go to "assemble", it gives me error that I can not find the property "assemble". I used windows, java version 1.8.0_131. thanks

`D:\d2\ANE-CustomResources-master\ANE-CustomResources-master>ant
Buildfile: D:\d2\ANE-CustomResources-master\ANE-CustomResources-master\build.xml

clean:

clean_actionscript:
[delete] Deleting directory D:\d2\ANE-CustomResources-master\ANE-CustomResources-master\platform\actionscript\bin

clean_default:
[delete] Deleting directory D:\d2\ANE-CustomResources-master\ANE-CustomResources-master\platform\default\bin

clean_android:
[delete] Deleting directory D:\d2\ANE-CustomResources-master\ANE-CustomResources-master\platform\android\app

build:

build_actionscript:
[echo] Building actionscript library...
[compc] Loading configuration: D:\AIRSDK_Compiler25\frameworks\air-config.xml
[compc]
[compc]
[compc] 2172 bytes written to D:\d2\ANE-CustomResources-master\ANE-CustomResources-master\platform\actionscript\bin\distriqt.extension.resources.swc in 0,665 seconds
[compc]
[echo] done

build_default:
[echo] Building default library...
[compc] Loading configuration: D:\AIRSDK_Compiler25\frameworks\air-config.xml
[compc]
[compc]
[compc] 2015 bytes written to D:\d2\ANE-CustomResources-master\ANE-CustomResources-master\platform\default\bin\distriqt.extension.resources.default.swc in 0,552 seconds
[compc]
[echo] done

create_android_project:
[mkdir] Created dir: D:\d2\ANE-CustomResources-master\ANE-CustomResources-master\platform\android\app
[copy] Copying 4 files to D:\d2\ANE-CustomResources-master\ANE-CustomResources-master\platform\android\app
[mkdir] Created dir: D:\d2\ANE-CustomResources-master\ANE-CustomResources-master\platform\android\app\src\main\java\com\distriqt\extension\customresources
[copy] Copying 2 files to D:\d2\ANE-CustomResources-master\ANE-CustomResources-master\platform\android\app\src\main\java\com\distriqt\extension\customresources
[mkdir] Created dir: D:\d2\ANE-CustomResources-master\ANE-CustomResources-master\platform\android\app\src\main\res
[copy] Copying 5 files to D:\d2\ANE-CustomResources-master\ANE-CustomResources-master\platform\android\app\src\main\res
[copy] Copying 1 file to D:\d2\ANE-CustomResources-master\ANE-CustomResources-master\platform\android
[copy] Copying 1 file to D:\d2\ANE-CustomResources-master\ANE-CustomResources-master\platform\android\app\libs

build_android:
[echo] Building Android library...

build_android_osx:

build_android_windows:
[exec] :wrapper
[exec]
[exec] BUILD SUCCESSFUL
[exec]
[exec] Total time: 1.763 secs
[exec]
[exec] FAILURE: Build failed with an exception.
[exec]
[exec]
[exec] BUILD FAILED* What went wrong:
[exec]
[exec]
[exec] Total time: 1.213 secs
[exec] Task 'assemble' not found in root project 'ANE-CustomResources-master'.
[exec]
[exec] * Try:
[exec] Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
[exec] Result: 1

package:
[mkdir] Created dir: D:\d2\ANE-CustomResources-master\ANE-CustomResources-master\build

package_android:

BUILD FAILED
D:\d2\ANE-CustomResources-master\ANE-CustomResources-master\build.xml:223: The following error occurred while executing this line:
D:\d2\ANE-CustomResources-master\ANE-CustomResources-master\build.xml:174: Warning: Could not find file D:\d2\ANE-CustomResources-master\ANE-CustomResources-master\platform\android\app\build\intermediates\bundles\release\classes.jar to copy.

Total time: 6 seconds`

is it works with as3 uncaughtErrorEvents listener

i have event listener to catch exceptions
uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, onUncaughtError);
doest this extension just catching this airs exceptions or it catchs native iso android expcetions caused with this app, too ?

Errors When Running ant

Followed the instructions and got the below errors in windows 10:

C:\Users\phill\Desktop\ANE-CustomResources-master>ant
Buildfile: C:\Users\phill\Desktop\ANE-CustomResources-master\build.xml
[taskdef] Could not load definitions from resource flexTasks.tasks. It could not be found.
[taskdef] Could not load definitions from resource anttasks.properties. It could not be found.

clean:
[taskdef] Could not load definitions from resource flexTasks.tasks. It could not be found.
[taskdef] Could not load definitions from resource anttasks.properties. It could not be found.

clean_actionscript:
[taskdef] Could not load definitions from resource flexTasks.tasks. It could not be found.
[taskdef] Could not load definitions from resource anttasks.properties. It could not be found.

clean_default:
[taskdef] Could not load definitions from resource flexTasks.tasks. It could not be found.
[taskdef] Could not load definitions from resource anttasks.properties. It could not be found.

clean_android:

build:
[taskdef] Could not load definitions from resource flexTasks.tasks. It could not be found.
[taskdef] Could not load definitions from resource anttasks.properties. It could not be found.

build_actionscript:
[echo] Building actionscript library...

BUILD FAILED
C:\Users\phill\Desktop\ANE-CustomResources-master\build.xml:213: The following error occurred while executing this line:
C:\Users\phill\Desktop\ANE-CustomResources-master\build.xml:89: Problem: failed to create task or type compc
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any / declarations have taken place.

Total time: 0 seconds

C:\Users\phill\Desktop\ANE-CustomResources-master>

Still missing something

I've successfully built the ANE. But the directions somewhat end there "Add to project.."

How do we refer to the icon now so that the PushNotifications will know where to find them. were not doing any categories or anything yet where i've seen a setIcon method. Just a standard push notification (now the icon is a white dot)

BUILD FAILED

Hallo,
we are trying to create resources ane for Firebase but we have an error when trying to run ant. We installed latest Android SDK on our Mac OS X and also updated JAVA (1.8.0_77). We use AIR 29.0.0.122.

Here is output from console:

Buildfile: /Volumes/Work/buckleup/boehringer/mobile-apps/respimat-playbook-app-pl/app/ane/build.xml

clean:

clean_actionscript:
   [delete] Deleting directory /Volumes/Work/buckleup/boehringer/mobile-apps/respimat-playbook-app-pl/app/ane/platform/actionscript/bin

clean_default:
   [delete] Deleting directory /Volumes/Work/buckleup/boehringer/mobile-apps/respimat-playbook-app-pl/app/ane/platform/default/bin

clean_android:
   [delete] Deleting directory /Volumes/Work/buckleup/boehringer/mobile-apps/respimat-playbook-app-pl/app/ane/platform/android/app

build:

build_actionscript:
     [echo] Building actionscript library...
    [compc] Loading configuration: /Users/jakubkovacs/AIR/AIR29.0/frameworks/air-config.xml
    [compc] 
    [compc] 2172 bytes written to /Volumes/Work/buckleup/boehringer/mobile-apps/respimat-playbook-app-pl/app/ane/platform/actionscript/bin/distriqt.extension.customresources.swc in 0.766 seconds
     [echo] done

build_default:
     [echo] Building default library...
    [compc] Loading configuration: /Users/jakubkovacs/AIR/AIR29.0/frameworks/air-config.xml
    [compc] 
    [compc] 2016 bytes written to /Volumes/Work/buckleup/boehringer/mobile-apps/respimat-playbook-app-pl/app/ane/platform/default/bin/distriqt.extension.customresources.default.swc in 0.699 seconds
     [echo] done

create_android_project:
    [mkdir] Created dir: /Volumes/Work/buckleup/boehringer/mobile-apps/respimat-playbook-app-pl/app/ane/platform/android/app
     [copy] Copying 4 files to /Volumes/Work/buckleup/boehringer/mobile-apps/respimat-playbook-app-pl/app/ane/platform/android/app
    [mkdir] Created dir: /Volumes/Work/buckleup/boehringer/mobile-apps/respimat-playbook-app-pl/app/ane/platform/android/app/src/main/java/com/distriqt/extension/customresources
     [copy] Copying 2 files to /Volumes/Work/buckleup/boehringer/mobile-apps/respimat-playbook-app-pl/app/ane/platform/android/app/src/main/java/com/distriqt/extension/customresources
    [mkdir] Created dir: /Volumes/Work/buckleup/boehringer/mobile-apps/respimat-playbook-app-pl/app/ane/platform/android/app/src/main/res
     [copy] Copying 1 file to /Volumes/Work/buckleup/boehringer/mobile-apps/respimat-playbook-app-pl/app/ane/platform/android/app/src/main/res
     [copy] Copying 1 file to /Volumes/Work/buckleup/boehringer/mobile-apps/respimat-playbook-app-pl/app/ane/platform/android
     [copy] Copying 1 file to /Volumes/Work/buckleup/boehringer/mobile-apps/respimat-playbook-app-pl/app/ane/platform/android/app/libs

build_android:
     [echo] Building Android library...

build_android_osx:
     [exec] Incremental java compilation is an incubating feature.
     [exec] 
     [exec] FAILURE: Build failed with an exception.
     [exec] 
     [exec] * What went wrong:
     [exec] java.io.IOException: Operation not supported
     [exec] > Operation not supported
     [exec] 
     [exec] * Try:
     [exec] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
     [exec] :wrapper
     [exec] 
     [exec] BUILD FAILED
     [exec] 
     [exec] Total time: 3.551 secs
     [exec] Result: 1
     [exec] Incremental java compilation is an incubating feature.
     [exec] 
     [exec] FAILURE: Build failed with an exception.
     [exec] 
     [exec] * What went wrong:
     [exec] java.io.IOException: Operation not supported
     [exec] > Operation not supported
     [exec] 
     [exec] * Try:
     [exec] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
     [exec] :app:preBuild UP-TO-DATE
     [exec] :app:preDebugBuild UP-TO-DATE
     [exec] :app:checkDebugManifest
     [exec] :app:prepareDebugDependencies
     [exec] :app:compileDebugAidl
     [exec] 
     [exec] BUILD FAILED
     [exec] 
     [exec] Total time: 3.54 secs
     [exec] Result: 1

build_android_windows:

package:

package_android:

BUILD FAILED
/Volumes/Work/buckleup/boehringer/mobile-apps/respimat-playbook-app-pl/app/ane/build.xml:228: The following error occurred while executing this line:
/Volumes/Work/buckleup/boehringer/mobile-apps/respimat-playbook-app-pl/app/ane/build.xml:178: Warning: Could not find file /Volumes/Work/buckleup/boehringer/mobile-apps/respimat-playbook-app-pl/app/ane/platform/android/app/build/intermediates/bundles/release/classes.jar to copy.

Total time: 12 seconds

But maybe we're doing something wrong so please any help is appreciated.

Thank you.

Build Failed: build.xml:248 exec returned 2

Hi, hopefully you can help, I've been unable to run the ant build without errors, I've tried searching but can't see an answer already here.

the current error which I can't get past is this:
BUILD FAILED C:\customResourceBuilder\ANE-CustomResources-master\build.xml:240 the following error occured while executing this line: C:\customResourceBuilder\ANE-CustomResources-master\build.xml:248 exec returned: 2

I attach the rest of the output here:
ant.txt

Java version is 1.80_221
(though I tried with 1.8.0_05 and 12.0.02 and got different errors)

build.config variables:
`

AIR SDK

air.sdk = C:/customResourceBuilder/AIRSDK_30

ANDROID

android.sdk = C:/Users/Robin/AppData/Local/Android/Sdk

`

Trouble when building APK: invalid resource directory name

Hi

I can build this ANE using ant (changing only the build_config/build.config air.sdk and android.sdk values and adding the res/values.xml), but running a super simple test build of an apk (using the command line) gives me the error...

An implementation for native extension 'com.distriqt.extension.customresources.Resources' required by the application was not found for the target platform

In plain English: it couldn't find the ANE.

The ANE file is named com.distriqt.extension.customresources.Resources.ane and in my applicationDescriptor.xml I have the line...
<extensionID>com.distriqt.extension.customresources.Resources</extensionID>


I had a look inside the ANE and saw that its id is actually com.distriqt.CustomResources (found in META-INF/ANE/extension.xml). So I change the applicationDescriptor line to...
<extensionID>com.distriqt.CustomResources</extensionID>

And this time the apk build gives me the error...
aapt tool failed:invalid resource directory name: /private/var/folders/kj/00jc9ntj3dj1j2jd5lkrs9vw0000gn/T/81455ed5-b745-47da-b5e4-e32411fcde61/customresources values.xml


Since we're actually using Distriqt's Firebase ANE in our project, I made a third attempt, this time changing the build_config/build.config android.package to co.playlingo.wordable.extensions.customresources (as recommended on another issue) but we got the same problems as above.


Here's my res/values.xml file (redacted)...

<?xml version="1.0" encoding="utf-8"?>
<resources>
   	<string name="google_app_id" translatable="false">xxxx</string>
	<string name="gcm_defaultSenderId" translatable="false">xxxx</string>
	<string name="google_api_key" translatable="false">xxxx</string>
	<string name="google_crash_reporting_api_key" translatable="false">xxxx</string>
	<string name="default_web_client_id" translatable="false">xxxx</string>
	<string name="firebase_database_url" translatable="false">xxxx</string>
	<string name="ga_trackingId" translatable="false">xxxx</string>
</resources>

And using...

  • OSX 10.11.6
  • Android SDK Build-tools 25.0.3
  • AIR SDK 23
  • ant 1.10.1
  • java 1.8.0_121-b13

Any help much appreciated thanks.

Warning: Using default implementation for native extension 'com.distriqt.CustomResources'

I'm receiving this message after distribution build for iPhone. When I attempt to install IPA file on iPhone through iTunes application (drag/drop to iTunes) it is installing up to 75% and then stops. Of course it is not working at all nor there is an icon, just default white with black circles. In debug mode all works just fine and icon is regular one. Can this warning cause installation problem?

no colored notification icons supported ?

Your notification icon needs to be white(grey) and transparent and will be converted to meet these requirements if you provide something different.

maybe i don't understand correctly but it seems your notification anes not supports color bitmaps just black and white ?

Compiled ANE not accepted in AIR 33.1

Hello!

I updated my ANEs to the AndroidX level but the new coded CustomResources.ANE stops Flash Builder with the error message that the files are not correct formated.
It seems that your repository only compiles on API 27 where 29 is needed. I am just wondering why this isn't a bigger issue. As far as I know aps cannot be without the CustomResources.ANE if they want to use the PushNotifications.ANE!? Or do not use many users the Push ANE?

Best regards
Marc

BUILD FAILED !

cmd java version => "1.8.0_40"
after updating java to "1.8.0_111" still getting same error.

Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
JAVA_HOME = jdk1.7.0_05
windows 7

there is always problems with java

java info on my system

tried to setting java_home and path via bat file to jre6 but no success

@echo off
SET "JAVA_HOME=C:\Program Files (x86)\Java\jre6
SET "PATH=%JAVA_HOME%\bin;%PATH%"
java -version
pause
cmd /k ant
BUILD FAILED
.......\build.xml:42: javax.script.ScriptException: sun.org.mozilla.javascript.internal.Eva
luatorException: The choice of Java constructor replace matching JavaScript argu
ment types (function,string) is ambiguous; candidate constructors are:
    class java.lang.String replace(char,char)
    class java.lang.String replace(java.lang.CharSequence,java.lang.CharSequence
) (<Unknown source>#5) in <Unknown source> at line number 5
        at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.ja
va:220)
        at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.ja
va:236)
        at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.


BUILD FAILED Android-ARM64 Unsupported

Related to #39
Got an error

compile_windows:
     [exec] Unsupported platform: '-platform Android-ARM64'. Must be one of [default, Android-ARM, Android-x86, iPhone-ARM, appleTV-ARM, appleTV-x86, iPhone-x86, MacOS-x86, MacOS-x86-64, Windows-x86, Windows-x86-64]

Tried with different jdk 111 (x86 and 64) and 121 (x86 and 64).

ANE is created successfully If i exclude this platform from build

Failed to build APK after adding CustomResources ANE

Hi @marchbold ,

I'm Trying to add icon for the push notifications.

I've added only 1 file (ic_push_notif.png) to the customResources and built it by instructions.
The ANE build completed successfully.
But after adding the ANE to my project the APK build fail on this error:
aapt tool failed:invalid resource directory name: C:\Users\shay\AppData\Local\Temp\e32ea5eb-fcbc-4350-9251-0c8e035ed787\customresources ic_push_notif.png

This is the ANE (added zip for the upload)
com.distriqt.CustomResources.ane.zip

What am I doing wrong?
Thanks
Shay

BUILD FAILED

Hello!
I m trying create to config.ane for firebase pushnotification on Android.

My first try I was getting this error;


BUILD FAILED
F:\Users\eayaydin\Adobe Flash Builder 4.6\ansmanApp\config\build.xml:45: javax.script.ScriptException: sun.org.mozilla.javascript.internal.EvaluatorException: The choice of Java constructor replace matching JavaScript argument types (function,string) is ambiguous; candidate constructors are: 
    class java.lang.String replace(char,char)
    class java.lang.String replace(java.lang.CharSequence,java.lang.CharSequence) (<Unknown source>#5) in <Unknown source> at line number 5

After that I checked the Issues on github and I found a topic.
And I changed the this part attributes.get( "value" ).replace( /\./g, "/" ) ); with this attributes.get( "value" ).replace( "/\./g", "/" ) ); like his said.

And after that I didnt get fist error but this time I got this error;

BUILD FAILED
F:\Users\eayaydin\Adobe Flash Builder 4.6\ansmanApp\config\build.xml:261: The following error occurred while executing this line:
F:\Users\eayaydin\Adobe Flash Builder 4.6\ansmanApp\config\build.xml:138: Problem: failed to create task or type compc
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

Please help me :) I'm succeed on iOS but I cant on Android...

Build Failed

Hello, I'm getting the following error when trying to build my ANE. My AIR and Anrdoid paths are correct. I noticed in another thread that there can be issues with trying to write to remote drives, but that's not the case in my situation. Any other ideas? My Java version is 1.8.x

Could not find file ANE-CustomResources-master/platform/android/app/build/intermediates/packaged-classes/release/classes.jar to copy.

Tool versions working with Windows 10?

Can you confirm what versions of:

Ant
Java SDK
AIR SDK

were used to get this working on 10?

I have

Ant 1.10.1
jdk1.8.0_131
Air 26
Latest Android SDK

Trying to build firebase android config ANE

Please advice

Why icons must be greyscale for Android?

I've used to compile the freshplanet Push ANE with my colourful icons.
I've copied icon files into res directory drawable-xhdpi with correct names.

The actual code, that's probably is very similar to how it's implemented in your ANEs is:

// Notification images
        int smallIconId = Resources.getResourseIdByName(_context.getPackageName(), "drawable", "status_icon");
        int largeIconId = Resources.getResourseIdByName(_context.getPackageName(), "drawable", "app_icon");

So my guess is as long as directory structure , naming and image size stays the same I can use my colourful icons.

Also, the generated directory has subdirs like "drawable-mdpi-v11" and "drawable-mdpi". Is duplicate "drawable-mdpi-v11" really required when compiling custom resources?

Add more Info to the wiki about Notification Icons

If you are using the Notification composer like us to send Notifications you will not be able to specify a custom Notification Icon in the Payload.
To still make use of your packaged Icons and not have a blank white square on your Notifications you have to add this to the Manifest section of your descriptor (inside <application>):

<meta-data
	android:name="com.google.firebase.messaging.default_notification_icon"
	android:resource="@drawable/your_icon_name" />

And the tint can be changed like this:

<meta-data 
	android:name="com.google.firebase.messaging.default_notification_color"
	android:resource="@color/google_blue" />

I'm not sure how to specify a custom color since we are sticking to the default which is white.

windows android SDK path problem

with build.config

# AIR SDK
air.sdk = D:\\SDK\\air-33

# ANDROID
android.sdk = C:\\Users\\ASUS\\AppData\\Local\\Android\\Sdk

I have the following error :

The SDK directory 'C:\sdk\custom-res\platform\android\C:UsersASUSAppDataLocalAndroidSdk' does not exist

there seems to be 2 problems :

  • it is taking my android.sdk variable and appending it like a relative path to {android.dir}
  • it removes my backslashes (which i have doubled as specified)

OS : Windows 10
ANT 1.9.15
jre 1.8

Custom Build ANE

Hello, I am wondering when you say to put the icon resources in the /res directory, should it look like folders?

/drawable-hdpi
/drawable-mdpi
/drawable-xhdpi
/drawable-xxhdpi
/drawable-xxxhdpi

OR

should we pull the image from those and put into the resource folder? do names matter of these resources, etc? kind of unclear here what it should look like in the /res directory.

I have compiled the ANE and it didn't work with the new android icons, so just wondering.

error while compiling with com.distriqt.CustomResources.ane

dx tool failed:
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lcom/distriqt/extension/custo
mresources/R$attr;
        at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:12
2)
        at com.android.dx.dex.file.DexFile.add(DexFile.java:161)
        at com.android.dx.command.dexer.Main.processClass(Main.java:737)
        at com.android.dx.command.dexer.Main.processFileBytes(Main.java:678)
        at com.android.dx.command.dexer.Main.access$300(Main.java:83)
        at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:607)
        at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpen
er.java:284)
        at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.j
ava:166)
        at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java
:144)
        at com.android.dx.command.dexer.Main.processOne(Main.java:637)
        at com.android.dx.command.dexer.Main.processAllFiles(Main.java:511)
        at com.android.dx.command.dexer.Main.runMonoDex(Main.java:281)
        at com.android.dx.command.dexer.Main.run(Main.java:247)
        at com.android.dx.command.dexer.Main.main(Main.java:215)
        at com.android.dx.command.Main.main(Main.java:106)
1 error; aborting
                <extensionID>com.distriqt.Core</extensionID> 
		<extensionID>com.distriqt.AndroidSupport</extensionID>
		<extensionID>com.distriqt.Volume</extensionID>
		<extensionID>com.distriqt.Notifications</extensionID>
		<extensionID>com.distriqt.Exceptions</extensionID>
		<extensionID>com.distriqt.CustomResources</extensionID>

ane file generated with ANE-CustomResources and

rename zip to ane

com.distriqt.CustomResources.zip

Build Failed - android SDK folder used wrong.

When I try to build for android, I get the following error:

[exec] * What went wrong: [exec] A problem occurred configuring project ':app'. [exec] > The SDK directory 'E:\Development\2_ANE\ANE-CustomResources-master\platform\android\E:Androidsdk' does not exist.

It looks like the path of my android sdk is used wrong.

This is from my build.config:

air.sdk = E:\\Development\\SDKs\\4161_33
android.sdk = E:\\Android\\sdk

Any ideas?

build.config changes needed for Firebase?

Hi is there a requirement to change either the default:

android.package
or
package.name

values in build.config when also using the Firebase ANE?

Or is it good to go for Firebase compatibility without changing either of these two values.

Thanks

Adding DEX file

Hi @marchbold ,
I'm not sure this is the place, but i'll try anyway.

We're trying to add another DEX file to our build.
We need to do it as part integration facebook network to our IronSource integration:

If you'll see, on step 8, we need to download and add a DEX file to the build, but there's no valid explanation of how to do it.

I searched the web a lot and couldn't find it either.

I'm trying here, as part because i'm wondering if i should do it through this ANE

Thanks,
Shay

add to document about android sdk licenses agreement

Hhi. To prevent additional searching add to your dicumentation commands to agree android license agreement

https://stackoverflow.com/questions/39760172/you-have-not-accepted-the-license-agreements-of-the-following-sdk-components

on Windows:

cd "%ANDROID_HOME%"/tools/bin
Run the sdkmanager as follows:

sdkmanager --licenses
And accept the licenses you did not accept yet (but need to).

For more details see the Android Studio documentation, although the current documentation is missing any description on the --licenses option.

Error compile on Android

Hi,
When i compile my app I receive the error:

unexpected failure: duplicate entry: air/chogan/app/R.class
java.util.zip.ZipException: duplicate entry: air/chogan/app/R.class
at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:232)
at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:109)
at com.adobe.air.apk.ResourceBytecodeGenerator.generateFromRFile(ResourceBytecodeGenerator.java:85)
at com.adobe.air.apk.APKOutputStream.generateByteCodeFromRFile(APKOutputStream.java:1060)
at com.adobe.air.apk.APKOutputStream.generateResourcesAndManifest(APKOutputStream.java:1017)
at com.adobe.air.apk.APKOutputStream.addApplicationDescriptor(APKOutputStream.java:327)
at com.adobe.air.ApplicationPackager.addSpecialFiles(ApplicationPackager.java:509)
at com.adobe.air.ApplicationPackager.createPackage(ApplicationPackager.java:87)
at com.adobe.air.ADT.parseArgsAndGo(ADT.java:673)
at com.adobe.air.ADT.run(ADT.java:471)
at com.adobe.air.ADT.main(ADT.java:521)

I use this anes:

com.distriqt.NativeWebView com.distriqt.Core com.distriqt.Share com.distriqt.Firebase com.distriqt.playservices.Base com.distriqt.Application com.distriqt.PushNotifications com.distriqt.playservices.GCM com.distriqt.playservices.Ads com.distriqt.Adverts com.distriqt.Dialog com.distriqt.LocalAuth com.distriqt.androidsupport.V4 com.distriqt.androidsupport.AppCompatV7 com.distriqt.PDFReader com.distriqt.androidsupport.CustomTabs com.distriqt.CustomResources

ant fails on Windows machine

I'm experiencing problems running ant to compile on a Windows 10 machine.

I have all the necessary files configured and installed but when I run ant I always get the same error:

Buildfile: F:\PROYECTOS\DoNetworking\ane\CustomResources\trunk\build.xml

clean:

clean_actionscript:
[delete] Deleting directory F:\PROYECTOS\DoNetworking\ane\CustomResources\trunk\platform\actionscript\bin

clean_default:
[delete] Deleting directory F:\PROYECTOS\DoNetworking\ane\CustomResources\trunk\platform\default\bin

clean_android:
[delete] Deleting directory F:\PROYECTOS\DoNetworking\ane\CustomResources\trunk\platform\android\app

build:

build_actionscript:
[echo] Building actionscript library...
[compc] Loading configuration: F:\FLEXSDKS\AIRSDK 26.0\frameworks\air-config.xml
[compc]
[compc]
[compc] 2172 bytes written to F:\PROYECTOS\DoNetworking\ane\CustomResources\trunk\platform\actionscript\bin\distriqt.extension.resources.swc in 1,031 seconds
[compc]
[echo] done

build_default:
[echo] Building default library...
[compc] Loading configuration: F:\FLEXSDKS\AIRSDK 26.0\frameworks\air-config.xml
[compc]
[compc]
[compc] 2016 bytes written to F:\PROYECTOS\DoNetworking\ane\CustomResources\trunk\platform\default\bin\distriqt.extension.resources.default.swc in 0,732 seconds
[compc]
[echo] done

create_android_project:
[mkdir] Created dir: F:\PROYECTOS\DoNetworking\ane\CustomResources\trunk\platform\android\app
[copy] Copying 4 files to F:\PROYECTOS\DoNetworking\ane\CustomResources\trunk\platform\android\app
[mkdir] Created dir: F:\PROYECTOS\DoNetworking\ane\CustomResources\trunk\platform\android\app\src\main\java\com\distriqt\extension\customresources
[copy] Copying 2 files to F:\PROYECTOS\DoNetworking\ane\CustomResources\trunk\platform\android\app\src\main\java\com\distriqt\extension\customresources
[mkdir] Created dir: F:\PROYECTOS\DoNetworking\ane\CustomResources\trunk\platform\android\app\src\main\res
[copy] Copying 1 file to F:\PROYECTOS\DoNetworking\ane\CustomResources\trunk\platform\android
[copy] Copying 1 file to F:\PROYECTOS\DoNetworking\ane\CustomResources\trunk\platform\android\app\libs

build_android:
[echo] Building Android library...

build_android_osx:

build_android_windows:

BUILD FAILED
F:\PROYECTOS\DoNetworking\ane\CustomResources\trunk\build.xml:215: The following error occurred while executing this line:
F:\PROYECTOS\DoNetworking\ane\CustomResources\trunk\build.xml:146: The following error occurred while executing this line:
F:\PROYECTOS\DoNetworking\ane\CustomResources\trunk\build.xml:163: Execute failed: java.io.IOException: Cannot run program "gradlew.bat" (in directory "F:\PROYECTOS\DoNetworking\ane\CustomResources\trunk\platform\android"): CreateProcess error=2, System cannot find the request file
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at java.lang.Runtime.exec(Runtime.java:620)
at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:58)
at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:426)
at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:440)
at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:629)
at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:670)
at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:496)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
at org.apache.tools.ant.Main.runBuild(Main.java:857)
at org.apache.tools.ant.Main.startAnt(Main.java:236)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:287)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:113)
Caused by: java.io.IOException: CreateProcess error=2, System cannot find the request file
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.(ProcessImpl.java:386)
at java.lang.ProcessImpl.start(ProcessImpl.java:137)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 49 more

I think that is something related to gradle build but not sure.

CustomResources Android 64bit support

Hi,
I've recently tested new beta 64bit versions of the following ANEs:
com.distriqt.androidsupport.V4
com.distriqt.Core
com.distriqt.Firebase
com.distriqt.playservices.Base
com.distriqt.PushNotifications

I was able to compile the apk file, but when I'm launching the application I'm receving: REGISTER_FAILED: Firebase App not configured (from PushNotifications.service.register()).

Before (32bit versions) everything was ok.

I suspect that, the problem is 32 bit CustomResources.ane, that I've created using ant. It does not contain "Android-ARM64" folder.
If that is the case, how can I create 64bit CustomResources.ane?
Or maybe there is some other problem with the configuration, that I'm missing?

Path not solving on Windows

I tried absolute paths starting with c://
image

and relative paths from the directory it was trying to execute from
image

The only solution to this problem at this time (which I am testing right now) is to move the sdk folder to ANE-CustomResources\platform\android and change the config for the android to sdk:

# ANDROID
android.sdk = sdk

I am writing this while downloading the rest of the sdk from the andorid dev studio as it prompted me to accept the license and the rest of the SDK.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.