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

Hi. I am trying to compile and I get the following errors (1st for device, 2nd for simulator). #13

Closed
MichaelMassalas opened this issue Sep 3, 2015 · 16 comments

Comments

@MichaelMassalas
Copy link

[ERROR] : ** BUILD FAILED **
[ERROR] : The following build commands failed:
[ERROR] : Ld build/InBusiness.build/Debug-iphoneos/InBusiness-universal.build/Objects-normal/armv7/InBusiness normal armv7
[ERROR] : Ld build/InBusiness.build/Debug-iphoneos/InBusiness-universal.build/Objects-normal/arm64/InBusiness normal arm64
[ERROR] : (2 failures)
TRACE | titanium exited with exit code 1
ERROR | Error: ti run exited with error code 1
at ChildProcess. (/Users/mmassalas/.appcelerator/install/4.1.2/package/node_modules/appc-cli-titanium/plugins/run.js:84:66)
at ChildProcess.emit (events.js:117:20)
at Process.ChildProcess._handle.onexit (child_process.js:810:12)


[ERROR] : ** BUILD FAILED **
[ERROR] : The following build commands failed:
[ERROR] : Ld build/InBusiness.build/Debug-iphonesimulator/InBusiness-universal.build/Objects-normal/x86_64/InBusiness normal x86_64
[ERROR] : (1 failure)
TRACE | titanium exited with exit code 1
ERROR | Error: ti run exited with error code 1
at ChildProcess. (/Users/mmassalas/.appcelerator/install/4.1.2/package/node_modules/appc-cli-titanium/plugins/run.js:84:66)
at ChildProcess.emit (events.js:117:20)
at Process.ChildProcess._handle.onexit (child_process.js:810:12)

@jpriebe
Copy link
Collaborator

jpriebe commented Sep 3, 2015

Sorry; I'm not sure what is happening. I don't recognize the "InBusiness.build" directories -- I've never seen that directory name show up in a build directory. Do you have some sort of third party software installed?

What Appcelerator/Titanium tools do you have installed?

@MichaelMassalas
Copy link
Author

Hi,

Thanks for the quick response.

The "InBusiness" is the App's name. Also, I do not have any other third party software installed.
Googling the error showed cases where modules that threw that error where missing architecture support.
Could this be the case?

I really appreciate your help.

@MichaelMassalas
Copy link
Author

You can reproduce the error on Appcelerator Studio, Titanium SDK 4.1.0.G.
Just create a new project, copy the example app.js code to the new project's app.js and add the module in TiApp.xml and run on iPhone 6 (v8.4).

@MichaelMassalas
Copy link
Author

Hi again,

I think I found what might be causing the error. I added the module to the project folder (instead of global modules folder) and it seems to be working on iOS.

I will continue working on it and If I come across any similar issue I will report it back here.

Thank you very much.

@jpriebe
Copy link
Collaborator

jpriebe commented Sep 3, 2015

So you're trying to build a mobile app using the module, not trying to build the module itself, right?

I've had no problems adding the module to my app projects. Never tried adding it to global modules.

@MichaelMassalas
Copy link
Author

Oh,

Yes. My mistake, I was not really clear on that one. I am building an App using the module.

By the way, I am now trying it on Android and i get an error:
java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/signin/internal/zzg;

So I tried deleting the google-play-services.jar from lib folder and recompiled. On the Emulator it throws an error:
TiApplication: (main) [58,73] Sending event: exception on thread: main msg:java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 7571000 but found 7895000. You must have the following declaration within the element: ; Titanium 4.1.0,2015/07/06 11:15,d57aa7d

I changed the version.xml to reflect the 7571000 and the app compiles and installs on a device, however, when the time comes to run it I get the following error:
Message: Uncaught Error: Attempt to invoke virtual method 'void ti.dfp.View.requestAd()' on a null object reference

The thing is that I created that object as in the example (as in the iPhone code) so it should not be Null. Could it be due to changing the android gms version?

Any other ideas?

Thanks again for your time!!

@MichaelMassalas
Copy link
Author

Ok.

So I run it again on a New Clean project without other modules (thus I did not have to delete the google-play-services.jar) and it seems to work fine.

However, since I am using Ti.cloudpush 3.4.0, it also contains google play services (zzg, zza, etc...).

Is it possible for you to remove the common ones or do you specifically use those in your module?

Thanks a lot!!

@jpriebe
Copy link
Collaborator

jpriebe commented Sep 3, 2015

The real problem with any modules that use google play services is that they all have to use the same version of the google-play-services.jar, or you'll have horrible conflicts like you're running into. Using subsets of google play services in ti.dfp won't make that issue go away.

Many of my apps also use ti.cloudpush 3.4.0, as well as analytics.google and ti.map. So I have 4 modules that all have google play services dependencies, and 2 or 3 different versions among them.

My fix was to modify the ti.cloudpush and ti.map modules by updating the manifest and replacing the google-play-services.jar file with the one that is in ti.dfp (and updating the timodule.xml to reflect gms version 7895000). I also have a pull request open with the maintainer of the google.analytics module to update to 7895000.

To make matters even worse, I ran into build problems with my app where I had too many method references, and dexer refused to build my app for android. I had to crack open the JAR, strip out games, drive, vision, wallet, and wearables, and zip it back up. Then I had to use this modified JAR for all 4 modules (ti.cloudpush, ti.map, google.analytics, and ti.dfp).

Both of these issues are serious problems facing the Titanium developer community. Keeping google play services in sync across modules is impossible for novice developers, and dexer problems will become increasingly common, given the bloat in google-play-services.jar.

@jpriebe
Copy link
Collaborator

jpriebe commented Sep 3, 2015

BTW -- if you don't feel comfortable modifying Appcelerator's modules (like ti.cloudpush), you could grab the source to this module, use the same version of google-play-services.jar that ti.cloudpush uses (presumably 7.5, based on the version number 7571000), and then build.

You can find old google play services JARs using my blog post: http://www.smorgasbork.com/2015/01/05/google-play-services-sdk-version-history/

@MichaelMassalas
Copy link
Author

Hey,

Thank you very much for your assistance.

Do you have Ti.Map and Ti.Cloudpush modules updated to play with the latest Ti.dfp module?
Could you, please, share their .zip files with me since I do not feel comfortable changing modules?
(I am not that experienced with Java for mobiles or Objective-C)

Oh, and thanks for the link.

@agrycroko
Copy link

Hi Jason,

Hope you don't mind me contacting you. I read with interest your solution to the conflicts encountered when using analytics.google and ti.map in the same Android project.

I've been getting the same problems. Would there be any possibility of you zipping up a compiled copy of each working module so I can just drop them into my ~/Library/Application Support/Titanium/modules/android/* folder and reference them in my tiapp.xml?

The latest analytics.google I have is 3.1.0 and ti.map is 2.3.7

I'm pretty new to Android so not really comfortable compiling modules etc.

Many thanks if you're able to help. It would save my bacon :)

Gary Crook
gary@pragmateq.biz
Skype: garyscrook

@jpriebe
Copy link
Collaborator

jpriebe commented Jan 29, 2016

Attached is a ZIP file witih ti.dfp, google.analytics, ti.map, and ti.cloudpush all using google play services 7.8 with the JAR file stripped down to just the bare essentials. Hopefully it will help some folks.

modules-ti.dfp-issue13.zip

@agrycroko
Copy link

Great, thanks. The project built ok this time :)

Does this mean anything significant in the Appcelerator Studio console:

[WARN] : GAv4: AnalyticsReceiver is not registered or is disabled. Register the receiver for reliable dispatching on non-Google Play devices. See http://goo.gl/8Rd3yj for instructions.
[WARN] : GAv4: CampaignTrackingReceiver is not registered, not exported or is disabled. Installation campaign tracking is not possible. See http://goo.gl/8Rd3yj for instructions.
[WARN] : GAv4: AnalyticsService not registered in the app manifest. Hits might not be delivered reliably. See http://goo.gl/8Rd3yj for instructions.

Deployed to Nexus 6 device directly from Studio.

As per the http://goo.gl/8Rd3yj link, I've ensured the manifest section in tiapp.xml contains

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

@agrycroko
Copy link

Sorry, if a little off scope, but is there a quick answer or point me to a url for how to compile an Android module from source?

@agrycroko
Copy link

Re. ti.map - have you ever tried using .toImage() with it? Gives me a blank image :(

@russnewcomer
Copy link

Hi, Jason - any chance that you would be willing to make another zip file with ti.dfp, ti.map, and ti.cloudpush with the Google Play Services conflicts resolved? I've tried to follow notes I've seen from you and others on how to recompile the modules, and I seem to be missing something with a dependency on GooglePlayServices or something, because my apps keep crashing.

Thanks very much!

@m1ga m1ga closed this as completed Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants