Distriqt Facebook ANE won't compile for Android - facebook

I am having trouble compiling the Distriqt Facebook ANE for Android.
It works fine on iOS but not on Android.
The error message is:
dx tool failed:
UNEXPECTED TOP-LEVEL ERROR: java.lang.OutOfMemoryError: Java heap
space at
com.android.dx.cf.code.ExecutionStack.copy(ExecutionStack.java:66) at
com.android.dx.cf.code.Frame.copy(Frame.java:98) at
com.android.dx.cf.code.Ropper.processBlock(Ropper.java:786) at
com.android.dx.cf.code.Ropper.doit(Ropper.java:742) at
com.android.dx.cf.code.Ropper.convert(Ropper.java:349) at
com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:280)
at
com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:137)
at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:93)
at com.android.dx.command.dexer.Main.processClass(Main.java:729) at
com.android.dx.command.dexer.Main.processFileBytes(Main.java:673) at
com.android.dx.command.dexer.Main.access$300(Main.java:83) at
com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:602)
at
com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
at
com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at
com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:632) at
com.android.dx.command.dexer.Main.processAllFiles(Main.java:510) at
com.android.dx.command.dexer.Main.runMonoDex(Main.java:280) at
com.android.dx.command.dexer.Main.run(Main.java:246) at
com.android.dx.command.dexer.Main.main(Main.java:215) at
com.android.dx.command.Main.main(Main.java:106)
ADT command line:
...
Tried with AIR18 and AIR 16 (updated dx.jar from distriqt tutorial).
My manifest includes all 3 needed extensions:
<extensionID>com.distriqt.Core</extensionID>
<extensionID>com.distriqt.GooglePlayServices</extensionID>
<extensionID>com.distriqt.FacebookAPI</extensionID>
Removing GooglePlayServices makes compilation possible but app crashes when initializing the FacebokAPI.
Using AIR16 without the updated dx.jar also crashes the app directly at startup. The catlog states the following exception:
08-23 14:53:14.793 E/AndroidRuntime(3178): java.lang.RuntimeException:
Unable to get provider com.facebook.FacebookContentProvider:
java.lang.ClassNotFoundException: com.facebook.FacebookContentProvider
in loader
dalvik.system.PathClassLoader[/data/app/air.my.com.zas.lefiner-1.apk]
08-23 14:53:14.793 E/AndroidRuntime(3178): Caused by:
java.lang.ClassNotFoundException: com.facebook.FacebookContentProvider
in loader
dalvik.system.PathClassLoader[/data/app/air.my.com.zas.lefiner-1.apk]
Oddly enough the Distriqt GooglePlusANE which uses Core and GooglePlayServices works fine on both platforms. So i strongly assume there is something wrong with the FacebookAPI extension.
Any help is very much appreciated!

If You are using Intellij IDEA increase Compiler heap size in Actionscript & Flex compiler. This fixed the issue for me.

Related

Groovy:General error during semantic analysis: java.lang.NoSuchMethodError:

Imported the gradle project from the "complete" folder and received the following error:
Groovy:General error during semantic analysis:
java.lang.NoSuchMethodError: 'org.codehaus.groovy.ast.expr.Expression org.codehaus.groovy.ast.tools.GeneralUtils.propX(org.codehaus.groovy.ast.expr.Expression, java.lang.String)'
I am using the latest version of Eclipse, 2020-12, with groovy tools installed.
From grails guide
https://guides.grails.org/gorm-without-grails/guide/index.html
Downloaded code sample from github
https://github.com/grails-guides/gorm-without-grails.git
It seems likely to be a version mismatch, but I cannot determine how to correct this problem.
I have tried to delete the offending file, src/main/groovy/demo/domain/Manufacturer.groovy, and the error appears on the file in this package on line 1.
The error does not appear in any other package. I have done the usual internet searches for resolutions that apply, but have thus far been unable to find a suitable solution. I am hopeful for a suggestion?
I think this error comes from an AST transform that references the older signature of GeneralUtils#propX. This method used to return Expression and was changed to return PropertyExpression.
The bridge method for binary compatibility was missing in groovy-eclipse. https://github.com/groovy/groovy-eclipse/commit/f6f448675d95f858b4ec65b6fc8e55f27ccaaa94

