Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADT does not properly compile R.java files from com.distriqt.extension.dialog.DialogView #274

Closed
TobiasHeidingsfeld opened this issue Mar 19, 2020 · 15 comments

Comments

@TobiasHeidingsfeld
Copy link

com.distriqt.extension.dialog.DialogView has a show() that worked fine before AIR 33 but now is not doing anything. The call seems to fail silently without giving any exception or failure message. This breaks much of our apps functionality, any ideas why this could be happening? Is it an issue for Harman or for distriqt?

@ajwfrost
Copy link
Collaborator

Which version of the runtime? And what OS and packaging method are you using?

We have a general ANE problem with 33.1 but also with 33.0 this is the exact problem we found when trying to create Android App Bundles - the resources don’t get packaged in the same way so it doesn’t display the dialog..

@marchbold
Copy link
Collaborator

@TobiasHeidingsfeld Could you post the logs from the device? We will be able to identify whether the issue is with the packaging of the ANE or with AIR.

@mymishagithub
Copy link

mymishagithub commented Mar 21, 2020

i have same problem
please help distriqt support
please check log:

03-21 21:16:52.228  3923  4111 I clp-JNI : Add pinfo.  (channel) 530e457 air.com.distriqt.testdialog/air.com.distriqt.testdialog.AppEntry (server) (pkg) AppWindowToken{f4d9e7f token=Token{25cc39e ActivityRecord{3d0ddd9 u0 air.com.distriqt.testdialog/.AppEntry t2687}}} 30862 11992 (action) 1
03-21 21:16:52.228  3923  4111 I clp-JNI : Add pinfo end.  1
03-21 21:16:52.228  3923  4111 I InputDispatcher: Delivering touch to (30862): action: 0x1, displayId: 0, '530e457', toolType: 1
03-21 21:16:52.229 30862 30862 D ViewRootImpl@ce8f235[AppEntry]: ViewPostIme pointer 1
03-21 21:16:52.234 30862 30862 D com.distriqt.Dialog: DialogTheme::DialogTheme(): [device:default, 16974126]
03-21 21:16:52.235 30862 30862 D com.distriqt.Dialog: DialogViewController::create( 1 )
03-21 21:16:52.237 30862 30862 D ScrollView: initGoToTop
03-21 21:16:52.238 30862 30862 W System.err: android.view.InflateException: Binary XML file line #6: Binary XML file line #6: Error inflating class <unknown>
03-21 21:16:52.238 30862 30862 W System.err: Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class <unknown>
03-21 21:16:52.238 30862 30862 W System.err: Caused by: java.lang.reflect.InvocationTargetException
03-21 21:16:52.238 30862 30862 W System.err:    at java.lang.reflect.Constructor.newInstance0(Native Method)
03-21 21:16:52.238 30862 30862 W System.err:    at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
03-21 21:16:52.238 30862 30862 W System.err:    at android.view.LayoutInflater.createView(LayoutInflater.java:647)
03-21 21:16:52.238 30862 30862 W System.err:    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
03-21 21:16:52.238 30862 30862 W System.err:    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
03-21 21:16:52.238 30862 30862 W System.err:    at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
03-21 21:16:52.238 30862 30862 W System.err:    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
03-21 21:16:52.238 30862 30862 W System.err:    at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
03-21 21:16:52.238 30862 30862 W System.err:    at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
03-21 21:16:52.238 30862 30862 W System.err:    at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
03-21 21:16:52.239 30862 30862 W System.err:    at com.distriqt.extension.dialog.dialogview.alerts.DialogView_Alert.create(DialogView_Alert.java:104)
03-21 21:16:52.239 30862 30862 W System.err:    at com.distriqt.extension.dialog.dialogview.DialogViewController.create(DialogViewController.java:131)
03-21 21:16:52.239 30862 30862 W System.err:    at com.distriqt.extension.dialog.functions.dialogview.CreateFunction.call(CreateFunction.java:105)
03-21 21:16:52.239 30862 30862 W System.err:    at com.adobe.air.customHandler.nativeOnTouchCallback(Native Method)
03-21 21:16:52.239 30862 30862 W System.err:    at com.adobe.air.customHandler.handleMessage(customHandler.java:27)
03-21 21:16:52.239 30862 30862 W System.err:    at android.os.Handler.dispatchMessage(Handler.java:106)
03-21 21:16:52.239 30862 30862 W System.err:    at android.os.Looper.loop(Looper.java:214)
03-21 21:16:52.239 30862 30862 W System.err:    at android.app.ActivityThread.main(ActivityThread.java:7073)
03-21 21:16:52.239 30862 30862 W System.err:    at java.lang.reflect.Method.invoke(Native Method)
03-21 21:16:52.239 30862 30862 W System.err:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
03-21 21:16:52.239 30862 30862 W System.err:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
03-21 21:16:52.239 30862 30862 W System.err: Caused by: java.lang.NoSuchFieldError: No static field LinearLayoutCompat of type [I in class Landroid/support/v7/appcompat/R$styleable; or its superclasses (declaration of 'android.support.v7.appcompat.R$styleable' appears in base.apk)
03-21 21:16:52.239 30862 30862 W System.err:    at android.support.v7.widget.LinearLayoutCompat.<init>(LinearLayoutCompat.java:153)
03-21 21:16:52.239 30862 30862 W System.err:    at android.support.v7.widget.LinearLayoutCompat.<init>(LinearLayoutCompat.java:147)
03-21 21:16:52.239 30862 30862 W System.err:    ... 21 more
03-21 21:16:52.240 30862 30862 D com.distriqt.Dialog: DialogViewController::getViewByIdentifier( 0 )

@ajwfrost
Copy link
Collaborator

Hi @mymishagithub
What version of Java are you using for packaging?
03-21 21:16:52.238 30862 30862 W System.err: android.view.InflateException: Binary XML file line #6: Binary XML file line #6: Error inflating class

There's an issue in Android if the Java version is too recent, apparently ..! If you can use Java 8 then this might solve it.

Our other known issues regarding this are:
a) odd things with ANEs going wrong with AIR 33.1 - but this is usually regarding the ActionScript class definitions being missing
b) AAB packages cannot find resources that are packaged into the ANE

