Cannot build file APK

Dear all,
I built application to communicate with Microbit via IOPin
( view tutorial here: http://iot.appinventor.mit.edu/#/microbit/microbitiopin )
I tested with AI Compnasion, it run successfully. But I want to build to file .Apk, It warning error.)
I post error image warning and file .aia here.
Could you help me to fix it ?
Five_Pin_data.aia (338.2 KB)

Just tried it, this is the whole error output:

App Inventor is unable to compile this project.
The compiler error output was
________Preparing application icon
________Creating animation xml
________Creating style xml
________Creating provider_path xml
________Creating network_security_config xml
________Generating adaptive icon file
________Generating round adaptive icon file
________Generating adaptive icon background file
________Generating manifest file
________Attaching native libraries
________Attaching Android Archive (AAR) libraries
________Attaching component assets
________Invoking AAPT
AAPT time: 1.037 seconds
________Compiling source files
(compiling appinventor/ai_chrisward2k2/Five_Pin_data/Screen1.yail to appinventor.ai_chrisward2k2.Five_Pin_data.Screen1)
appinventor/ai_chrisward2k2/Five_Pin_data/Screen1.yail:267: internal error while compiling appinventor/ai_chrisward2k2/Five_Pin_data/Screen1.yail
java.lang.RuntimeException: no such class: com.bbc.microbit.profile.Microbit_Temperature
at gnu.bytecode.ObjectType.getReflectClass(ObjectType.java:179)
at gnu.bytecode.ClassType.getModifiers(ClassType.java:103)
at gnu.bytecode.ClassType.isInterface(ClassType.java:471)
at gnu.expr.InlineCalls.checkType(InlineCalls.java:56)
at gnu.expr.InlineCalls.visit(InlineCalls.java:49)
at gnu.expr.InlineCalls.visitSetExpValue(InlineCalls.java:363)
at gnu.expr.InlineCalls.visitSetExpValue(InlineCalls.java:28)
at gnu.expr.ExpVisitor.visitSetExp(ExpVisitor.java:114)
at gnu.expr.InlineCalls.visitSetExp(InlineCalls.java:369)
at gnu.expr.InlineCalls.visitSetExp(InlineCalls.java:28)
at gnu.expr.SetExp.visit(SetExp.java:406)
at gnu.expr.ExpVisitor.visit(ExpVisitor.java:55)
at gnu.expr.InlineCalls.visit(InlineCalls.java:46)
at gnu.expr.InlineCalls.visitBeginExp(InlineCalls.java:272)
at gnu.expr.InlineCalls.visitBeginExp(InlineCalls.java:28)
at gnu.expr.BeginExp.visit(BeginExp.java:156)
at gnu.expr.ExpVisitor.visit(ExpVisitor.java:51)
at gnu.expr.InlineCalls.visit(InlineCalls.java:46)
at gnu.expr.QuoteExp.validateApply(QuoteExp.java:162)
at gnu.expr.InlineCalls.visitApplyExp(InlineCalls.java:119)
at gnu.expr.InlineCalls.visitApplyExp(InlineCalls.java:28)
at gnu.expr.ApplyExp.visit(ApplyExp.java:410)
at gnu.expr.ExpVisitor.visit(ExpVisitor.java:55)
at gnu.expr.InlineCalls.visit(InlineCalls.java:46)
at gnu.expr.InlineCalls.visit(InlineCalls.java:28)
at gnu.expr.LambdaExp.visitChildrenOnly(LambdaExp.java:1664)
at gnu.expr.LambdaExp.visitChildren(LambdaExp.java:1651)
at gnu.expr.InlineCalls.visitScopeExp(InlineCalls.java:279)
at gnu.expr.InlineCalls.visitLambdaExp(InlineCalls.java:349)
at gnu.expr.InlineCalls.visitLambdaExp(InlineCalls.java:28)
at gnu.expr.ExpVisitor.visitModuleExp(ExpVisitor.java:103)
at gnu.expr.ModuleExp.visit(ModuleExp.java:482)
at gnu.expr.ExpVisitor.visit(ExpVisitor.java:51)
at gnu.expr.InlineCalls.visit(InlineCalls.java:46)
at gnu.expr.InlineCalls.inlineCalls(InlineCalls.java:33)
at gnu.expr.Compilation.walkModule(Compilation.java:994)
at gnu.expr.Compilation.process(Compilation.java:1965)
at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:330)
at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:315)
at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:315)
at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:315)
at kawa.repl.compileFiles(repl.java:783)
at kawa.repl.processArgs(repl.java:412)
at kawa.repl.main(repl.java:827)
Caused by: java.lang.ClassNotFoundException: com.bbc.microbit.profile.Microbit_Temperature
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at gnu.bytecode.ObjectType.getContextClass(ObjectType.java:108)
at gnu.bytecode.ObjectType.getReflectClass(ObjectType.java:172)
… 43 more
Kawa compile time: 2.161 seconds
.

Unfortunately this Project is using the old MicroBit extension - I think it is most likely the reason why the compile fails.

The latest extension is available here:
iot.appinventor.mit.edu/#/microbit/microbitintro

Dear Chris,
This project is using newest Microbit extension and lastest Bluetooth LE Extension.
Your link provide is Simple Microbit extension, it does not have IoPin configure and read pin data.
I imported the file .aia from tutorial http://iot.appinventor.mit.edu/#/microbit/microbitiopin
and customize it. All functions are work well with AI Compansion, but I cannot Build it to APK file. The original file .aia is the same result.

That’s right, the latest Extension is simplified. I’m not sure why, possibly to do with the new Google Android security measures. I will assign your Topic to MIT.

Dear Chris,
I got the newest Extebsion from Evan, I will test it with IOPIn and confirm later.

Hi again - Any luck?

Yes, it worked well with newese Simple Microbit extension.

Good to know!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.