Issue Description
For the purpose of using custom Java classes, we have created a custom aar file and added it to platform folder.
After the build process, even though the class is available in the corresponding classes.jar file, it is giving an error as "Requested module not found" while importing it.
Steps to reproduce:
1.Create an Android module(samplemodule) in Android Studio with some sample class. Let's say it is com.test.FirstClass
2. Build aar file for this module (samplemodule-release.aar)
3. Create an Android project in Appcelerator Stuido and copy the samplemodule-release.aar to android folder in platform section of this new Appcelerator Project.
4. Try to import the class in the android module as follows:
var FirstClass = require('com.test.FirstClass');
5. Everything will work fine.
6. Now add a new class called com.test.SecondClass in the Android module in Android Studio.
7. Clean the Android module and build aar file again (samplemodule-release.aar).
8. Now replace the old aar file in platform folder of Appcelerator project with this new aar file.
9. If you try to import the second class that is created as follows, it will give an error as 'requested module not found'.
var SecondClass = require('com.test.SecondClass');
As discussed on the call, please let me know where i can get the version 2.0.0 to try. Thanks
[~rramirez] Did you try this again?
Yes, works since Hyperloop 2.X thanks.
I was able to successfully reproduce the issue by following the steps in the description. Tried with: SDK 5.5.0.GA, Hyperloop 1.2.8 SDK 6.0.1.GA, Hyperloop 2.0.0 SDK 6.0.1.GA Hyperloop 2.1.0 beta
Appc Studio : 4.8.1.201612050850 SDK Version : 6.1.0.GA. 5.0.0.GA Mac OS Version : 10.12.2 Xcode Version : Xcode 8.2.1 Build version 8C1002 Appc CLI AND Appc NPM : {"NPM":"4.2.9-1","CLI":"6.1.0"} Ti CLI : 5.0.11 Alloy : 1.9.5 Node : v4.6.0 Hyperloop: 1.2.8, 2.0.0, 2.1.0 beta
[~rramirez], this is a metabase caching issue for third party libraries. Until we fix this, there is a simple workaround: Look for the following line in the build log:
Deleting the mentioned cache file will solve the issue. This only needs to be done when a third party library is replaced. Adding a new one or removing an existing one will automatically invalidate the cache file.
Hii [~jvennemann] can you please tell me where exactly is located this folder /var/folders/mh/2_3ycdzx0v79p0wglc59lyrh0000gp/T/hyperloop_android-23_metabase.590a5d257d5adc20b7449acdd5dc3ff56514d125.json.gz ? รงรง
[~rramirez], it's different depending on the .aar files used. You have to look in the build log of the project and search for these lines: When the project is build for the first time or you added/removed an .aar file:
When you replaced an .aar file:
I'll discuss this ticket with Eric tomorrow on the status.
PR (master): https://github.com/appcelerator/hyperloop.next/pull/168 PR (2_1_X): https://github.com/appcelerator/hyperloop.next/pull/169
Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.