If you can confirm which exact version of AIR you're using it would be good (see xml or pdf files in the root of the SDK folder), and if you can package up your apps with "apk-debug" and then send them to us at adobe.support@harman.com then we can take a look further..

thanks

@marchbold
Copy link
Collaborator

marchbold commented Mar 22, 2020

@mymishagithub This error has always been associated with the Java version. Check that you are using one of the 1.8_xxx builds.

@mymishagithub
Copy link

i use adobe animte 2020.
i am updating java to 1.8
but my problem is not fix

distriqt please help me

@marchbold
Copy link
Collaborator

@mymishagithub Log an issue in the dialog repository and we'll help you through it.

@marchbold
Copy link
Collaborator

We have isolated several issues that can cause this all relating to the java installation:

  • Incorrect Java version installed,
    • you must use v1.8.x to package Android apps successfully at the moment
    • use 1.8.0_112 if you need to use an older 1024bit certificate
  • Using the 32bit version instead of a 64bit version
  • Having not set the JAVA_HOME environment variable
  • Including a different java version in the PATH environment

@ajwfrost
Copy link
Collaborator

Re-opening this as it looks like there is an additional issue here.

For anyone with this problem: see the above proposals from Distriqt, and also please try installing a JDK rather than just a JRE. JAVA_HOME should then be set to the top level JDK folder.

This will mean that ADT can use the normal java compiler to compile the resource definition files - there appears to be a bug within the ADT fallback code that generates JavaScript bytecode when the javac tools is not available..

@ajwfrost ajwfrost reopened this Jun 19, 2020
@ajwfrost ajwfrost changed the title com.distriqt.extension.dialog.DialogView does not work in AIR33 ADT does not properly compile R.java files from com.distriqt.extension.dialog.DialogView Jun 19, 2020
@marchbold
Copy link
Collaborator

@ajwfrost Just a note if it helps, this seems to affect declare-styleable resources in particular

@Gokulv617
Copy link

@marchbold

I use jre1.8.0_251 and jdk-15.0.1. Is it okay ?

@marchbold
Copy link
Collaborator

marchbold commented Nov 10, 2020

Yes to 1.8, no to 15.0.1, suggest you remove the JRE and JDK and just install the JDK 1.8.251

@Gokulv617
Copy link

@marchbold

Thank you . I'll do the same

@ajwfrost
Copy link
Collaborator

ajwfrost commented Dec 7, 2021

Re-awakening this one due to some other issues -> the R.java files are being parsed by the built-in ADT code and java bytecode is then being generated. But, the parser is missing arrays such as:

        public static final int[] LinearLayoutCompat = {
            0x010100af, 0x010100c4, 0x01010126, 0x01010127,
            0x01010128, 0x7f01000b, 0x7f0100c9, 0x7f0100ca,
            0x7f0100cb
        };

So we need to update ADT so that it can parse these and set them up in the generated bytecode.

It also seems to be missing values that aren't specified by AAPT as hexidecimal, e.g.

public static final int ActionBar_background = 10;

@marchbold
Copy link
Collaborator

Resolved.

I can no longer replicate this issue with 33.1.1.713

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants