Riyas TK
Riyas TK

Reputation: 1251

error while building phonegap app using ionic

I need to build an phonegap app using angularjs . so i choose ionic framework. these are the steps, I have done so far.

  1. set up java,ant, adt and their path.
  2. install ionic using command

    npm install -g ionic

  3. start ionic project uisng

    ionic ionic start ex1

  4. add ionic platform

    ionic platform add android

  5. build using command

    ionic build android

But doing building, it shows error.

BUILD FAILED
C:\Android\adt-bundle\sdk\tools\ant\build.xml:932: The following error occurred
while executing this line:
C:\Android\adt-bundle\sdk\tools\ant\build.xml:950: null returned: -1073741819

Total time: 11 seconds

C:\Android\fresh\platforms\android\cordova\node_modules\q\q.js:126
                    throw e;
                          ^
Error code 1 for command: cmd with args: /s,/c,ant,debug,-f,C:\Android\fresh\pla
tforms\android\build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen

I hadn't modified any code still. and apache ant and java are also working. Why this error?

the contents in C:\Android\adt-bundle\sdk\tools\ant\build.xml is added below

line 930  <target name="-package-resources" depends="-crunch">
                <!-- only package resources if *not* a library project -->
line 932    <do-only-if-not-library elseText="Library project: do not package resources..." >
              <aapt executable="${aapt}"
                    command="package"
                    versioncode="${version.code}"
                    versionname="${version.name}"
                    debug="${build.is.packaging.debug}"
                    manifest="${out.manifest.abs.file}"
                    assets="${asset.absolute.dir}"
                    androidjar="${project.target.android.jar}"
                    apkfolder="${out.absolute.dir}"
                    nocrunch="${build.packaging.nocrunch}"
                    resourcefilename="${resource.package.file.name}"
                    resourcefilter="${aapt.resource.filter}"
                    libraryResFolderPathRefid="project.library.res.folder.path"
                    libraryPackagesRefid="project.library.packages"
                    libraryRFileRefid="project.library.bin.r.file.path"
                    previousBuildType="${build.last.target}"
                    buildType="${build.target}"
line 950            ignoreAssets="${aapt.ignore.assets}">
                <res path="${out.res.absolute.dir}" />
                <res path="${resource.absolute.dir}" />
                <!-- <nocompress /> forces no compression on any files in assets or res/raw -->
                <!-- <nocompress extension="xml" /> forces no compression on specific file extensions in assets and res/raw -->
            </aapt>
        </do-only-if-not-library>
    </target>

Upvotes: 0

Views: 278

Answers (1)

Riyas TK
Riyas TK

Reputation: 1251

Finally i have solved this issue, ie the error -1073741819 . this is due to bug in aapt.exe file build-tools in sdk for windows users.

Replace the aapt.exe file with this file https://android.googlecode.com/issues/attachment?aid=776290120000&name=aapt.exe.zip&token=ABZ6GAcRj6lR-sOmUyVguB0Gmf_BI4Z7Gg%3A1415016896298

for more information, Check this page

https://code.google.com/p/android/issues/detail?id=77629

Upvotes: 1

Related Questions