[ 
https://issues.apache.org/jira/browse/NETBEANS-2638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16859275#comment-16859275
 ] 

Lou Hamersly edited comment on NETBEANS-2638 at 6/8/19 5:23 PM:
----------------------------------------------------------------

I don't _think_ this is really Android related, it just happens to be an 
Android project. Under the main project (/jmonkeyengine), I believe you can do 
the following to reproduce: 

1) Set buildAndroidExamples = true in the root project's gradle.properties file:
 # specify if SDK and Native libraries get built
 buildNativeProjects = false
 *buildAndroidExamples = true*

2) Set a valid Android SDK path in the *local.properties* file located in the 
root project folder. (I don't do Android so this was a sidetrack to get, but if 
you already have it...) 

3) As shown in the issue above, I increased the SDK version to 27 from 23 so 
the android-examples subproject starts like this: 

apply plugin: 'com.android.application'

android {
 *compileSdkVersion 27*
 *buildToolsVersion "27.0.3"*

The 3rd step may not even be necessary, I just reverted it back and I'm still 
getting the NPE. 

When starting a manual build of jme3-android examples from NB with those 
changes, I was able to reproduce this again just now. Also I'm not sure if it 
happened the first time immediately (unless I just missed it), so it might take 
a few attempts to get it to show up. But I'm definitely getting it consistently 
now on manual builds. I know I ran with stacktraces enabled a few times using 
Run Gradle->Tasks->"build" with Stack Trace set to FULL in the dropdown, so 
that may have been a trigger. 

Note: I had moved on to other things since reporting this, so I had to recreate 
the conditions just now, hopefully I'm not forgetting something. 

!nb1.png!


was (Author: louhy):
Under the main project (/jmonkeyengine), I believe you can do the following to 
reproduce: 

1) Set buildAndroidExamples = true in the root project's gradle.properties file:
# specify if SDK and Native libraries get built
buildNativeProjects = false
*buildAndroidExamples = true*

2) Set a valid Android SDK path in the *local.properties* file located in the 
root project folder. (I don't do Android so this was a sidetrack to get, but if 
you already have it...) 

3) As shown in the issue above, I increased the SDK version to 27 from 23 so 
the android-examples subproject starts like this: 

apply plugin: 'com.android.application'

android {
 *compileSdkVersion 27*
 *buildToolsVersion "27.0.3"*

The 3rd step may not even be necessary, I just reverted it back and I'm still 
getting the NPE. 

When starting a manual build of jme3-android examples from NB with those 
changes, I was able to reproduce this again just now. Also I'm not sure if it 
happened the first time immediately (unless I just missed it), so it might take 
a few attempts to get it to show up. But I'm definitely getting it consistently 
now on manual builds. I know I ran with stacktraces enabled a few times using 
Run Gradle->Tasks->"build" with Stack Trace set to FULL in the dropdown, so 
that may have been a trigger. 

Note: I had moved on to other things since reporting this, so I had to recreate 
the conditions just now, hopefully I'm not forgetting something. 

!nb1.png!

> NullPointerException within GradleBaseProjectBuilder
> ----------------------------------------------------
>
>                 Key: NETBEANS-2638
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-2638
>             Project: NetBeans
>          Issue Type: Bug
>          Components: projects - Gradle
>         Environment: Linux
>            Reporter: Lou Hamersly
>            Assignee: Laszlo Kishalmi
>            Priority: Major
>         Attachments: nb1.png
>
>
> Encountered this error reported by NetBeans 11 with Groovy/Gradle plugin 
> 1.0.1: 
> {noformat}
> java.lang.NullPointerException
>  at java.base/java.util.AbstractCollection.addAll(AbstractCollection.java:351)
>  at 
> org.netbeans.modules.gradle.api.GradleBaseProjectBuilder.processDependencies(GradleBaseProjectBuilder.java:128)
>  at 
> org.netbeans.modules.gradle.api.GradleBaseProjectBuilder.build(GradleBaseProjectBuilder.java:75)
>  at 
> org.netbeans.modules.gradle.api.GradleBaseProjectBuilder$Extractor.extract(GradleBaseProjectBuilder.java:288)
>  at 
> org.netbeans.modules.gradle.GradleProjectCache.createGradleProject(GradleProjectCache.java:432)
>  at 
> org.netbeans.modules.gradle.GradleProjectCache.loadGradleProject(GradleProjectCache.java:257)
>  at 
> org.netbeans.modules.gradle.GradleProjectCache.access$100(GradleProjectCache.java:85)
> [catch] at 
> org.netbeans.modules.gradle.GradleProjectCache$ProjectLoaderTask.call(GradleProjectCache.java:348)
>  at 
> org.netbeans.modules.gradle.GradleProjectCache$ProjectLoaderTask.call(GradleProjectCache.java:326)
>  at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
>  at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
>  at 
> org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
>  at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
>  at 
> org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033){noformat}
> This was encountered building the jme3-android-examples subproject located in 
> this repository: [https://github.com/jMonkeyEngine/jmonkeyengine] 
> Unfortunately some setup (Android SDK related) would be involved to reproduce 
> (I may be able to help test), however since this appears to be "source set" 
> related, glancing at the code I suspect it may have something to do with 
> relative paths used in the build file. Build file used for the subproject is 
> below. 
> (Note  - the version number on the 4th/5th line was changed from 23 to 27 
> from the repo's version to bypass a compile issue. This NPE was encountered 
> with the below build file.)
>  
> {code:java}
> apply plugin: 'com.android.application'
> android {
>  compileSdkVersion 27
>  buildToolsVersion "27.0.3"
> lintOptions {
>  // Fix nifty gui referencing "java.awt" package.
>  disable 'InvalidPackage'
>  abortOnError false
>  }
> defaultConfig {
>  applicationId "org.jmonkeyengine.jme3androidexamples"
>  minSdkVersion 15 // Android 4.0.3 ICE CREAM SANDWICH
>  targetSdkVersion 22 // Android 5.1 LOLLIPOP
>  versionCode 1
>  versionName "1.0" // TODO: from settings.gradle
>  }
> buildTypes {
>  release {
>  minifyEnabled false
>  proguardFiles getDefaultProguardFile('proguard-android.txt'), 
> 'proguard-rules.pro'
>  }
>  }
> sourceSets {
>  main {
>  java {
>  srcDir 'src/main/java'
>  }
>  assets {
>  srcDir 'src/assets'
>  srcDir '../jme3-testdata/src/main/resources'
>  srcDir '../jme3-examples/src/main/resources'
>  }
>  }
>  }
> }
> dependencies {
>  compile fileTree(dir: 'libs', include: ['*.jar'])
>  testCompile 'junit:junit:4.12'
>  compile 'com.android.support:appcompat-v7:23.3.0'
> compile project(':jme3-core')
>  compile project(':jme3-android')
>  compile project(':jme3-android-native')
>  compile project(':jme3-effects')
>  compile project(':jme3-bullet')
>  compile project(':jme3-bullet-native-android')
>  compile project(':jme3-networking')
>  compile project(':jme3-niftygui')
>  compile project(':jme3-plugins')
>  compile project(':jme3-terrain')
>  compile fileTree(dir: '../jme3-examples/build/libs', include: ['*.jar'], 
> exclude: ['*sources*.*'])
> // compile project(':jme3-examples')
> }
> {code}
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to