caffeinalab / ti.goosh

GCM/FCM module for Titanium.
MIT License
52 stars 34 forks source link

Cannot build with 7.1.0 SDK. #105

Closed miniman42 closed 6 years ago

miniman42 commented 6 years ago

Hi All,

I've been working successfully with this module for sometime and recently updated to SDK 7.0.2. That all worked fine, no problems building using etc....

I've since tried to build the module with the latest Appc update of SDK 7.1.0 and cannot get the module to build.

I'm getting compiler errors e.g. [ERROR] .../workspaces/appcelerator/ti.goosh/android/src/ti/goosh/InstanceIDListener.java:40: error: no suitable constructor found for Intent(InstanceIDListener,Class<RegistrationIntentService>) [ERROR] Intent intent = new Intent(this, RegistrationIntentService.class); [ERROR] ^ [ERROR] constructor Intent.Intent(String,Uri) is not applicable [ERROR] (argument mismatch; InstanceIDListener cannot be converted to String) [ERROR] constructor Intent.Intent(Context,Class<?>) is not applicable [ERROR] (argument mismatch; InstanceIDListener cannot be converted to Context) [ERROR] .../workspaces/appcelerator/ti.goosh/android/src/ti/goosh/InstanceIDListener.java:41: error: cannot find symbol [ERROR] startService(intent); [ERROR] ^ ...

It looks like the compiler is not recognising the class as an instance of InstanceIDListenerService i.e a service/context!

If I switch the sdk back to 7.0.2 (appc ti setup sdk) then it builds again fine...

Any ideas or help much appreciated.

Thanks

G

miniman42 commented 6 years ago

Anyone had any luck building with latest SDK?

progress44 commented 6 years ago

Hi @miniman42 I just tried building the module with the Titanium SDK version 7.1.0 and it builds and works just fine. You can use the latest release though. Don't need to build it yourself if that's causing problems.

Let me know how it goes

miniman42 commented 6 years ago

I just tried again - cloned the repo and built locally and still getting the above issue so now I need to understand why it doesn't work (and does no problem for SDK 7.0.2).

I have forked the repo to add some minor updates for our use case so I do need to be able to build it myself so would really appreciate any pointers. Note: for the purpose of testing the issue I am using the master repo and not our fork - to avoid any doubt!

Here's my tooling in case that points to any obvious issue, any suggestions greatly appreciated!

Operating System Name = Mac OS X Version = 10.13.4 Architecture = 64bit

CPUs = 8

Memory = 16.0GB

Node.js Node.js Version = 8.5.0 npm Version = 5.4.2

Appcelerator CLI Installer = 4.2.12 Core Package = 7.0.2

Titanium CLI CLI Version = 5.0.14 node-appc Version = 0.2.41

Titanium SDKs 7.1.0.GA Version = 7.1.0 Install Location = /Users/XXX/Library/Application Support/Titanium/mobilesdk/osx/7.1.0.GA Platforms = iphone, android git Hash = df92fbf git Timestamp = 3/14/2018 20:46 node-appc Version = 0.2.43

Java Development Kit Version = 1.8.0_162 Java Home = /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home

Android SDK Android Executable = not found ADB Executable = /Users/XXX/Library/android-sdk-macosx/platform-tools/adb SDK Path = /Users/XXX/Library/android-sdk-macosx

Android NDK 0NDK Path = /Users/XXX/Tools/android-ndk/android-ndk-r16b NDK Version = 16.1.4479499

Android Platforms 1) android-25 Name = Android 7.1.1 API Level = 25 Revision = 2 Skins = HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800, WVGA854, WXGA720, WXGA800, WXGA800-7in, AndroidWearRound, AndroidWearRound360x360, AndroidWearRound400x400, AndroidWearRound480x480, AndroidWearRoundChin320x290, AndroidWearRoundChin320x300, AndroidWearRoundChin360x325, AndroidWearRoundChin360x326, AndroidWearRoundChin360x330, AndroidWearSquare, AndroidWearSquare240x240, AndroidWearSquare320x320 ABIs = x86, armeabi-v7a, arm64-v8a, x86_64 Path = /Users/XXX/Library/android-sdk-macosx/platforms/android-25 2) android-26 Name = Android 8.0.0 (not supported by Titanium SDK 7.1.0.GA, but may work) API Level = 26 Revision = 1 Skins = HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800, WVGA854, WXGA720, WXGA800, WXGA800-7in ABIs = x86 Path = /Users/XXX/Library/android-sdk-macosx/platforms/android-26

progress44 commented 6 years ago

Can you create a PR with your updates so I can try building it?

miniman42 commented 6 years ago

Hey Ani, the output above is from the master branch - ie without my updates! I’ve no idea why it won’t build anymore, even as I said with a clean clone of the goosh repo. Nothing else I build has a problem. The only thing I can think is that perhaps as a result of the ti.playservices module now being included as a dependent module, that some of the classes may be deprecated when we use a later version of playservices (appc are using a really old version atm until they figure a clean way to force users to download the latest version). I’ve updated to a later version (11.8 I think- I’m not on my Mac atm) of playservices in our app, as we use google FIT apis and the later google sign in apis. So perhaps that’s the cause! If that’s the case the mod will need an update soon to support current GPS as appc have an update coming soon AFAIK.

miniman42 commented 6 years ago

Hi Ani, I got a chance to look at this again today. I can indeed build the module if I specify the SDK bundled ti.playservices module version 11.0.40 as the specific module dep in the timodule.xml. Curiously this is not necessary pre Ti SDK 7.1.0 as the module will build perfectly using an updated ti.playservices dependency.

We use an updated ti.playservices with GPS V11.8.0 from this PR (https://github.com/appcelerator-modules/ti.playservices/pull/9) as we need other updated libs in GPS (e.g. fit etc..). Ti.Goosh builds perfectly with this when using SDK 7.0.2, however the error above starts to happen when SDK versions higher than 7.0.2 are used.

I'm not sure I understand why this is happening, as clearly the module can be built when depending on the updated GPS jars/aars. Have you any thoughts on how to resolve? Is this an SDK bug possibly?

miniman42 commented 6 years ago

I've filed an issue with Appcelerator to see if they can help : https://jira.appcelerator.org/browse/AC-5748

progress44 commented 6 years ago

I'll try to build the module with the updated GPS you mention and I'll get back to you. It seems strange though because the Intent class where you're getting the errors is not under the GPS namespace. It's an android feature.

miniman42 commented 6 years ago

Hi Ani, Appc have recognised the issue (due to incorrectly packaged GPS jars in the SDK source) - see: https://jira.appcelerator.org/browse/TIMOB-26131 - a bit of effort but we got there! Workaround for now is to delete the 4 GPS jars from the SDK directly as they are loaded dynamically (if present) by the apk runtime.

progress44 commented 6 years ago

@miniman42 That's great. Closing the issue.