Tessarect implementation JAVA

I'm trying to implement OCR recognition through Tessarect.
But at the moment I'm stuck with this error.
This is what I've done so far:
Homebrew tessarect
Download the API
Link the Jar with my project (build path > Configure build path > Add external Jar's
But when I compile my code this is the error
Error opening data file D:/Tess4J/tessdata/eng.traineddata
Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory.
Failed loading language 'eng'
Tesseract couldn't load any languages!
Warning: Invalid resolution 0 dpi. Using 70 instead.
I've downloaded the eng trained data and I've tried different stuff but I can't figure out how to solve this.
I'm running eclipse in macOS Catalina.
Thanks!
My situation
Set your datapath correctly.
Your location D:/Tess4J/tessdata/eng.traineddata is wrong

Why the app produced by flutter build web sometimes doesn't work?

I have 2 issues that only appear when executing flutter build web.
Sometimes flutter build web fails complaining (wrongly) about types that were not compatible (see below).
Sometimes the build process finishes but then the web app doesn't work: doesn't display anything and there are no messages in the console.
The error I mention is something like this:
% flutter build web
Target dart2js failed: Exception: lib/main.dart:24:31:
Error: A value of type 'ApiUsersRepository' can't be assigned to a variable of type 'UsersRepository'.
- 'ApiUsersRepository' is from 'package:my_app/api_users_repo.dart' ('lib/api_users_repo.dart').
- 'UsersRepository' is from 'lib/users_repo.dart'.
final UsersRepository usersRepository = ApiUsersRepository();
^
Error: Compilation failed.
The app is working in iOS and web when developing.
The solution
I changed all imports of my files like:
import 'package:my_app/users_repo.dart';
To:
import 'users_repo.dart';
More Details
Investigating the error about types, I found this issue, where the important part is this comment: after changing every import to relative format it resolves my problem.
So I did that, and it solved the 2 issues, the compilation error, and the runtime error.
for me I had to remove a package that was corrupted. c:\src\flutter.pub-cache\hosted\pub.dartlang.org\localstorage-4.0.0+1 Apparently, a file had become corrupted by me invertly. I removed the package and did a flutter pub get then recompiled and it worked.

How to remedy error caused by guava: Program type already present: com.google.common.util.concurrent.internal.InternalFutures

An AAR library already uses com.google.guava.
If an app includes the following in its build.gradle:
api 'com.google.guava:guava:27.0-android'
Building the app generates the following error:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: ...
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Program type already present: com.google.common.util.concurrent.internal.InternalFutures
If I do not include "api 'com.google.guava:guava:27.0-android'", the app can be built, but it has runtime error of java.lang.NoClassDefFoundError when it reaches the point of using the Guava method: Iterables.find
I had to update to version 27.0.1, at the time of writing they still haven't updated the README with this new version.
implementation 'com.google.guava:guava:27.0.1-android'
Since Guava 27.0, ListenableFuture is located in separate artifact, see the announcement. You can try two things (one at a time):
Exclude "listenablefuture" module (group "com.google.guava") and build your project again.
I don't know the AAR specifics, but it could be that 27.0-android doesn't work with AAR, so you should try 26.0-android instead.

xcode no suitable image found

I'm running into following error
The bundle “Project-name” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.
Reason: no suitable image found. Did find:
/Users/name/Documents/proj-name: required code signature missing for '/Users/name/Documents/proj-name/Frameworks/Project.framework/Project'
)
Program ended with exit code: 82
I've a dependency which itself a custom Framework file (library) and added this to current project but running into problem when I run a test.
Project compiles and builds fine, error appears when running tests.
Swift 3.0, XCode 8.0