I am fairly new to Kivy and Android app development. I did a basic hello world app with Kivy and was trying to make an APK from it with Buildozer. These were the errors that I see:
-compile:
[javac] Compiling 11 source files to /home/ratul/Devel/Python/Kivy/test/.buildozer/android/platform/python-for-android/dist/ratulsapp/bin/classes
[javac] /home/ratul/Devel/Python/Kivy/test/.buildozer/android/platform/python-for-android/dist/ratulsapp/src/org/renpy/android/PythonService.java:64: error: cannot find symbol
[javac] notification.setLatestEventInfo(context, serviceTitle, serviceDescription, pIntent);
[javac] ^
[javac] symbol: method setLatestEventInfo(Context,String,String,PendingIntent)
[javac] location: variable notification of type Notification
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] 1 error
BUILD FAILED
/home/ratul/Devel/Android/Sdk/tools/ant/build.xml:716: The following error occurred while executing this line:
/home/ratul/Devel/Android/Sdk/tools/ant/build.xml:730: Compile failed; see the compiler error output for details.
I don't understand where the problem is coming from. I tried specifying version from main.py but that doesn't help either. Any pointers? Thanks in advance.
Notification.setLatestEventInfo is removed in API Level 23 (Android 6.0):
https://developer.android.com/sdk/api_diff/23/changes/android.app.Notification.html
Here some solutions to use instead: How to implement the deprecated methods of Notification
Related
Cannot build iOS app after upgrading from RN version 0.63.2 to 0.65.0-rc.3. I am getting this error:
In file included from /Users/.../ReactNativeProjects/.../node_modules/react-native-gesture-handler/ios/RNGestureHandlerManager.m:1:
/Users/.../ReactNativeProjects/.../node_modules/react-native-gesture-handler/ios/RNGestureHandlerManager.h:9:52: error: expected a type
eventDispatcher:(nonnull RCTEventDispatcher *)eventDispatcher;
Problem is in RNGestureHandlerManager.h, on the line below:
- (nonnull instancetype)initWithUIManager:(nonnull RCTUIManager *)uiManager
eventDispatcher:(nonnull RCTEventDispatcher *)eventDispatcher;
When I upgrade to RNGestureHandler version 1.10.3 I get the errors below:
Undefined symbol: OBJC_CLASS$_RCTScrollView
Undefined symbol: OBJC_METACLASS$_RCTViewManager
Undefined symbol: OBJC_CLASS$_RCTEventEmitter
Undefined symbol: __RCTNotImplementedException
Undefined symbol: _RCTGetUIManagerQueue
Undefined symbol: OBJC_CLASS$_RCTConvert
Undefined symbol: _RCTRegisterModule
Undefined symbol: _RCTDefaultLogFunction
Undefined symbol: OBJC_CLASS$_RCTRootView
Undefined symbol: OBJC_METACLASS$_RCTEventEmitter
Undefined symbol: OBJC_CLASS$_RCTTouchHandler
Undefined symbol: OBJC_CLASS$_RCTViewManager
Undefined symbol: __RCTLogNativeInternal
It has been 3 days since I submitted the issue on the github page but no response from the team. I would really appreciate any help. Any ideas are welcome! This has really started to bother me.
Here is a link to the issue I created on github: https://github.com/software-mansion/react-native-gesture-handler/issues/1543
Thanks a lot...
Alright. After a couple of days of reading/digging and trying many different solutions this is how I fixed it.
1- Added the import statement below in RNGestureHandlerManager.h
#import <React/RCTEventDispatcher.h>
When I tried to re-build the app, this created the same Undefined symbol errors as if I had updated the RNGestureHandler version to 1.10.3 (see the red error messages in the question).
2- Here is the critical part.
I checked "ONLY_ACTIVE_ARCH" setting under Build Settings of the main project target. It was 'YES' for both debug and release modes.
Then I checked the same settings for RNGestureHandler package inside the Pods project. In my case, it was YES for debug and NO for release. I was trying to build the app in Release mode so I changed this setting to YES for release mode for the RNGestureHandler package.
Then I tried building my app again. This time the Undefined symbol errors for the RNGestureHandler package were gone. Similar messages started to show up for other packages. I did the same settings update for all the packages that created these Undefined symbol errors and finally, my app was built successfully in release mode! Hope this helps.
react-native-gesture-handled lib was upgraded and the fix is included, so upgrading the library will fix it.
This was fixed in a newer version of the lib.
In your package.json file, change the version of the react-native-gesture-handler lib to ~2.5.0 or higher. Then run yarn or npm i, followed by cd ios && pod install.
I want to create a folder to try downloading files. so I added simple_permission but I got an error migrating to androidX even though I migrated to androidX. how can I resolve this error?
Launching lib\main.dart on Coolpad E502 in debug mode...
D:\Flutter\flutter.pub-cache\hosted\pub.dartlang.org\simple_permissions-0.1.9\android\src\main\java\com\ethras\simplepermissions\SimplePermissionsPlugin.java:9: error: cannot find symbol
import android.support.v4.app.ActivityCompat;
^
symbol: class ActivityCompat
location: package android.support.v4.app
D:\Flutter\flutter.pub-cache\hosted\pub.dartlang.org\simple_permissions-0.1.9\android\src\main\java\com\ethras\simplepermissions\SimplePermissionsPlugin.java:10: error: package android.support.v4.content does not exist
import android.support.v4.content.ContextCompat;
^
D:\Flutter\flutter.pub-cache\hosted\pub.dartlang.org\simple_permissions-0.1.9\android\src\main\java\com\ethras\simplepermissions\SimplePermissionsPlugin.java:156: error: cannot find symbol
ActivityCompat.requestPermissions(activity, perm, 0);
^
symbol: variable ActivityCompat
location: class SimplePermissionsPlugin
D:\Flutter\flutter.pub-cache\hosted\pub.dartlang.org\simple_permissions-0.1.9\android\src\main\java\com\ethras\simplepermissions\SimplePermissionsPlugin.java:163: error: cannot find symbol
return PackageManager.PERMISSION_GRANTED == ContextCompat.checkSelfPermission(activity, permission);
^
symbol: variable ContextCompat
location: class SimplePermissionsPlugin
D:\Flutter\flutter.pub-cache\hosted\pub.dartlang.org\simple_permissions-0.1.9\android\src\main\java\com\ethras\simplepermissions\SimplePermissionsPlugin.java:171: error: cannot find symbol
if (ActivityCompat.shouldShowRequestPermissionRationale(registrar.activity(), permission)) {
^
symbol: variable ActivityCompat
location: class SimplePermissionsPlugin
D:\Flutter\flutter.pub-cache\hosted\pub.dartlang.org\simple_permissions-0.1.9\android\src\main\java\com\ethras\simplepermissions\SimplePermissionsPlugin.java:175: error: cannot find symbol
if (ActivityCompat.checkSelfPermission(registrar.context(), permission) == PackageManager.PERMISSION_GRANTED) {
^
symbol: variable ActivityCompat
location: class SimplePermissionsPlugin
6 errors
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':simple_permissions:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
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 45s
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.\
Exited (sigterm)
I had the same error and what I did was change the version of klotin in the build.gradle file I have it as follows
buildscript {
ext.kotlin_version = '1.3.72'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.2'
}
}
I am using javac in ant to compile a project and I am getting an compilation error message without the file or line number. Why is this and how can i find where in the (large) project the problem is?
build.xml
make_folders:
compile:
[javac] Compiling 33 source files to *project root*/bin/classes
[javac] error: incompatible types: String cannot be converted to Integer
[javac] Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
[javac] 1 error
BUILD FAILED
*project root*/build.xml:33: Compile failed; see the compiler error output for details.
And heres the relevant lines with verbose set to true:
[javac] [loading ZipFileIndexFileObject[/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/lib/ct.sym(META-INF/sym/rt.jar/java/util/Date.class)]]
[javac] error: incompatible types: String cannot be converted to Integer
UPDATE:
So I managed to figure out that the error it was originating from calling a function in a class from within an inner class in said outer class. I'm not sure why this produced an error or why it was presented with such little information so any help would still be appreciated.
I am trying to compile the canonical metamodel classes for some JPA entities using an ant script. I am using OpenJPA. I would like the generated files to be located in a subdirectory which, according to the OpenJPA documentation, I can do by specifying the -s option for javac. The way I am trying to do this right now is like this:
<compilerarg value="-s c:\buildfiles"/>
However, I keep getting an error that says:
javac: invalid flag: -s
Usage: javac <options> <source files>
If I do:
<compilerarg value="-version"/>
it tells me that I am using 1.6. And if I do:
<compilerarg value="-help"/>
it lists -s as a valid option. Does anybody have any advice on what I can do to accomplish what I'm trying to do? Thank you!
You have two args in there, with a space between them. You just need to separate them:
<compilerarg value="-s"/>
<compilerarg value="c:\buildfiles"/>
At the moment you're parsing the single arg "-s c:\buildfiles". If you run
ant -verbose
you can verify this - you'll see something like:
[javac] Compilation arguments:
[javac] '-classpath'
[javac] ''
[javac] '-sourcepath'
[javac] '/a/b/c'
[javac] '-target'
[javac] '1.5'
[javac] '-g:none'
[javac] '-s c:\buildfiles' <-- here is the problem
[javac] '-source'
[javac] '1.5'
[javac]
[javac] The ' characters around the executable and arguments are
[javac] not part of the command.
I am getting the following type of error, can anyone help on this .I have used Eclipse 3.2.2 and Blackberry-5.0.0 jar,compiler compliance level 1.4,jdk 1.5 and j2mepolish-2.1.4.jar
C:\Documents and Settings\Administrator\workspace1\TTMFBlackBerry\src\ChangeOfDividendPoster.java:12: package net.rim.device.api.io.transport does not exist
[javac] import net.rim.device.api.io.transport.ConnectionDescriptor;
[javac] ^
[javac] C:\Documents and Settings\Administrator\workspace1\TTMFBlackBerry\src\ChangeOfDividendPoster.java:13: package net.rim.device.api.io.transport does not exist
[javac] import net.rim.device.api.io.transport.ConnectionFactory;
[javac] ^
[javac] C:\Documents and Settings\Administrator\workspace1\TTMFBlackBerry\src\ChangeOfDividendPoster.java:101: cannot find symbol
[javac] symbol : class ConnectionFactory
[javac] location: class ChangeOfDividendPoster
[javac] ConnectionFactory connFact = new ConnectionFactory();
[javac] ^
[javac] C:\Documents and Settings\Administrator\workspace1\TTMFBlackBerry\src\ChangeOfDividendPoster.java:101: cannot find symbol
[javac] symbol : class ConnectionFactory
[javac] location: class ChangeOfDividendPoster
[javac] ConnectionFactory connFact = new ConnectionFactory();
[javac] ^
[javac] C:\Documents and Settings\Administrator\workspace1\TTMFBlackBerry\src\ChangeOfDividendPoster.java:102: cannot find symbol
[javac] symbol : class ConnectionDescriptor
[javac] location: class ChangeOfDividendPoster
[javac] ConnectionDescriptor connDesc;
[javac] ^
[javac] 5 errors
[javac] If an API-class was not found, you might need to define where to find the device-APIs. Following classpath has been used: [C:\Program Files\J2ME-Polish2.2.1\import\mmapi.jar;C:\Program Files\J2ME-Polish2.2.1\import\cldc-1.1.jar;C:\Program Files\J2ME-Polish2.2.1\import\midp-2.0.jar;C:/Program Files/J2ME-Polish2.2.1/import/nokia-ui.jar;C:/Program Files/J2ME-Polish2.2.1/import/pdaapi.jar;C:/Program Files/J2ME-Polish2.2.1/import/btapi.jar;C:/Program Files/J2ME-Polish2.2.1/import/wmapi-2.0.jar;C:/Program Files/J2ME-Polish2.2.1/import/wmapi.jar;C:/Program Files/J2ME-Polish2.2.1/import/m3g.jar;C:/Program Files/J2ME-Polish2.2.1/import/jsr172.jar;C:/Program Files/J2ME-Polish2.2.1/import/jsr234.jar].
Looks like the compiler cannot find RIM's BlackBerry APIs, make sure your project has JRE System Library [BlackBerry JRE x.0.0] in the Libraries of the Build Path (net_rim_api.jar). It's not listed in your output after "Following classpath has been used". The path where this is found should be something like BLACKBERRY ECLIPSE ROOT\plugins\net.rim.ejde.componentpackVERSION\components\lib.