Cant build application


#1

com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536

please how can i solve this???


#2

@olau
The information you have provided is insufficient to assist you. Please provide some info on what are you trying to do, and when are you getting this error.


#3

@olau it appears to me that you are using too many android plugins, or a plugin which imports too much Java in your app (typical with Google and Firebase sdks).

Follow the instructions outlined in the comment - https://github.com/NativeScript/sample-Android-Multidex/issues/2#issuecomment-347854846

The repository is a demo project itself - you can copy the multidex application implementation, and should be good to go!


#4

thank you @Pete.K
what you suggested solved the issue


#5

Hello.

After that, I’m getting this:

$ tns build android --clean
Executing before-prepare hook from C:\Android\Projetos\OSDCVUApp\hooks\before-prepare\nativescript-dev-typescript.js
Found peer TypeScript 2.3.4
app/application.android.ts(5,7): error TS2415: Class ‘Application’ incorrectly extends base class ‘android.app.Application’.
Property ‘onCreate’ is protected in type ‘Application’ but public in type ‘Application’.

app/application.android.ts(18,25): error TS2339: Property ‘multidex’ does not exist on type ‘typeof support’.

Executing before-prepare hook from C:\Android\Projetos\OSDCVUApp\hooks\before-prepare\nativescript-plugin-firebase.js
Preparing project…
Successfully prepared plugin nativescript-angular for android.
Successfully prepared plugin nativescript-appversion for android.
Successfully prepared plugin nativescript-camera for android.
Successfully prepared plugin nativescript-couchbase for android.
Successfully prepared plugin nativescript-drop-down for android.
Successfully prepared plugin nativescript-floatingactionbutton for android.
Successfully prepared plugin nativescript-geolocation for android.
Successfully prepared plugin nativescript-gif for android.

My references.d.ts:

/// \<reference path="./node_modules/tns-core-modules/tns-core-modules.d.ts" /> Needed for autocompletion and compilation.
/// \<reference path="./node_modules/tns-platform-declarations/android/android.d.ts" /> Needed for autocompletion and compilation.
/// \<reference path="./node_modules/tns-platform-declarations/ios/ios.d.ts" /> Needed for autocompletion and compilation.

PS: the first counter-bar is not there, putted just to be displayed here.

And the build fails. Using Angular.
Any ideas?


#6

Seems I was being stubborn creating a application.android.ts. Changing to just application.android.js (with the JS recipe) seems that worked. Also, adding this as reference: https://docs.nativescript.org/angular/runtimes/android/advanced-topics/extend-application-activity.