Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Accessing Android R.java resources in a proxy

$
0
0

Hey there,

I'm trying to use Google Play Services with a Titanium module, and am running into an issue. First, a bit of background. When making Android Titanium modules, from my knowledge, if you want to use any resources at all, you have to use TiRHelper or resources.getIdentifier() to access the XML, and cannot use the R.java class, because it isn't generated by Titanium.

With this in mind, I'm trying to use some functions in Google Play services that require using strings that are present in the res/strings directory, and can't be accessed. The error I get is as follows:

[ERROR] TiApplication: (main) [274,274] Sending event: exception on thread: main msg:java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/R$style;; Titanium 3.4.0,2014/09/25 16:42,b54c467
[ERROR] TiApplication: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/R$style;
[ERROR] TiApplication:  at com.google.android.gms.wallet.fragment.WalletFragmentStyle.Z(Unknown Source)
[ERROR] TiApplication:  at com.google.android.gms.wallet.fragment.WalletFragmentOptions.Z(Unknown Source)
[ERROR] TiApplication:  at com.google.android.gms.wallet.fragment.SupportWalletFragment.onCreate(Unknown Source)
[ERROR] TiApplication:  at android.support.v4.app.Fragment.performCreate(Fragment.java:1477)
[ERROR] TiApplication:  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:904)
[ERROR] TiApplication:  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1115)
[ERROR] TiApplication:  at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
[ERROR] TiApplication:  at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1478)
[ERROR] TiApplication:  at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:570)
[ERROR] TiApplication:  at org.appcelerator.titanium.TiBaseActivity.onStart(TiBaseActivity.java:1077)
[ERROR] TiApplication:  at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1220)
[ERROR] TiApplication:  at android.app.Activity.performStart(Activity.java:5949)
[ERROR] TiApplication:  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2261)
[ERROR] TiApplication:  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
[ERROR] TiApplication:  at android.app.ActivityThread.access$800(ActivityThread.java:144)
[ERROR] TiApplication:  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
[ERROR] TiApplication:  at android.os.Handler.dispatchMessage(Handler.java:102)
[ERROR] TiApplication:  at android.os.Looper.loop(Looper.java:135)
[ERROR] TiApplication:  at android.app.ActivityThread.main(ActivityThread.java:5221)
[ERROR] TiApplication:  at java.lang.reflect.Method.invoke(Native Method)
[ERROR] TiApplication:  at java.lang.reflect.Method.invoke(Method.java:372)
[ERROR] TiApplication:  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
[ERROR] TiApplication:  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
[ERROR] TiApplication: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.R$style" on path: DexPathList[[zip file "/data/app/*redacted*/base.apk"],nativeLibraryDirectories=[/data/app/*redacted*/lib/arm, /vendor/lib, /system/lib]]
[ERROR] TiApplication:  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
[ERROR] TiApplication:  at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
[ERROR] TiApplication:  at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
[ERROR] TiApplication:  ... 23 more
[ERROR] TiApplication:  Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.R$style
[ERROR] TiApplication:      at java.lang.Class.classForName(Native Method)
[ERROR] TiApplication:      at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
[ERROR] TiApplication:      at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
[ERROR] TiApplication:      at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
[ERROR] TiApplication:      ... 24 more
[ERROR] TiApplication:  Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
The only way I know of fixing this is modifying the SDK I'm using to use TiRHelper.getResource() on all of it's resource calls. This however, is not possible, since Google Play Services is not open-source. So I find myself out of options. Has anyone else run into this issue when trying to use Google Play Services in Titanium Android Modules?

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>