Can't build project with minSdk = 21 - android

I'm succesfully building the project with min sdks up to 20, but when i try to build with:
minSdkVersion 21
targetSdkVersion 21
I get an error:
:project:preDexDebug
no classfiles specified
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':project:preDexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/Users/user/android-sdk-macosx/build-tools/21.1.1/dx -JXmx2g --dex --multi-dex --output /Users/user/Project-Android/project/build/intermediates/pre-dexed/debug/tween-engine-api-sources-a613effab3e9735b093029491b18c5c4872bdf88.jar /Users/user/Project-Android/project/build/intermediates/exploded-aar/android-ui-client.gdxlibrary/android/unspecified/libs/tween-engine-api-sources.jar
Error Code:
1
Output:
no classfiles specified
I'm using libgdx in some places of the app.
Then the install dialog apears and if I choose a device I get another error:
Target device: genymotion-google_nexus_6___5_0_0___api_21___1440x2560-192.168.56.103:5555
Uploading file
local path: /Users/user/Project-Android/project/build/outputs/apk/project-debug.apk
remote path: /data/local/tmp/com.ui.client.debug
I/O Error: /Users/user/Project-Android/project/build/outputs/apk/project-debug.apk (No such file or directory)
And then an IDE dialog apears with error message:
Failed to complete Gradle execution.
Cause:
(just empty space after cause)

I had exactly the same problem. After running gradle with --debug option it turned out that gradle failed to process a jar file with no class files in it (a *-javadoc.jar).
Removing the file from /libs folder fixed the issue.

Related

cordova build android - my first app build failed

I try make a first app like in manual https://cordova.apache.org/docs/en/latest/guide/cli/index.html
but after command cordova build android
FAILURE: Build failed with an exception.
Where:
Settings file '/Users/roman2322/Desktop/cordova/7/hello/platforms/android/settings.gradle'
What went wrong:
Could not compile settings file '/Users/roman2322/Desktop/cordova/7/hello/platforms/android/settings.gradle'.
startup failed:
General error during conversion: Unsupported class file major version 62

FAILURE: Build failed with an exception. - Android

AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{}],"original":"ERROR:: AAPT: D:\android-basics-kotlin-cupcake-app-starter\app\build\intermediates\processed_res\debug\out\resources-debug.ap_: error: The system cannot find the file specified. (2).\nerror: failed to create archive.\n\n ","tool":"AAPT"}
Task :app:mergeDebugNativeLibs
Task :app:mergeExtDexDebug
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugResources'.
A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
Android resource linking failed
ERROR:: AAPT: D:\android-basics-kotlin-cupcake-app-starter\app\build\intermediates\processed_res\debug\out\resources-debug.ap_: error: The system cannot find the file specified. (2).
error: failed to create archive.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 7s
27 actionable tasks: 26 executed, 1 up-to-date
Can anyone help me to solve this problem...? please...
This is what happens when aapt fails to create an archive.
First make sure you are using the latest IDE and SDK. aapt for packaging is obsolete, and the earlier aapt2 has many bugs.
If they are up to date, try to check if the following processes on your computer have read/write access to the project directory.
[your android sdk path]\build-tools[your sdk version]\aapt.exe
[your android sdk path]\build-tools[your sdk version]\aapt2.exe
[your android studio path]\bin\studio64.exe
[your android studio path]\bin\fsnotifier64.exe
[your android studio path]\jre\bin\java.exe
[your android studio path]\jre\bin\javaw.exe
If you haven't set permissions manually, they are usually blocked by security software.
I recently ran into this problem and spent a lot of time finally found out that the security software on my workstation was not adding aapt2 and aapt to the allowed list for the project repository.

Flutter Build Issue: Build APK Fails for flutter App

C:\src\flutter\bin\flutter.bat – no-color build apk
Waiting for another flutter command to release the startup lock...
You are building a fat APK that includes binaries for android-arm, android-ARM64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
To generate an app bundle, run:
flutter build appbundle – target-platform android-arm, android-ARM64, android-x64
Learn more on: https://developer.android.com/guide/app-bundle
To split the APKs per ABI, run:
flutter build apk – target-platform android-arm, android-ARM64, android-x64 – split-per-abi
Learn more on: https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
Running Gradle task 'assembleRelease'...
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app: mergeReleaseResources'.
Multiple task action failures occurred:
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
C:\Users\mysel\AndroidStudioProjects\Chatting-app-with-firebase\android\app\src\main\res\mipmap-hdpi\ic_launcher.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.
C:\Users\mysel\AndroidStudioProjects\Chatting-app-with-firebase\android\app\src\main\res\mipmap-hdpi\ic_launcher.png: AAPT: error: file failed to compile.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
C:\Users\mysel\AndroidStudioProjects\Chatting-app-with-Firebase\Android\app\src\main\res\mipmap-xxhdpi\ic_launcher.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.
C:\Users\mysel\AndroidStudioProjects\Chatting-app-with-firebase\android\app\src\main\res\mipmap-xxhdpi\ic_launcher.png: AAPT: error: file failed to compile.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
C:\Users\mysel\AndroidStudioProjects\Chatting-app-with-firebase\android\app\src\main\res\mipmap-xxxhdpi\ic_launcher.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.
C:\Users\mysel\AndroidStudioProjects\Chatting-app-with-firebase\android\app\src\main\res\mipmap-xxxhdpi\ic_launcher.png: AAPT: error: file failed to compile.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
C:\Users\mysel\AndroidStudioProjects\Chatting-app-with-Firebase\Android\app\src\main\res\mipmap-mdpi\ic_launcher.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.
C:\Users\mysel\AndroidStudioProjects\Chatting-app-with-firebase\android\app\src\main\res\mipmap-mdpi\ic_launcher.png: AAPT: error: file failed to compile.
Try:
Run with – stacktrace option to get the stack trace. Run with – info or – debug option to get more log output. Run with – scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 1m 16s
Running Gradle task 'assembleRelease'... 80.3s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
✏️ Creating android\settings_aar.gradle...
[!] Flutter tried to create the file android\settings_aar.gradle, but failed.
To manually update settings.gradle, follow these steps:
Copy settings.gradle as settings_aar.gradle
Remove the following code from settings_aar.gradle:
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
Please create the file and run this command again.
Process finished with exit code 1
Tried changing daemon in build.properties file, tried Invalidate cache/restart but nothing seems to work

Running React-Native App locally (FB F8 App) - Build Failed Error

I am trying to run a the react-native app that was used at F8 locally. I am following the instructions here: http://makeitopen.com/tutorials/building-the-f8-app/local-setup/
I have everything work correctly (I can go to http://localhost:8080/dashboard/apps and http://localhost:8080/graphql and see data and run queries)
However, when I try to run the builds for iOS and Android, I am running into errors.
Android Error:
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/thisuser/f8app/android/app/build.gradle' line: 124
* What went wrong:
A problem occurred evaluating project ':app'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1 mins 4.006 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
iOS Error:
=== BUILD TARGET CodePush OF PROJECT Pods WITH CONFIGURATION Debug ===
Check dependencies
** BUILD FAILED **
The following build commands failed:
CompileC /Users/thisuser/f8app/ios/build/Build/Intermediates/Pods.build/Debug-iphonesimulator/react-native-fbsdk.build/Objects-normal/x86_64/RCTConvert+FBSDKSharingContent.o /Users/thisuser/f8app/node_modules/react-native-fbsdk/iOS/RCTFBSDK/share/RCTConvert+FBSDKSharingContent.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/F8v2.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
/Users/thisuser/f8app/node_modules/react-native/node_modules/promise/lib/done.js:10
throw err;
^
Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/F8v2.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
at checkExecSyncError (child_process.js:464:13)
at Object.execFileSync (child_process.js:484:13)
at _runIOS (/Users/thisuser/f8app/node_modules/react-native/local-cli/runIOS/runIOS.js:82:32)
at /Users/thisuser/f8app/node_modules/react-native/local-cli/runIOS/runIOS.js:24:5
at tryCallTwo (/Users/thisuser/f8app/node_modules/react-native/node_modules/promise/lib/core.js:45:5)
at doResolve (/Users/thisuser/f8app/node_modules/react-native/node_modules/promise/lib/core.js:200:13)
at new Promise (/Users/thisuser/f8app/node_modules/react-native/node_modules/promise/lib/core.js:66:3)
at Array.runIOS (/Users/thisuser/f8app/node_modules/react-native/local-cli/runIOS/runIOS.js:23:10)
at Object.run (/Users/thisuser/f8app/node_modules/react-native/local-cli/cliEntry.js:96:13)
at Object.<anonymous> (/usr/local/lib/node_modules/react-native-cli/index.js:88:7)
How do I make these work?
For android only
You will need to set Android SDK path like this and must have at least Android SDK Build-Tools Rev 23.0.1.

Ionic Build android Error with Exit code 1

BUILD FAILED
C:\Program Files\Android\Sdk\tools\ant\build.xml:716: The following error occurr
ed while executing this line:
C:\Program Files\Android\Sdk\tools\ant\build.xml:730: Compile failed; see the co
mpiler error output for details.
Total time: 2 seconds
F:\todo\Ionic\Teller\src\platforms\android\cordova\node_modules\q\q.js:126
throw e; ^ Error code 1 for command: cmd with args:
/s,/c,ant,debug,-f,F:\Verifast\Ionic\Te
ller\src\platforms\android\build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-
gen ERROR building one of the platforms: Error: cmd: Command failed
with exit code 1
You may not have the required environment or OS to build this project Error: cmd: Command failed with exit code 1
Please help
try running the android tools and installing the items below:
Open the SDK manager.
You will require:
1. "SDK Platform" for android-23
2. "Android SDK Platform-tools (latest)
3. "Android SDK Build-tools" (latest)]
cordova platform update android
will fix the error. Cordova is always one behind the android version eg if we have android API 24 then we have cordova 5.x.x supporting upto API 23. Hence any project is build using API 24(eg. using Android Studio) will show this error.
For better understanding I have posted error that I got:
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'android'.
Could not resolve all dependencies for configuration ':_debugApk'.
A problem occurred configuring project ':CordovaLib'.
Could not resolve all dependencies for configuration ':CordovaLib:classpath'.
Could not find com.android.tools.build:gradle:2.2.3.
Searched in the following locations:
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.jar
Required by:
android:CordovaLib:unspecified
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Categories

Resources