Skip to main content
Participant
December 5, 2011
Question

Got java.lang.NullPointerException when compiling for iOS app store. Any ideas?

  • December 5, 2011
  • 7 replies
  • 2666 views

Hi,

I've been developing a calculator app for iOS using Adobe AIR 3.0. I'm using the latest Flex SDK 4.6 for compilation in FlashDevelop 4.0.

Everything worked great for testing purposes (using ipa-debug-interpreter and ipa-test-interpreter targets.)

However, when using slow compile mode targets (using ipa-debug and ipa-test targets) and when compiling for ad-hoc or app store (ipa-app-store target), I get the following error:

Packaging: dist\MetaCalcIPhone-app-store.ipa

using certificate: cert/iphone_dev.p12...

Exception in thread "main" java.lang.NullPointerException

        at adobe.abc.GlobalOptimizer.sccp_eval(GlobalOptimizer.java:6944)

        at adobe.abc.GlobalOptimizer.sccp_analyze(GlobalOptimizer.java:5909)

        at adobe.abc.GlobalOptimizer.sccp(GlobalOptimizer.java:4628)

        at adobe.abc.GlobalOptimizer.optimize(GlobalOptimizer.java:3514)

        at adobe.abc.GlobalOptimizer.optimize(GlobalOptimizer.java:2215)

        at adobe.abc.LLVMEmitter.optimizeABCs(LLVMEmitter.java:524)

        at adobe.abc.LLVMEmitter.generateBitcode(LLVMEmitter.java:335)

        at com.adobe.air.ipa.AOTCompiler.convertAbcToLlvmBitcodeImpl(AOTCompiler.java:412)

        at com.adobe.air.ipa.BitcodeGenerator.main(BitcodeGenerator.java:82)

Compilation failed while executing : ADT

Press any key to continue...

I'm at the last stage of the development. Just need to submit the app to the app store. Any pointers would help. Thanks.

This topic has been closed for replies.

7 replies

April 11, 2012

Any one has successfully figured out the reason yet? Strict mode is off, warning is off and we are still facing the issue, however, it works fine through flash builder export. I fired a bug report "Bug 3163329" to reflect this issue.

Thanks

aeonusAuthor
Participant
December 13, 2011

Hi

I've found a solution to the problem.

I had turned strict mode off for compiling my app, which was causing the problem. Turning strict mode off allowed undeclared variables, duplicate variable definitions and inexplicit assignments without typecasting to exist.

The reason interpreter builds worked fine was because the AIR runtime interpreted the actionscript code on the device on the fly. The slower build targets - ipa-debug, ipa-test and ipa-app-store failed because the compiler tried to convert all actionscript code to bytecode. And when it came across those undeclated variables, it got a NullPointerException.

It would've been a little more helpful had the error been a little more clear, but I'm glad I figured it out.


So, do not disable strict mode and warnings. Turn them back on, fix your errors, and the app should compile fine.

December 20, 2011

no go for me. I've had strict mode on the entire time and am still seeing the error. but thanks for the direction. I'm going to continue to investigate looking for possible null variables.

December 12, 2011

I am seeing the same issue as well, exact scenario, exact error. Did you find a work around or solution to this issue?

Participating Frequently
December 13, 2011

@aeonus,@R.Tapia

Please file a bug at http://bugbase.adobe.com with your source and post the bug number here.

Thanks,

Sanika

aeonusAuthor
Participant
December 5, 2011

What I think might be the problem:

When I downloaded the newest version of AIR and compiled my app, it gave me this message:

D:\Dropbox\MetaCalc\MetaCalcIPhone\application.xml: error 305: Intial window content SWF version 14 exceeds namespace version http://ns.adobe.com/air/application/3.0

So I added a -swf-version=13 flag to the mxmlc compile statement, and then I got the other error given in the first post.

I just ran the same compile statement on a different SWF (using the application.xml given above) and it worked like a charm. So could it be that some code in my SWF is preventing ADT from compiling it to an IPA?


If so, this is going to be really hard to track down the problem since the code is 20k+ lines.

This is really confusing. I'd really appreciate if someone can help me with this.

aeonusAuthor
Participant
December 5, 2011

Here's the command I'm executing:

call adt -package -target ipa-app-store  -storetype pkcs12 -keystore "cert/iphone_dev.p12"  -provisioning-profile cert/iphone_dev.mobileprovision -storepass **PASS** "dist\MetaCalcIPhone-app-store.ipa" "application.xml" -C bin . -C "icons/ios" . -extdir ..\Common\lib

If I replace "ipa-app-store" with "ipa-test-interpreter", it works great. But that IPA would only be good for testing on devices, not for App Store submission.

Below are the contents of my application.xml file:

<?xml version="1.0" encoding="utf-8" ?>

<application xmlns="http://ns.adobe.com/air/application/3.0">

    <id>org.fleon.metacalc</id>

    <versionNumber>1.0</versionNumber>

    <supportedProfiles>mobileDevice</supportedProfiles>

    <filename>MetaCalcIPhone</filename>

    <name>Meta Calculator</name>

    <description>

    </description>

    <copyright></copyright>

    <iPhone>

        <InfoAdditions><![CDATA[

            <key>UIStatusBarStyle</key>

            <string>UIStatusBarStyleBlackOpaque</string>

            <key>UIRequiresPersistentWiFi</key>

            <string>NO</string>

            <key>UIPrerenderedIcon</key> 

            <true/>

            <key>UIApplicationExitsOnSuspend</key>

            <true/>

            <key>UIDeviceFamily</key>

            <array>

                <string>1</string>

                <string>2</string>

            </array>

        ]]></InfoAdditions>

        <requestedDisplayResolution>high</requestedDisplayResolution>

    </iPhone>

    <initialWindow>

        <title>MetaCalcIPhone</title>

        <content>MetaCalcIPhone.swf</content>

        <visible>true</visible>

        <fullScreen>true</fullScreen>

        <autoOrients>false</autoOrients>

        <aspectRatio>landscape</aspectRatio>

        <renderMode>gpu</renderMode>

    </initialWindow>

    <icon>

        <image72x72>icons/icon_72.png</image72x72>

        <image57x57>icons/icon_57.png</image57x57>

        <image48x48>icons/icon_48.png</image48x48>

        <image114x114>icons/icon_114.png</image114x114>

        <image512x512>icons/icon_512.png</image512x512>

    </icon>

</application>