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

multi-dex option #31

Open
rafaeliga opened this issue Dec 12, 2016 · 5 comments
Open

multi-dex option #31

rafaeliga opened this issue Dec 12, 2016 · 5 comments

Comments

@rafaeliga
Copy link

Hey,

I was trying to add the Google maps library to my project and Im getting this error:

"trouble writing output: Too many field references: 67853; max is 65536. You may try using --multi-dex option"

Reference: https://developer.android.com/studio/build/multidex.html

I tried to look at motion-gradle code to add the option that Google suggests: add "multiDexEnabled true" to build.gradle, but seems that the motion-gradle's build.gradle its a java one and I cant add android options, Im not sure about this java part, but that was I found googling/searching for the error too.

Thanks!

@jjaffeux
Copy link
Contributor

can you show me the code of your Rakefile (the gradle block) please ?

@rafaeliga
Copy link
Author

app.gradle do
dependency 'com.android.support:appcompat-v7:24.0.0'
dependency 'com.android.support:design:24.0.0'
dependency 'com.android.support:support-v4:24.0.0'
dependency 'com.facebook.android:facebook-android-sdk:4.16.1'
dependency 'com.squareup.picasso:picasso:2.5.2'
repository 'https://jitpack.io'
dependency 'com.github.PhilJay:MPAndroidChart:v3.0.0'
dependency "commons-io:commons-io:+"
dependency 'com.bozapro.circular-slider-range:library:1.2.0'
dependency 'com.google.android.gms:play-services:10.0.1'
end

@jjaffeux
Copy link
Contributor

jjaffeux commented Dec 12, 2016 via email

@rafaeliga
Copy link
Author

Not right now, but in the future Im going to use the other Play Services, I tried this too, same error:

app.gradle do
dependency 'com.android.support:appcompat-v7:24.0.0'
dependency 'com.android.support:design:24.0.0'
dependency 'com.android.support:support-v4:24.0.0'
dependency 'com.facebook.android:facebook-android-sdk:4.16.1'
dependency 'com.squareup.picasso:picasso:2.5.2'
repository 'https://jitpack.io'
dependency 'com.github.PhilJay:MPAndroidChart:v3.0.0'
dependency "commons-io:commons-io:+"
dependency 'com.bozapro.circular-slider-range:library:1.2.0'
dependency 'com.google.android.gms:play-services-maps:10.0.1'
end

@jjaffeux
Copy link
Contributor

@MarkVillacampa @Watson1978 I have the feeling this multi-dex option should be supported in RubyMotion toolchain and not in motion-gradle

I mean the problem is not when we pull dependencies, it works, but when we build the app I think. So there's should probably be a flag in RMA config 'multi_dex', and the only thing motion-gradle should do automatically is (pseudo code):

if config.multi_dex
  if config.api_level < 21
    gradle_dependencies << 'com.android.support:multidex:1.0.1'
  end
end

But adding the --multi-dex flag should happen when the app is compiled IMO.
Let me know what you think.

./cc @rafaeliga

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

2 participants